Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exodiff/EPU/io_shell changeset modifications #547

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9750e0d
EXODIFF: Modifications to support changesets
gdsjaar Nov 15, 2024
8979ab2
EXODUS: Minor cleanup
gdsjaar Nov 15, 2024
7b967fc
EXODUS: Possible change for changeset support. Need to decide if thi…
gdsjaar Nov 15, 2024
33bb5e2
Committing clang-format changes
github-actions[bot] Nov 15, 2024
f5a0a6d
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Nov 18, 2024
73de68d
EXODIFF: Clean up change-set handling
gdsjaar Nov 18, 2024
bc230be
Committing clang-format changes
github-actions[bot] Nov 18, 2024
91b34a6
EXODIFF: Fix memory issue with cached static vector size
gdsjaar Nov 18, 2024
543a637
Clean up compiler warnings
gdsjaar Nov 18, 2024
9498dba
EXODUS: Handle cleanup of files with groups on ex_close
gdsjaar Nov 18, 2024
b349ab8
Committing clang-format changes
github-actions[bot] Nov 18, 2024
aa05090
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Nov 19, 2024
466ddbd
EXODIFF: Do not open file if empty name
gdsjaar Nov 20, 2024
be6f7ef
EXODIFF: Support summary flag, refactor changeset parsing
gdsjaar Nov 20, 2024
45a20cc
Committing clang-format changes
github-actions[bot] Nov 20, 2024
3f9ed9e
EXODIFF: Handle compare 1 file with cs, other with none
gdsjaar Nov 20, 2024
a42fb48
EXODIFF: Need different method for supporting changesets with variabl…
gdsjaar Nov 27, 2024
627f3a1
EXODIFF: Better handling of changeset with differing variable counts …
gdsjaar Nov 27, 2024
cecd4ed
Committing clang-format changes
github-actions[bot] Nov 27, 2024
24a3cda
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Dec 4, 2024
0af4a3a
IOSS: Get group writing working for parallel composed output
gdsjaar Dec 4, 2024
5c53570
Committing clang-format changes
github-actions[bot] Dec 4, 2024
cddd879
IOSS: Refactor some uses of IOSS_ERROR
gdsjaar Dec 5, 2024
34cb24a
Committing clang-format changes
github-actions[bot] Dec 5, 2024
cfc595d
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Dec 5, 2024
fb86276
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Dec 10, 2024
3753044
EPU: Refactor template int / double handling
gdsjaar Dec 4, 2024
fc176da
EPU: Refactor and initial changeset
gdsjaar Dec 4, 2024
aaf2530
EPU: Add option to select a specific change set on input file
gdsjaar Dec 4, 2024
196abca
EPU: Working with change sets now (alpha)
gdsjaar Dec 10, 2024
0e8e744
Committing clang-format changes
github-actions[bot] Dec 10, 2024
adfe509
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Jan 14, 2025
dfc19b9
CI: Install x11
gdsjaar Jan 14, 2025
f3f5720
CI: Another try at fixing x11 dependency
gdsjaar Jan 14, 2025
820b8b0
CI: Fix x11 dependency
gdsjaar Jan 14, 2025
d05e7f2
EPU: Clean up of change set handling
gdsjaar Jan 14, 2025
674cc17
Committing clang-format changes
github-actions[bot] Jan 14, 2025
767348a
EPU: Fix change set selection logic for files with no change sets
gdsjaar Jan 14, 2025
b98dc25
CI: Rebuild intel cache to see if fixes fmt issue
gdsjaar Jan 14, 2025
5085210
CI: See if affects intel build
gdsjaar Jan 15, 2025
e3b3fbf
CI: See if affects intel build
gdsjaar Jan 15, 2025
ea1ba5f
CI: Another try at intel - rebuild cache
gdsjaar Jan 15, 2025
48c3e8c
CI: Update intel compiler name
gdsjaar Jan 15, 2025
2e80e46
CI: Update kokkos version
gdsjaar Jan 15, 2025
6068c68
CI: Fix kokkos tpl install
gdsjaar Jan 15, 2025
d5cf5ce
CI: See if can get parallel threadsafe running
gdsjaar Jan 15, 2025
bb5dae9
CI: fix syntax
gdsjaar Jan 15, 2025
e5eff54
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Jan 15, 2025
aae51dc
APREPRO: Fix compiler warning
gdsjaar Jan 16, 2025
6e28a82
CONJOIN: first handling of change set files
gdsjaar Jan 16, 2025
976eb32
Committing clang-format changes
github-actions[bot] Jan 16, 2025
ba36f00
CONJOIN: Do not read sets if there are not any
gdsjaar Jan 16, 2025
f0760b0
IOSS: Add tinit and tdelta to generated mesh to control timestep output
gdsjaar Jan 17, 2025
1d0b9cd
IOSS: Add two conjoin changeset tests
gdsjaar Jan 17, 2025
38d6f7f
Committing clang-format changes
github-actions[bot] Jan 17, 2025
a2272de
CONJOIN: Fix potential memory issue in group name inquiry
gdsjaar Jan 17, 2025
01b38eb
Committing clang-format changes
github-actions[bot] Jan 17, 2025
0b0fa66
CI: Add testing of cs decomp/compose/epu
gdsjaar Jan 17, 2025
36823de
Merge branch 'master' into exodiff-changeset-modifications
gsjaardema Jan 17, 2025
9e7ad89
CONJOIN: Fix integer 64/32 bit handling
gdsjaar Jan 21, 2025
f339070
CONJOIN: Enable using single input file with no change sets
gdsjaar Jan 22, 2025
ddf9c4f
Committing clang-format changes
github-actions[bot] Jan 22, 2025
fd5024d
Fix spelling errors
gdsjaar Jan 22, 2025
2412786
EXPLORE: Basic support for change sets
gdsjaar Jan 22, 2025
bad3986
EXODUS_FOR: Basic support for change sets
gdsjaar Jan 22, 2025
fb081b9
Committing clang-format changes
github-actions[bot] Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TPL/compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ else
fi
if [ "$COMPILER" == "intel" ]
then
export CC=icc
export CXX=icc
export CC=icx
export CXX=icpx
fi
if [ "$COMPILER" == "analyzer" ]
then
Expand Down
1 change: 0 additions & 1 deletion install-tpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,6 @@ then
then
echo "${txtgrn}+++ Downloading...${txtrst}"
rm -rf kokkos

wget --no-check-certificate https://github.com/kokkos/kokkos/releases/download/${kokkos_version}/kokkos-${kokkos_version}.tar.gz
tar -zxf kokkos-${kokkos_version}.tar.gz
rm -f kokkos-${kokkos_version}.tar.gz
Expand Down
1,638 changes: 1,638 additions & 0 deletions packages/seacas/#tmp.txt#

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/cgi/vdicps.f
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2025 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand Down Expand Up @@ -1659,7 +1659,7 @@ SUBROUTINE VDSTLA(LOCX,LOCY)
C All Batch Devices.

C ENTRY CONDITIONS -LOCX,LOCY = real NDC position that the locator is
C initilaized to.
C initialized to.

C CALLS -

Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/cgi/vdicps_dual.f
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2025 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand Down Expand Up @@ -1657,7 +1657,7 @@ SUBROUTINE WCPSLA(LOCX,LOCY)
C All Batch Devices.

C ENTRY CONDITIONS -LOCX,LOCY = real NDC position that the locator is
C initilaized to.
C initialized to.

C CALLS -

Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/detopt.blk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2025 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand Down Expand Up @@ -31,7 +31,7 @@ C -- 'ANGLE' = angle element symbol
C -- 'CRACK' = crack element symbol
C -- 'STATE' = state element symbol
C -- 'SPHERE' = spherical element plot
C -- 'FSPHERE' = filled sperical element plot
C -- 'FSPHERE' = filled spherical element plot
C --IDTVAR - the selected variables
C --NNDVAR - the number of nodal variables needed
C --NEDVAR - the number of element variables needed
Expand Down
298 changes: 298 additions & 0 deletions packages/seacas/applications/conjoin/#CJ_ExodusFile.C#
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
// Copyright(C) 1999-2021, 2023, 2024, 2025 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
// See packages/seacas/LICENSE for details

#include "CJ_CodeTypes.h" // for StringIdVector, etc
#include "CJ_ExodusFile.h"
#include "CJ_SystemInterface.h"
#include "open_file_limit.h"
#include "smart_assert.h"

#include <climits>
#include <cstdlib>
#include <fmt/ostream.h>
#include <iomanip>
#include <iostream>
#include <string>

#include <exodusII.h>

std::vector<int> Excn::ExodusFile::fileids_;
std::vector<std::string> Excn::ExodusFile::filenames_;
int Excn::ExodusFile::outputId_ = -1;
int Excn::ExodusFile::ioWordSize_ = 0;
int Excn::ExodusFile::cpuWordSize_ = 0;
std::string Excn::ExodusFile::outputFilename_;
bool Excn::ExodusFile::keepOpen_ = false;
bool Excn::ExodusFile::usingChangeSets_ = false;
int Excn::ExodusFile::maximumNameLength_ = 32;
int Excn::ExodusFile::exodusMode_ = 0;

Excn::ExodusFile::ExodusFile(size_t which) : myLocation_(which)
{
SMART_ASSERT(which < filenames_.size())(which)(filenames_.size());
SMART_ASSERT(fileids_.size() == filenames_.size());
if (!keepOpen_ && which != 0) {
float version = 0.0;
int cpu_word_size = cpuWordSize_;
int io_wrd_size = ioWordSize_;
SMART_ASSERT(fileids_[which] == -1)(which)(fileids_[which]);
fileids_[which] = ex_open(filenames_[which].c_str(), EX_READ | exodusMode_, &cpu_word_size,
&io_wrd_size, &version);
if (fileids_[which] < 0) {
fmt::print(stderr, "ERROR: Cannot open file '{}' - exiting\n", filenames_[which]);
exit(1);
}
ex_set_max_name_length(fileids_[which], maximumNameLength_);

SMART_ASSERT(io_wrd_size == ioWordSize_);
SMART_ASSERT(cpu_word_size == cpuWordSize_);
}
}

bool Excn::ExodusFile::ints_64_bit()
{
return exodusMode_ & EX_ALL_INT64_API;
}

int Excn::ExodusFile::output()
{
SMART_ASSERT(outputId_ >= 0);
return outputId_;
}

Excn::ExodusFile::operator int() const
{
SMART_ASSERT(fileids_[myLocation_] >= 0);
return fileids_[myLocation_];
}

Excn::ExodusFile::~ExodusFile()
{
try {
if (!keepOpen_ && myLocation_ != 0) {
SMART_ASSERT(fileids_[myLocation_] > 0)(myLocation_)(fileids_[myLocation_]);
ex_close(fileids_[myLocation_]);
fileids_[myLocation_] = -1;
}
}
catch (...) {
}
}

void Excn::ExodusFile::close_all()
{
if (usingChangeSets_) {
ex_close(fileids_[0]);
}
else {
for (auto &elem : fileids_) {
if (elem > 0) {
ex_close(elem);
}
elem = -1;
}
}
ex_close(outputId_);
outputId_ = -1;
}

bool Excn::ExodusFile::initialize(const SystemInterface &si)
{
// See if we can keep files open
size_t max_files = open_file_limit() - 1; // We also have an output exodus file...
if (si.inputFiles_.size() <= max_files) {
keepOpen_ = true;
if ((si.debug() & 1) != 0) {
fmt::print("Files kept open... (Max open = {})\n\n", max_files);
}
}
else {
keepOpen_ = false;
fmt::print("Single file mode... (Max open = {})\n\n", max_files);
}

float version = 0.0;
int overall_max_name_length = 32;

if (si.inputFiles_.size() == 1) {
// The file should contain multiple change sets which will be concatenated...
int cpu_word_size = sizeof(double);
int io_wrd_size = sizeof(double);
std::string name = si.inputFiles_[0];
int exoid = ex_open(name.c_str(), EX_READ, &cpu_word_size, &io_wrd_size, &version);
if (exoid < 0) {
fmt::print(stderr, "ERROR: Cannot open file '{}'\n", name);
return false;
}

int num_change_sets = ex_inquire_int(exoid, EX_INQ_NUM_CHILD_GROUPS);
if (num_change_sets > 1) {
usingChangeSets_ = true;

if (io_wrd_size < static_cast<int>(sizeof(float))) {
io_wrd_size = sizeof(float);
}

ioWordSize_ = io_wrd_size;
cpuWordSize_ = io_wrd_size;

if (((ex_int64_status(exoid) & EX_ALL_INT64_DB) != 0) || si.ints_64_bit()) {
exodusMode_ = EX_ALL_INT64_API;
}

int name_length = ex_inquire_int(exoid, EX_INQ_DB_MAX_USED_NAME_LENGTH);
if (name_length > overall_max_name_length) {
overall_max_name_length = name_length;
}

// create exo names
filenames_.resize(num_change_sets);
fileids_.resize(num_change_sets, exoid);

// Get names of change sets...
int group_name_length = ex_inquire_int(exoid, EX_INQ_GROUP_NAME_LEN);
group_name_length = std::max(32, group_name_length);
std::vector<char> group_name(group_name_length + 1, '\0');

for (int i = 1; i <= num_change_sets; i++) {
int idum = 0;
float rdum = 0.0;
// Get name of this group...
int ierr = ex_inquire(exoid + i, EX_INQ_GROUP_NAME, &idum, &rdum, group_name.data());
if (ierr != EX_NOERR) {
fmt::print(stderr, "ERROR: Could not get name for group {} in input file '{}'\n", i + 1,
name);
return false;
}
filenames_[i - 1] = std::string(group_name.data());
fileids_[i - 1] = exoid + i;
fmt::print("Part {}: '{}'\n", i, filenames_[i - 1]);
}
}
}

if (!usingChangeSets_) {
// create exo names
filenames_.resize(si.inputFiles_.size());
fileids_.resize(si.inputFiles_.size(), -1);

for (size_t p = 0; p < si.inputFiles_.size(); p++) {
std::string name = si.inputFiles_[p];

filenames_[p] = name;

if (p == 0) {
int cpu_word_size = sizeof(float);
int io_wrd_size = 0;
int exoid = ex_open(filenames_[p].c_str(), EX_READ, &cpu_word_size, &io_wrd_size, &version);
if (exoid < 0) {
fmt::print(stderr, "ERROR: Cannot open file '{}'\n", filenames_[p]);
return false;
}

int name_length = ex_inquire_int(exoid, EX_INQ_DB_MAX_USED_NAME_LENGTH);
if (name_length > overall_max_name_length) {
overall_max_name_length = name_length;
}

if (((ex_int64_status(exoid) & EX_ALL_INT64_DB) != 0) || si.ints_64_bit()) {
exodusMode_ = EX_ALL_INT64_API;
}

ex_close(exoid);

if (io_wrd_size < static_cast<int>(sizeof(float))) {
io_wrd_size = sizeof(float);
}

ioWordSize_ = io_wrd_size;
cpuWordSize_ = io_wrd_size;
}

if (keepOpen_ || p == 0) {
int io_wrd_size = 0;
int mode = EX_READ | exodusMode_;

fileids_[p] = ex_open(filenames_[p].c_str(), mode, &cpuWordSize_, &io_wrd_size, &version);
if (fileids_[p] < 0) {
fmt::print(stderr, "ERROR: Cannot open file '{}'\n", filenames_[p]);
return false;
}
int num_change_sets = ex_inquire_int(fileids_[p], EX_INQ_NUM_CHILD_GROUPS);
if (num_change_sets > 1) {
fmt::print(stderr,
"ERROR: Cannot (yet) handle multiple input files containing change "
"sets.\n\tFile '{}' contains {} change sets.\n",
filenames_[p], num_change_sets);
return false;
}

SMART_ASSERT(ioWordSize_ == io_wrd_size)(ioWordSize_)(io_wrd_size);
}

fmt::print("Part {}: '{}'\n", p + 1, name);
}
}

maximumNameLength_ = overall_max_name_length;
if (keepOpen_) {
for (size_t p = 0; p < si.inputFiles_.size(); p++) {
ex_set_max_name_length(fileids_[p], maximumNameLength_);
}
}
else {
ex_set_max_name_length(fileids_[0], maximumNameLength_);
}
return true;
}

bool Excn::ExodusFile::create_output(const SystemInterface &si)
// Create output file...
{
outputFilename_ = si.outputName_;

int mode = EX_CLOBBER | exodusMode_;
if (si.ints_64_bit()) {
mode |= EX_ALL_INT64_DB;
}

if (si.compress_data() > 0 || si.use_netcdf4() || si.szip()) {
mode |= EX_NETCDF4;
}

fmt::print("Output: '{}'\n", outputFilename_);
outputId_ = ex_create(outputFilename_.c_str(), mode, &cpuWordSize_, &ioWordSize_);
if (outputId_ < 0) {
fmt::print(stderr, "ERROR: Cannot open file '{}'\n", outputFilename_);
return false;
}

if (si.compress_data() > 0) {
ex_set_option(outputId_, EX_OPT_COMPRESSION_LEVEL, si.compress_data());
ex_set_option(outputId_, EX_OPT_COMPRESSION_SHUFFLE, 1);

if (si.szip()) {
ex_set_option(outputId_, EX_OPT_COMPRESSION_TYPE, EX_COMPRESS_SZIP);
}
else if (si.zlib()) {
ex_set_option(outputId_, EX_OPT_COMPRESSION_TYPE, EX_COMPRESS_ZLIB);
}
else if (si.zstd()) {
ex_set_option(outputId_, EX_OPT_COMPRESSION_TYPE, EX_COMPRESS_ZSTD);
}
else if (si.bz2()) {
ex_set_option(outputId_, EX_OPT_COMPRESSION_TYPE, EX_COMPRESS_BZ2);
}

if (si.quantize()) {
ex_set_option(outputId_, EX_OPT_QUANTIZE_NSD, si.quantize_nsd());
}
}

fmt::print("IO Word size is {} bytes.\n", ioWordSize_);
ex_set_max_name_length(outputId_, maximumNameLength_);
return true;
}
Loading