Skip to content

Commit

Permalink
Automatic snapshot commit from seacas at 94e88d4519
Browse files Browse the repository at this point in the history
Origin repo remote tracking branch: 'origin/master'
Origin repo remote repo URL: 'origin = https://github.com/sandialabs/seacas'
Git describe: i2024-11-15-47-gc376c98dfe

At commit:

commit 94e88d451990cea8ff5520c769e6d29e0fd7cb9d
Author:  Greg Sjaardema <[email protected]>
Date:    Tue Jan 28 15:58:59 2025 -0700
Summary: IOSS: cgns - minor tweak to decomposition algorithm to avoid 0 intervals

* Several files -- remove trailing whitespace
* Several -- Cleanups from compiler and static analyzer warnings
* Exodiff -- Use Namelist as alias for std::vector<std::string>, Rename class ExoII_Read to Exo_Read
* Aprepro -- better error detection/reporting.  Support string+string for concatenation in addition to //
* Aprepro -- add a `format` function to print variable using a specified output format.
* Exodus -- clean up lots of trailing whitespace in tests
* Exodus -- support additional compression algorithms

* IOSS -- New change-set (dynamic topology) code [Tolu primarily]
* IOSS -- cgns decomp - fix bug giving 0 intervals on a zone

* nem_slice -- Use enum class and rename some enums
* Compression -- add zstd, bz2, and lossy quantize compression to several apps

Signed-off-by: Greg Sjaardema <[email protected]>
  • Loading branch information
gdsjaar committed Jan 29, 2025
1 parent 15038f6 commit 0a5f02f
Show file tree
Hide file tree
Showing 376 changed files with 26,437 additions and 20,751 deletions.
4 changes: 2 additions & 2 deletions packages/seacas/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ explicit install-user-include0 ;
install install-user-include0
: [ glob $(seacas-root)/libraries/ioss/src/*.h
$(seacas-root)/libraries/ioss/src/init/*.h ]
: <location>$(install-root)/io_system/include
: <location>$(install-root)/Sierra/include/io_system
;

explicit install-user-include1 ;
Expand Down Expand Up @@ -222,7 +222,7 @@ install install-user-include6
: [ glob $(seacas-root)/libraries/ioss/src/visualization/utils/*.h
$(seacas-root)/libraries/ioss/src/visualization/exodus/*.h
$(seacas-root)/libraries/ioss/src/visualization/cgns/*.h ]
: <location>$(install-root)/io_system/include
: <location>$(install-root)/Sierra/include/io_system
;


Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/applications/aprepro/test.inp_app
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ $ Test int and [] (shortcut for int)

$ Test looping - print sin, cos from 0 to 90 by 5
{Loop(19, _angle, 0, 5)}
{_angle} {_sa=sind(_angle)} {_ca=cosd(_angle)} {hypot(_sa, _ca)}
{_angle} {_sa=sind(_angle)} {_ca=cosd(_angle)} {hypot(_sa, _ca)}
{EndLoop}

$$$$ Test formatting and string concatenation
Expand All @@ -200,12 +200,12 @@ $$$$ Test string rescanning and executing
Original String:
{Test}
Rescanned String:
{rescan(Test)}
{rescan(Test)}
Original String:
{Test2}
Print Value of variable T = {T}
Rescanned String:
{rescan(Test2)}
{rescan(Test2)}
Print Value of variable T = {T}

Original String: {t1 = "atan2(0,-1)"}
Expand Down
48 changes: 24 additions & 24 deletions packages/seacas/applications/aprepro/test_standard.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $
Test number representations
1 1 1 1 1
1 1 1 1 1

Test assign statements:
5 5 $ Should print 5 5
10 10 $ Should print 10 10
Expand Down Expand Up @@ -51,8 +51,8 @@ $ Test ifndef - else lines
This line should be echoed (6)
This line should be echoed. (7)
$ Lines a, b, c, d, 1, 4, 6, 7 should be echoed
$ Check line counting -- should be on line 78:
$ Check line counting -- should be on line 78:

$ ========================================================================
$ Test string if lines
This line should be echoed ("greg")
Expand Down Expand Up @@ -89,25 +89,25 @@ $ Test int and [] (shortcut for int)
5 -5

$ Test looping - print sin, cos from 0 to 90 by 5
0 0 1 1
5 0.08715574275 0.9961946981 1
10 0.1736481777 0.984807753 1
15 0.2588190451 0.9659258263 1
20 0.3420201433 0.9396926208 1
25 0.4226182617 0.906307787 1
30 0.5 0.8660254038 1
35 0.5735764364 0.8191520443 1
40 0.6427876097 0.7660444431 1
45 0.7071067812 0.7071067812 1
50 0.7660444431 0.6427876097 1
55 0.8191520443 0.5735764364 1
60 0.8660254038 0.5 1
65 0.906307787 0.4226182617 1
70 0.9396926208 0.3420201433 1
75 0.9659258263 0.2588190451 1
80 0.984807753 0.1736481777 1
85 0.9961946981 0.08715574275 1
90 1 6.123233996e-17 1
0 0 1 1
5 0.08715574275 0.9961946981 1
10 0.1736481777 0.984807753 1
15 0.2588190451 0.9659258263 1
20 0.3420201433 0.9396926208 1
25 0.4226182617 0.906307787 1
30 0.5 0.8660254038 1
35 0.5735764364 0.8191520443 1
40 0.6427876097 0.7660444431 1
45 0.7071067812 0.7071067812 1
50 0.7660444431 0.6427876097 1
55 0.8191520443 0.5735764364 1
60 0.8660254038 0.5 1
65 0.906307787 0.4226182617 1
70 0.9396926208 0.3420201433 1
75 0.9659258263 0.2588190451 1
80 0.984807753 0.1736481777 1
85 0.9961946981 0.08715574275 1
90 1 6.123233996e-17 1

$$$$ Test formatting and string concatenation
%.10g
Expand Down Expand Up @@ -142,12 +142,12 @@ Original String:
Rescanned String:
This is line 1: 3.141592654
This is line 2: 0.7071067812
This is line 3: 0.7071067812
This is line 3: 0.7071067812
Original String:
This has an embedded string: {T = "This is a string"}
Print Value of variable T = 0
Rescanned String:
This has an embedded string: This is a string
This has an embedded string: This is a string
Print Value of variable T = This is a string

Original String: atan2(0,-1)
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/grpcom.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, 2024 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 All @@ -7,7 +7,7 @@ C See packages/seacas/LICENSE for details
COMMON /GRPCOC/ DEVNAM(2), DEVCOD(2)
CHARACTER*3 DEVNAM
CHARACTER*8 DEVCOD
COMMON /GRPCOM/ ICURDV,
COMMON /GRPCOM/ ICURDV,
& NSNAP(2), IFONT(2),
& MAXCOL(2), NUMCOL(0:1,2), MAPALT(2), MAPUSE(2),
& ISHARD, DEVOK(2), TALKOK(2), SOFTCH(2), AUTOPL(2)
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/mshcol.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, 2024 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 @@ -53,7 +53,7 @@ SUBROUTINE MSHCOL (FNCT, IELB, MLNTYP, WIDLIN, BLKCOL,

include 'dbnums.blk'
include 'linthc.blk'

CHARACTER*(*) FNCT
INTEGER MLNTYP(-1:1)
LOGICAL WIDLIN
Expand Down
12 changes: 11 additions & 1 deletion packages/seacas/applications/conjoin/CJ_ExodusFile.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2021, 2023 National Technology & Engineering Solutions
// Copyright(C) 1999-2021, 2023, 2024 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.
//
Expand Down Expand Up @@ -202,6 +202,16 @@ bool Excn::ExodusFile::create_output(const SystemInterface &si)
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_);
Expand Down
83 changes: 68 additions & 15 deletions packages/seacas/applications/conjoin/CJ_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,27 @@ void Excn::SystemInterface::enroll_options()
options_.enroll("64-bit", GetLongOption::NoValue,
"True if forcing the use of 64-bit integers for the output file", nullptr);

options_.enroll(
"zlib", GetLongOption::NoValue,
"Use the Zlib / libz compression method if compression is enabled (default) [exodus only].",
nullptr);
options_.enroll("zlib", GetLongOption::NoValue,
"Use the Zlib / libz compression method if compression is enabled (default) "
"[exodus only, enables netcdf-4].",
nullptr);

options_.enroll("szip", GetLongOption::NoValue,
"Use SZip compression. [exodus only, enables netcdf-4]", nullptr);
options_.enroll("zstd", GetLongOption::NoValue,
"Use Zstd compression. [exodus only, enables netcdf-4, experimental]", nullptr);
options_.enroll("bzip2", GetLongOption::NoValue,
"Use Bzip2 compression. [exodus only, enables netcdf-4, experimental]", nullptr);

options_.enroll("compress", GetLongOption::MandatoryValue,
"Specify the compression level to be used. Values depend on algorithm:\n"
"\t\tzlib/bzip2: 0..9\t\tszip: even, 4..32\t\tzstd: -131072..22",
nullptr);

options_.enroll(
"compress", GetLongOption::MandatoryValue,
"Specify the hdf5 (netcdf4) compression level [0..9] to be used on the output file.", nullptr,
nullptr, true);
options_.enroll("quantize_nsd", GetLongOption::MandatoryValue,
"Use the lossy quantize compression method. Value specifies number of digits to "
"retain (1..15) [exodus only]",
nullptr, nullptr, true);

options_.enroll("sort_times", GetLongOption::NoValue,
"Sort the input files on the minimum timestep time in the file.\n"
Expand Down Expand Up @@ -242,17 +251,61 @@ bool Excn::SystemInterface::parse_options(int argc, char **argv)
omitNodesets_ = options_.retrieve("omit_nodesets") != nullptr;
omitSidesets_ = options_.retrieve("omit_sidesets") != nullptr;

if (options_.retrieve("szip") != nullptr) {
szip_ = true;
zlib_ = false;
}
zlib_ = (options_.retrieve("zlib") != nullptr);
szip_ = (options_.retrieve("szip") != nullptr);
zstd_ = (options_.retrieve("zstd") != nullptr);
bz2_ = (options_.retrieve("bzip2") != nullptr);

if (szip_ + zlib_ + zstd_ + bz2_ > 1) {
fmt::print(stderr,
"ERROR: Only one of 'szip' or 'zlib' or 'zstd' or 'bzip2' can be specified.\n");
}

{
const char *temp = options_.retrieve("compress");
if (temp != nullptr) {
compressionLevel_ = std::strtol(temp, nullptr, 10);
if (!szip_ && !zlib_ && !zstd_ && !bz2_) {
zlib_ = true;
}

if (szip_ && zlib_) {
fmt::print(stderr, "ERROR: Only one of 'szip' or 'zlib' can be specified.\n");
if (zlib_ || bz2_) {
if (compressionLevel_ < 0 || compressionLevel_ > 9) {
fmt::print(stderr,
"ERROR: Bad compression level {}, valid value is between 0 and 9 inclusive "
"for gzip/zlib/bzip2 compression.\n",
compressionLevel_);
return false;
}
}
else if (szip_) {
if (compressionLevel_ % 2 != 0) {
fmt::print(
stderr,
"ERROR: Bad compression level {}. Must be an even value for szip compression.\n",
compressionLevel_);
return false;
}
if (compressionLevel_ < 4 || compressionLevel_ > 32) {
fmt::print(stderr,
"ERROR: Bad compression level {}, valid value is between 4 and 32 inclusive "
"for szip compression.\n",
compressionLevel_);
return false;
}
}
}
}

compressionLevel_ = options_.get_option_value("compress", compressionLevel_);
{
const char *temp = options_.retrieve("quantize_nsd");
if (temp != nullptr) {
quantizeNSD_ = std::strtol(temp, nullptr, 10);
if (!szip_ && !zlib_ && !zstd_ && !bz2_) {
zlib_ = true;
}
}
}

if (options_.retrieve("copyright") != nullptr) {
fmt::print("{}", copyright("2009-2021"));
Expand Down
14 changes: 11 additions & 3 deletions packages/seacas/applications/conjoin/CJ_SystemInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ namespace Excn {
SystemInterface();
bool parse_options(int argc, char **argv);

int debug() const { return debugLevel_; }
int screen_width() const { return screenWidth_; }
int debug() const { return debugLevel_; }
int screen_width() const { return screenWidth_; }

int quantize_nsd() const { return quantizeNSD_; }
int compress_data() const { return compressionLevel_; }
bool zlib() const { return zlib_; }
bool szip() const { return szip_; }
bool zstd() const { return zstd_; }
bool bz2() const { return bz2_; }
bool quantize() const { return quantizeNSD_ > 0; }

bool omit_nodesets() const { return omitNodesets_; }
bool omit_sidesets() const { return omitSidesets_; }
Expand Down Expand Up @@ -60,8 +65,11 @@ namespace Excn {
int debugLevel_{0};
int screenWidth_{0};
int compressionLevel_{0};
bool zlib_{true};
int quantizeNSD_{0};
bool zlib_{false};
bool szip_{false};
bool zstd_{false};
bool bz2_{false};
bool omitNodesets_{false};
bool omitSidesets_{false};
bool ints64Bit_{false};
Expand Down
7 changes: 5 additions & 2 deletions packages/seacas/applications/conjoin/Conjoin.C
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,9 @@ namespace {

global->elementCount = goffset;
global_element_map.resize(goffset);
if (goffset == 0) {
return;
}

size_t max_id = global_element_map[global->elementCount - 1].first;
bool is_contiguous = max_id == global_element_map.size();
Expand Down Expand Up @@ -2203,7 +2206,7 @@ namespace {
for (size_t ns = 0; ns < set_ids.size(); ns++) {

std::vector<INT> glob_ns_nodes(total_node_count + 1);
std::fill(glob_ns_nodes.begin(), glob_ns_nodes.end(), 0);
std::fill(glob_ns_nodes.begin(), glob_ns_nodes.end(), (INT)0);

size_t lns = glob_sets[ns].position_;
for (size_t p = 0; p < part_count; p++) {
Expand Down Expand Up @@ -2548,7 +2551,7 @@ namespace {

for (size_t b = 0; b < global.count(Excn::ObjectType::EBLK); b++) {
status.resize(glob_blocks[b].entity_count());
std::fill(status.begin(), status.end(), (1.0 - alive));
std::fill(status.begin(), status.end(), T(1.0 - alive));
size_t boffset = blocks[b].offset_;
size_t goffset = glob_blocks[b].offset_;
size_t element_count = blocks[b].entity_count();
Expand Down
24 changes: 0 additions & 24 deletions packages/seacas/applications/cpup/CP_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,6 @@ void Cpup::SystemInterface::enroll_options()
"large subcycle runs.",
nullptr);

options_.enroll(
"zlib", GetLongOption::NoValue,
"Use the Zlib / libz compression method if compression is enabled (default) [exodus only].",
nullptr);

options_.enroll("szip", GetLongOption::NoValue,
"Use SZip compression. [exodus only, enables netcdf-4]", nullptr);

options_.enroll("compress_data", GetLongOption::MandatoryValue,
"The output database will be written using compression (netcdf-4 mode only).\n"
"\t\tValue ranges from 0..9 for zlib/gzip or even values 4..32 for szip.",
nullptr, nullptr, true);

options_.enroll("append", GetLongOption::NoValue,
"Append to database instead of opening a new database.\n"
"\t\tTimestep transfer will start after last timestep on database",
Expand Down Expand Up @@ -301,18 +288,7 @@ bool Cpup::SystemInterface::parse_options(int argc, char **argv)

append_ = options_.retrieve("append") != nullptr;

if (options_.retrieve("szip") != nullptr) {
szip_ = true;
zlib_ = false;
}
zlib_ = (options_.retrieve("zlib") != nullptr);

if (szip_ && zlib_) {
fmt::print(stderr, "ERROR: Only one of 'szip' or 'zlib' can be specified.\n");
}

append_ = options_.retrieve("append") != nullptr;
compressData_ = options_.get_option_value("compress_data", compressData_);
//subcycle_ = options_.get_option_value("subcycle", subcycle_);
cycle_ = options_.get_option_value("cycle", cycle_);
subcycleJoin_ = options_.retrieve("join_subcycles") != nullptr;
Expand Down
6 changes: 0 additions & 6 deletions packages/seacas/applications/cpup/CP_SystemInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ namespace Cpup {
bool map_element_ids() const { return mapIds_; }
bool omit_nodesets() const { return omitNodesets_; }
bool omit_sidesets() const { return omitSidesets_; }
int compress_data() const { return compressData_; }
bool zlib() const { return zlib_; }
bool szip() const { return szip_; }
bool subcycle_join() const { return subcycleJoin_; }
bool keep_temporary() const { return keepTemporary_; }
bool verify_valid_file() const { return verifyValidFile_; }
Expand Down Expand Up @@ -132,10 +129,7 @@ namespace Cpup {
int partCount_{-1};
int subcycle_{-1};
int cycle_{-1};
int compressData_{0};
int maxOpenFiles_{0};
bool zlib_{true};
bool szip_{false};
bool sumSharedNodes_{false};
bool addProcessorIdField_{false};
bool addProcessorIdMap_{false};
Expand Down
Loading

0 comments on commit 0a5f02f

Please sign in to comment.