diff --git a/TPL/hdf5/runcmake.sh b/TPL/hdf5/runcmake.sh index 048a19cff3..55589f8c1f 100644 --- a/TPL/hdf5/runcmake.sh +++ b/TPL/hdf5/runcmake.sh @@ -61,6 +61,7 @@ cmake .. -DCMAKE_C_COMPILER:FILEPATH=${CC} \ -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DDEFAULT_API_VERSION=V18 \ + -DH5_DEFAULT_PLUGINDIR:PATH=${INSTALL_PATH}/lib/hdf5/lib/plugin \ -DHDF5_ENABLE_PARALLEL:BOOL=${MPI} \ -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON \ -DHDF5_BUILD_CPP_LIB:BOOL=${H5CPP} \ diff --git a/TPL/netcdf/runcmake.sh b/TPL/netcdf/runcmake.sh index 22a89b18c1..1f8e85bcc9 100755 --- a/TPL/netcdf/runcmake.sh +++ b/TPL/netcdf/runcmake.sh @@ -15,6 +15,8 @@ else BUILD_TYPE="RELEASE" fi +PREFIX="NETCDF_" + SHARED="${SHARED:-YES}" if [[ "$SHARED" == "ON" || "$SHARED" == "YES" ]] then @@ -31,9 +33,10 @@ fi if [[ "$HDF5" == "ON" || "$HDF5" == "YES" ]] then - HDF5_INFO="-DHDF5_ROOT:PATH=${INSTALL_PATH} -DHDF5_DIR:PATH=${INSTALL_PATH} -DENABLE_NETCDF4:BOOL=ON" + export HDF5_PLUGIN_PATH=${INSTALL_PATH}/lib/hdf5/lib/plugin + HDF5_INFO="-DHDF5_ROOT:PATH=${INSTALL_PATH} -DHDF5_DIR:PATH=${INSTALL_PATH} -D${PREFIX}ENABLE_NETCDF4:BOOL=ON -D${PREFIX}PLUGIN_INSTALL_DIR=YES" else - HDF5_INFO="-DENABLE_HDF5=OFF -DENABLE_NETCDF4:BOOL=OFF" + HDF5_INFO="-DENABLE_HDF5=OFF -D${PREFIX}ENABLE_NETCDF4:BOOL=OFF" fi NEEDS_ZLIB="${NEEDS_ZLIB:-NO}" @@ -46,10 +49,13 @@ NEEDS_SZIP="${NEEDS_SZIP:-NO}" if [ "$NEEDS_SZIP" == "YES" ] then LOCAL_SZIP="-DSZIP_INCLUDE_DIR:PATH=${INSTALL_PATH}/include -DSZIP_LIBRARY:FILEPATH=${INSTALL_PATH}/lib/libsz.${LD_EXT}" +else + LOCAL_SZIP="-D${PREFIX}ENABLE_FILTER_SZIP=NO" fi . ${ACCESS}/TPL/compiler.sh + # If using an XLF compiler on an IBM system, may need to add the following: # -DCMAKE_Fortran_FLAGS="-qfixed=72" \ # -DCMAKE_EXE_LINKER_FLAGS:STRING="-lxl -lxlopt" @@ -62,20 +68,24 @@ cmake .. -DCMAKE_C_COMPILER:FILEPATH=${CC} \ -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \ -DCMAKE_INSTALL_LIBDIR:PATH=lib \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_PNETCDF:BOOL=${MPI} \ - -DENABLE_CDF5=ON \ - -DENABLE_MMAP:BOOL=ON \ - -DENABLE_DAP:BOOL=OFF \ - -DENABLE_BYTERANGE:BOOL=OFF \ - -DENABLE_NCZARR:BOOL=OFF \ - -DENABLE_V2_API:BOOL=OFF \ - -DENABLE_FILTER_TESTING:BOOL=OFF \ - -DENABLE_TESTS:BOOL=OFF \ + -DCMAKE_PREFIX_PATH=${INSTALL_PATH} \ + -D${PREFIX}ENABLE_PNETCDF:BOOL=${MPI} \ + -D${PREFIX}ENABLE_CDF5=ON \ + -D${PREFIX}ENABLE_MMAP:BOOL=ON \ + -D${PREFIX}ENABLE_DAP:BOOL=OFF \ + -D${PREFIX}ENABLE_BYTERANGE:BOOL=OFF \ + -D${PREFIX}ENABLE_NCZARR_FILTERS:BOOL=OFF \ + -D${PREFIX}ENABLE_NCZARR:BOOL=OFF \ + -D${PREFIX}ENABLE_V2_API:BOOL=OFF \ + -D${PREFIX}ENABLE_FILTER_TESTING:BOOL=OFF \ + -DENABLE_PLUGIN_INSTALL:BOOL=ON \ + -D${PREFIX}ENABLE_TESTS:BOOL=OFF \ + -D${PREFIX}ENABLE_QUANTIZE:BOOL=ON \ ${LOCAL_ZLIB} \ ${LOCAL_SZIP} \ ${EXTRA_DEPS} \ ${HDF5_INFO} \ - -DENABLE_CONVERSION_WARNINGS:BOOL=OFF + -D${PREFIX}ENABLE_CONVERSION_WARNINGS:BOOL=OFF echo "" echo " MPI: ${MPI}" diff --git a/install-tpl.sh b/install-tpl.sh index efa345b348..00206a27b7 100755 --- a/install-tpl.sh +++ b/install-tpl.sh @@ -425,7 +425,7 @@ then elif [ "${H5VERSION}" == "develop" ]; then hdf_version="develop" else - echo 1>&2 ${txtred}Invalid HDF5 version specified: ${H5VERSION}. Must be one of V110, V112, or V114. exiting.${txtrst} + echo 1>&2 ${txtred}Invalid HDF5 version specified: ${H5VERSION}. Must be one of V110, V112, or V114 [default]. exiting.${txtrst} exit 1 fi @@ -539,7 +539,7 @@ then # net_version="v4.9.1" net_version="v4.9.2" # net_version="v4.8.1" -# net_version="master" +# net_version="main" echo "${txtgrn}+++ NetCDF ${net_version} ${txtrst}" cd $ACCESS || exit @@ -551,6 +551,11 @@ then git clone --depth 1 --branch ${net_version} https://github.com/Unidata/netcdf-c netcdf-c fi + if [ net_version == "main" ] + then + PREFIX="NETCDF_" + fi + if [ "$BUILD" == "YES" ] then echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}" @@ -562,7 +567,7 @@ then then export HDF5_PLUGIN_PATH=${INSTALL_PATH}/lib/hdf5/lib/plugin fi - CRAY=${CRAY} SHARED=${SHARED} DEBUG=${DEBUG} HDF5=${HDF5} NEEDS_ZLIB=${NEEDS_ZLIB} MPI=${MPI} bash -x ../../runcmake.sh + PREFIX=${PREFIX} CRAY=${CRAY} SHARED=${SHARED} DEBUG=${DEBUG} HDF5=${HDF5} NEEDS_ZLIB=${NEEDS_ZLIB} MPI=${MPI} bash -x ../../runcmake.sh if [[ $? != 0 ]] then echo 1>&2 ${txtred}couldn\'t configure cmake for NetCDF. exiting.${txtrst} diff --git a/packages/seacas/applications/conjoin/CJ_ExodusFile.C b/packages/seacas/applications/conjoin/CJ_ExodusFile.C index 618f980e20..e7f79e1bde 100644 --- a/packages/seacas/applications/conjoin/CJ_ExodusFile.C +++ b/packages/seacas/applications/conjoin/CJ_ExodusFile.C @@ -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. // @@ -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_); diff --git a/packages/seacas/applications/conjoin/CJ_SystemInterface.C b/packages/seacas/applications/conjoin/CJ_SystemInterface.C index 6954ab0937..f74f50f2e7 100644 --- a/packages/seacas/applications/conjoin/CJ_SystemInterface.C +++ b/packages/seacas/applications/conjoin/CJ_SystemInterface.C @@ -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" @@ -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")); diff --git a/packages/seacas/applications/conjoin/CJ_SystemInterface.h b/packages/seacas/applications/conjoin/CJ_SystemInterface.h index 56d1a01d2e..2df7577ac3 100644 --- a/packages/seacas/applications/conjoin/CJ_SystemInterface.h +++ b/packages/seacas/applications/conjoin/CJ_SystemInterface.h @@ -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_; } @@ -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}; diff --git a/packages/seacas/applications/cpup/CP_SystemInterface.C b/packages/seacas/applications/cpup/CP_SystemInterface.C index 38007c582c..1c3d10c4d9 100644 --- a/packages/seacas/applications/cpup/CP_SystemInterface.C +++ b/packages/seacas/applications/cpup/CP_SystemInterface.C @@ -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", @@ -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; diff --git a/packages/seacas/applications/cpup/CP_SystemInterface.h b/packages/seacas/applications/cpup/CP_SystemInterface.h index a7295f1e62..4caf2f9d69 100644 --- a/packages/seacas/applications/cpup/CP_SystemInterface.h +++ b/packages/seacas/applications/cpup/CP_SystemInterface.h @@ -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_; } @@ -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}; diff --git a/packages/seacas/applications/ejoin/EJ_SystemInterface.C b/packages/seacas/applications/ejoin/EJ_SystemInterface.C index 0c90c12276..b57157fd50 100644 --- a/packages/seacas/applications/ejoin/EJ_SystemInterface.C +++ b/packages/seacas/applications/ejoin/EJ_SystemInterface.C @@ -196,18 +196,27 @@ void 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); + 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("disable_field_recognition", GetLongOption::NoValue, "Do not try to combine scalar fields into higher-order fields such as\n" @@ -417,17 +426,61 @@ bool SystemInterface::parse_options(int argc, char **argv) ints64bit_ = true; } - 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_) { - fmt::print(stderr, "ERROR: Only one of 'szip' or 'zlib' can be specified.\n"); + if (szip_ + zlib_ + zstd_ + bz2_ > 1) { + fmt::print(stderr, + "ERROR: Only one of 'szip' or 'zlib' or 'zstd' or 'bzip2' can be specified.\n"); } - compressionLevel_ = options_.get_option_value("compress", compressionLevel_); + { + const char *temp = options_.retrieve("compress"); + if (temp != nullptr) { + compressionLevel_ = std::strtol(temp, nullptr, 10); + if (!szip_ && !zlib_ && !zstd_ && !bz2_) { + zlib_ = true; + } + + 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; + } + } + } + } + + { + 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("match_node_ids") != nullptr) { matchNodeIds_ = true; diff --git a/packages/seacas/applications/ejoin/EJ_SystemInterface.h b/packages/seacas/applications/ejoin/EJ_SystemInterface.h index 43985e833a..76fcd97eab 100644 --- a/packages/seacas/applications/ejoin/EJ_SystemInterface.h +++ b/packages/seacas/applications/ejoin/EJ_SystemInterface.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-, 20232023, National Technology & Engineering Solutions +// Copyright(C) 1999-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. // @@ -36,12 +36,17 @@ class SystemInterface bool use_netcdf4() const { return useNetcdf4_; } bool ignore_element_ids() const { return ignoreElementIds_; } + int quantize_nsd() const { return quantizeNSD_; } + bool quantize() const { return quantizeNSD_ > 0; } int compression_level() const { return compressionLevel_; } bool zlib() const { return zlib_; } bool szip() const { return szip_; } - int step_min() const { return stepMin_; } - int step_max() const { return stepMax_; } - int step_interval() const { return stepInterval_; } + bool zstd() const { return zstd_; } + bool bz2() const { return bz2_; } + + int step_min() const { return stepMin_; } + int step_max() const { return stepMax_; } + int step_interval() const { return stepInterval_; } vector3d offset() const { return offset_; } const std::vector &information_record_parts() const { return infoRecordParts_; } @@ -88,6 +93,12 @@ class SystemInterface int stepMax_{INT_MAX}; int stepInterval_{1}; int compressionLevel_{0}; + int quantizeNSD_{0}; + bool zlib_{false}; + bool szip_{false}; + bool zstd_{false}; + bool bz2_{false}; + bool omitNodesets_{false}; bool omitSidesets_{false}; bool omitAssemblies_{false}; @@ -98,8 +109,7 @@ class SystemInterface bool ints64bit_{false}; bool useNetcdf4_{false}; bool ignoreElementIds_{false}; - bool zlib_{true}; - bool szip_{false}; + bool createAssemblies_{true}; std::string blockPrefix_{"p"}; diff --git a/packages/seacas/applications/ejoin/EJoin.C b/packages/seacas/applications/ejoin/EJoin.C index 6f6c2f4565..8beb65e965 100644 --- a/packages/seacas/applications/ejoin/EJoin.C +++ b/packages/seacas/applications/ejoin/EJoin.C @@ -142,6 +142,25 @@ namespace { void transfer_field_data_internal(Ioss::GroupingEntity *ige, Ioss::GroupingEntity *oge, const std::string &field_name); + + // Used when combining two or more input set into a single output set (WIP) + // May reequire other operations to completly combine the entities... + // This only handles the entity count. + void add_to_entity_count(Ioss::GroupingEntity *ge, int64_t entity_count_increment) + { + auto ec_property = ge->get_property("entity_count"); + auto old_count = ec_property.get_int(); + + auto origin = ec_property.get_origin(); + ge->property_erase("entity_count"); + ge->property_add(Ioss::Property("entity_count", entity_count_increment + old_count, origin)); + + auto field_names = ge->field_describe(); + for (const auto &field_name : field_names) { + const auto &field_ref = ge->get_fieldref(field_name); + const_cast(field_ref).reset_count(entity_count_increment + old_count); + } + } } // namespace template @@ -290,15 +309,27 @@ double ejoin(SystemInterface &interFace, std::vector &part_mesh, properties.add(Ioss::Property("FILE_TYPE", "netcdf4")); } - if (interFace.compression_level() > 0 || interFace.szip()) { + if (interFace.compression_level() > 0 || interFace.szip() || interFace.quantize() || + interFace.zlib() || interFace.zstd() || interFace.bz2()) { properties.add(Ioss::Property("FILE_TYPE", "netcdf4")); properties.add(Ioss::Property("COMPRESSION_LEVEL", interFace.compression_level())); - properties.add(Ioss::Property("COMPRESSION_SHUFFLE", true)); - if (interFace.szip()) { + properties.add(Ioss::Property("COMPRESSION_SHUFFLE", 1)); + + if (interFace.zlib()) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "zlib")); + } + else if (interFace.szip()) { properties.add(Ioss::Property("COMPRESSION_METHOD", "szip")); } - else if (interFace.zlib()) { - properties.add(Ioss::Property("COMPRESSION_METHOD", "zlib")); + else if (interFace.zstd()) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "zstd")); + } + else if (interFace.bz2()) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "bzip2")); + } + + if (interFace.quantize()) { + properties.add(Ioss::Property("COMPRESSION_QUANTIZE_NSD", interFace.quantize_nsd())); } } @@ -810,17 +841,27 @@ namespace { void transfer_nodesets(Ioss::Region ®ion, Ioss::Region &output_region, bool debug) { - const std::string &prefix = region.name(); + bool combine_similar = true; + const std::string &prefix = region.name(); const Ioss::NodeSetContainer &nss = region.get_nodesets(); for (const auto &ns : nss) { if (!entity_is_omitted(ns)) { std::string name = ns->name(); - if (output_region.get_nodeset(name) != nullptr) { - name = prefix + "_" + ns->name(); - if (output_region.get_nodeset(name) != nullptr) { - fmt::print(stderr, "ERROR: Duplicate node sets named '{}'\n", name); - exit(EXIT_FAILURE); + auto *ons = output_region.get_nodeset(name); + if (ons != nullptr) { + if (combine_similar) { + // Combine nodesets with similar names... + size_t count = ns->entity_count(); + add_to_entity_count(ons, count); + continue; + } + else { + name = prefix + "_" + ns->name(); + if (output_region.get_nodeset(name) != nullptr) { + fmt::print(stderr, "ERROR: Duplicate node sets named '{}'\n", name); + exit(EXIT_FAILURE); + } } } ns->property_add(Ioss::Property("name_in_output", name)); diff --git a/packages/seacas/applications/epu/EP_ExodusFile.C b/packages/seacas/applications/epu/EP_ExodusFile.C index 5cf8f3e742..3ff4c57007 100644 --- a/packages/seacas/applications/epu/EP_ExodusFile.C +++ b/packages/seacas/applications/epu/EP_ExodusFile.C @@ -360,8 +360,18 @@ bool Excn::ExodusFile::create_output(const SystemInterface &si, int cycle) 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); + } ex_set_option(outputId_, EX_OPT_COMPRESSION_LEVEL, si.compress_data()); ex_set_option(outputId_, EX_OPT_COMPRESSION_SHUFFLE, 1); + + if (si.quantize()) { + ex_set_option(outputId_, EX_OPT_QUANTIZE_NSD, si.quantize_nsd()); + } } // EPU Can add a name of "processor_id_epu" which is 16 characters long. diff --git a/packages/seacas/applications/epu/EP_SystemInterface.C b/packages/seacas/applications/epu/EP_SystemInterface.C index ca97eb217f..aafd4c1f3e 100644 --- a/packages/seacas/applications/epu/EP_SystemInterface.C +++ b/packages/seacas/applications/epu/EP_SystemInterface.C @@ -162,9 +162,20 @@ void Excn::SystemInterface::enroll_options() 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.", + 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("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("append", GetLongOption::NoValue, @@ -383,17 +394,61 @@ bool Excn::SystemInterface::parse_options(int argc, char **argv) append_ = options_.retrieve("append") != nullptr; intIs64Bit_ = options_.retrieve("64") != 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_) { - fmt::print(stderr, "ERROR: Only one of 'szip' or 'zlib' can be specified.\n"); + if ((szip_ ? 1 : 0) + (zlib_ ? 1 : 0) + (zstd_ ? 1 : 0) + (bz2_ ? 1 : 0) > 1) { + fmt::print(stderr, + "ERROR: Only one of 'szip' or 'zlib' or 'zstd' or 'bzip2' can be specified.\n"); } - compressData_ = options_.get_option_value("compress_data", compressData_); + { + const char *temp = options_.retrieve("compress"); + if (temp != nullptr) { + compressionLevel_ = std::strtol(temp, nullptr, 10); + if (!szip_ && !zlib_ && !zstd_ && !bz2_) { + zlib_ = true; + } + + 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 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; + } + } + } + } + + { + const char *temp = options_.retrieve("quantize_nsd"); + if (temp != nullptr) { + quantizeNSD_ = std::strtol(temp, nullptr, 10); + if (!szip_ && !zlib_ && !zstd_ && !bz2_) { + zlib_ = true; + } + } + } sumSharedNodes_ = options_.retrieve("sum_shared_nodes") != nullptr; append_ = options_.retrieve("append") != nullptr; diff --git a/packages/seacas/applications/epu/EP_SystemInterface.h b/packages/seacas/applications/epu/EP_SystemInterface.h index f5b4c4159e..42edd95120 100644 --- a/packages/seacas/applications/epu/EP_SystemInterface.h +++ b/packages/seacas/applications/epu/EP_SystemInterface.h @@ -70,9 +70,13 @@ namespace Excn { bool omit_faceblocks() const { return omitFaceBlocks_; } bool int64() const { return intIs64Bit_; } void set_int64() const { intIs64Bit_ = true; } - int compress_data() const { return compressData_; } + 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_; } + int quantize_nsd() const { return quantizeNSD_; } + bool quantize() const { return quantizeNSD_ > 0; } bool subcycle_join() const { return subcycleJoin_; } bool output_shared_nodes() const { return outputSharedNodes_; } bool is_auto() const { return auto_; } @@ -137,10 +141,13 @@ namespace Excn { int stepInterval_{1}; int subcycle_{-1}; int cycle_{-1}; - int compressData_{0}; + int compressionLevel_{0}; + int quantizeNSD_{0}; int maxOpenFiles_{0}; - bool zlib_{true}; + bool zlib_{false}; bool szip_{false}; + bool zstd_{false}; + bool bz2_{false}; bool sumSharedNodes_{false}; bool addProcessorIdField_{false}; bool addProcessorIdMap_{false}; diff --git a/packages/seacas/applications/slice/SL_SystemInterface.C b/packages/seacas/applications/slice/SL_SystemInterface.C index b8c0859a1a..6d5372f6f1 100644 --- a/packages/seacas/applications/slice/SL_SystemInterface.C +++ b/packages/seacas/applications/slice/SL_SystemInterface.C @@ -157,20 +157,30 @@ void SystemInterface::enroll_options() options_.enroll("64-bit", GetLongOption::NoValue, "Use 64-bit integers on output database", nullptr, nullptr, true); - options_.enroll("shuffle", GetLongOption::NoValue, - "Use a netcdf4 hdf5-based file and use hdf5s shuffle mode with compression.", + options_.enroll("zlib", GetLongOption::NoValue, + "Use the Zlib / libz compression method if compression is enabled (default) " + "[exodus only, enables netcdf-4].", 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("zstd", GetLongOption::NoValue, + "Use Zstd compression. [exodus only, enables netcdf-4, experimental]", nullptr); + options_.enroll("bz2", GetLongOption::NoValue, + "Use Bzip2 compression. [exodus only, enables netcdf-4, experimental]", nullptr); + + options_.enroll("shuffle", GetLongOption::NoValue, + "Use a netcdf4 hdf5-based file and use hdf5s shuffle mode with compression.", + nullptr); options_.enroll("compress", GetLongOption::MandatoryValue, - "Specify the hdf5 compression level [0..9] to be used on the output file.", + "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("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("debug", GetLongOption::MandatoryValue, @@ -328,18 +338,62 @@ bool SystemInterface::parse_options(int argc, char **argv) } shuffle_ = (options_.retrieve("shuffle") != nullptr); + zlib_ = (options_.retrieve("zlib") != nullptr); + szip_ = (options_.retrieve("szip") != nullptr); + zstd_ = (options_.retrieve("zstd") != nullptr); + bz2_ = (options_.retrieve("bzip2") != nullptr); + + if ((szip_ ? 1 : 0) + (zlib_ ? 1 : 0) + (zstd_ ? 1 : 0) + (bz2_ ? 1 : 0) > 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 (options_.retrieve("szip") != nullptr) { - szip_ = true; - zlib_ = false; + 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 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; + } + } + } } - zlib_ = (options_.retrieve("zlib") != nullptr); - if (szip_ && zlib_) { - fmt::print(stderr, "ERROR: Only one of 'szip' or 'zlib' can be specified.\n"); + { + const char *temp = options_.retrieve("quantize_nsd"); + if (temp != nullptr) { + quantizeNSD_ = std::strtol(temp, nullptr, 10); + if (!szip_ && !zlib_ && !zstd_ && !bz2_) { + zlib_ = true; + } + } } - compressionLevel_ = options_.get_option_value("compress", compressionLevel_); contig_ = options_.retrieve("contiguous_decomposition") != nullptr; outputDecompMap_ = options_.retrieve("output_decomp_map") != nullptr; outputDecompField_ = options_.retrieve("output_decomp_field") != nullptr; diff --git a/packages/seacas/applications/slice/SL_SystemInterface.h b/packages/seacas/applications/slice/SL_SystemInterface.h index c0f5aef74a..d959613156 100644 --- a/packages/seacas/applications/slice/SL_SystemInterface.h +++ b/packages/seacas/applications/slice/SL_SystemInterface.h @@ -90,13 +90,16 @@ class SystemInterface public: int compressionLevel_{0}; + int quantizeNSD_{0}; bool shuffle_{false}; bool ints64Bit_{false}; bool netcdf4_{false}; bool netcdf5_{false}; bool disableFieldRecognition_{false}; + bool zlib_{false}; bool szip_{false}; - bool zlib_{true}; + bool zstd_{false}; + bool bz2_{false}; bool outputDecompMap_{false}; bool outputDecompField_{false}; bool ignore_x_{false}; diff --git a/packages/seacas/applications/slice/Slice.C b/packages/seacas/applications/slice/Slice.C index e8a0521584..d43a141ced 100644 --- a/packages/seacas/applications/slice/Slice.C +++ b/packages/seacas/applications/slice/Slice.C @@ -89,15 +89,27 @@ namespace { properties.add(Ioss::Property("FILE_TYPE", "netcdf5")); } - if (interFace.compressionLevel_ > 0 || interFace.shuffle_ || interFace.szip_) { + if (interFace.compressionLevel_ > 0 || interFace.shuffle_ || interFace.szip_ || + interFace.zlib_ || interFace.zstd_) { properties.add(Ioss::Property("FILE_TYPE", "netcdf4")); properties.add(Ioss::Property("COMPRESSION_LEVEL", interFace.compressionLevel_)); properties.add(Ioss::Property("COMPRESSION_SHUFFLE", static_cast(interFace.shuffle_))); - if (interFace.szip_) { + + if (interFace.zlib_) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "zlib")); + } + else if (interFace.szip_) { properties.add(Ioss::Property("COMPRESSION_METHOD", "szip")); } - else if (interFace.zlib_) { - properties.add(Ioss::Property("COMPRESSION_METHOD", "zlib")); + else if (interFace.zstd_) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "zstd")); + } + else if (interFace.bz2_) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "bzip2")); + } + + if (interFace.quantizeNSD_ > 0) { + properties.add(Ioss::Property("COMPRESSION_QUANTIZE_NSD", interFace.quantizeNSD_)); } } diff --git a/packages/seacas/libraries/exodus/include/exodusII.h b/packages/seacas/libraries/exodus/include/exodusII.h index 7ade1e223f..7b07abe548 100644 --- a/packages/seacas/libraries/exodus/include/exodusII.h +++ b/packages/seacas/libraries/exodus/include/exodusII.h @@ -243,9 +243,11 @@ NetCDF-4.?.? and later enum ex_option_type { EX_OPT_MAX_NAME_LENGTH = 1, /**< Maximum length of names that will be returned/passed via api call. */ - EX_OPT_COMPRESSION_TYPE, /**< Not currently used; default is gzip */ - EX_OPT_COMPRESSION_LEVEL, /**< In the range [0..9]. A value of 0 indicates no compression */ + EX_OPT_COMPRESSION_TYPE, /**< Default is gzip */ + EX_OPT_COMPRESSION_LEVEL, /**< Range depends on compression type. */ EX_OPT_COMPRESSION_SHUFFLE, /**< 1 if enabled, 0 if disabled */ + EX_OPT_QUANTIZE_NSD, /**< if > 0, Number of significant digits to retain in lossy quantize + compression */ EX_OPT_INTEGER_SIZE_API, /**< 4 or 8 indicating byte size of integers used in api functions. */ EX_OPT_INTEGER_SIZE_DB, /**< Query only, returns 4 or 8 indicating byte size of integers stored on the database. */ @@ -256,6 +258,8 @@ enum ex_compression_type { EX_COMPRESS_ZLIB = 1, /**< Use ZLIB-based compression (if available) */ EX_COMPRESS_GZIP = 1, /**< Same as ZLIB, but typical alias used */ EX_COMPRESS_SZIP, /**< Use SZIP-based compression (if available) */ + EX_COMPRESS_ZSTD, /**< Use ZStandard compression (if available) */ + EX_COMPRESS_BZ2, /**< Use BZ2 / Bzip2 compression (if available) */ }; typedef enum ex_compression_type ex_compression_type; /** @}*/ diff --git a/packages/seacas/libraries/exodus/include/exodusII_int.h b/packages/seacas/libraries/exodus/include/exodusII_int.h index e8bb5aca4e..138e0af85e 100644 --- a/packages/seacas/libraries/exodus/include/exodusII_int.h +++ b/packages/seacas/libraries/exodus/include/exodusII_int.h @@ -26,6 +26,18 @@ #include "netcdf_meta.h" #endif +#if NC_HAS_ZSTD == 1 +#include "netcdf_filter.h" +#endif + +#if !defined NC_FillValue +#if defined _FillValue +#define NC_FillValue _FillValue +#else +#define NC_FillValue "_FillValue" +#endif +#endif + #if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1900 #define PRId64 "I64d" #else @@ -685,19 +697,22 @@ typedef enum exi_element_type exi_element_type; struct exi_file_item { - int file_id; - nc_type netcdf_type_code; /**< NC_FLOAT or NC_DOUBLE */ - int int64_status; - int maximum_name_length; - int time_varid; /* Store to avoid lookup each timestep */ + int file_id; + nc_type netcdf_type_code; + int int64_status; + int maximum_name_length; + int time_varid; /* Store to avoid lookup each timestep */ + int compression_level; /**< 0 (disabled) to 9 (maximum) compression level for + gzip, 4..32 and even for szip; -131072..22 for zstd, NetCDF-4 only */ unsigned int assembly_count; unsigned int blob_count; - unsigned int compression_level; /**< 0 (disabled) to 9 (maximum) compression level for - gzip, 4..32 and even for szip; NetCDF-4 only */ + unsigned int persist_define_mode : 10; /**< Stay in define mode until exi_persist_leavedef is called. Set by exi_persist_redef... */ unsigned int compression_algorithm : 4; /**< GZIP/ZLIB, SZIP, more may be supported by NetCDF soon */ + unsigned int quantize_nsd : 4; /**< 0 (disabled) to 15 (maximum) number of significant digits + retained for lossy quanitzation compression */ unsigned int shuffle : 1; /**< 1 true, 0 false */ unsigned int user_compute_wordsize : 1; /**< 0 for 4 byte or 1 for 8 byte reals */ unsigned int diff --git a/packages/seacas/libraries/exodus/src/ex_conv.c b/packages/seacas/libraries/exodus/src/ex_conv.c index f053f185d3..64ab09cdcd 100644 --- a/packages/seacas/libraries/exodus/src/ex_conv.c +++ b/packages/seacas/libraries/exodus/src/ex_conv.c @@ -240,6 +240,7 @@ int exi_conv_init(int exoid, int *comp_wordsize, int *io_wordsize, int file_word new_file->assembly_count = 0; new_file->blob_count = 0; new_file->compression_level = 0; + new_file->quantize_nsd = 0; new_file->shuffle = 0; new_file->file_type = filetype - 1; new_file->is_parallel = is_parallel; @@ -443,19 +444,76 @@ int ex_set_option(int exoid, ex_option_type option, int option_value) char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: invalid value %d for SZIP Compression. Must be even and 4 <= value <= " - "32. Ignoring.", + "32. Setting value to 4.", value); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); - EX_FUNC_LEAVE(EX_FATAL); + value = 4; } } + else if (file->compression_algorithm == EX_COMPRESS_ZSTD) { +#if NC_HAS_ZSTD == 1 + if (value < -131072 || value > 22) { + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: invalid value %d for ZSTD Compression. Must be between -131072 and 22. " + "Setting value to 4", + value); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); + value = 4; + } +#else + char errmsg[MAX_ERR_LENGTH]; + snprintf( + errmsg, MAX_ERR_LENGTH, + "ERROR: Zstandard compression is not supported in this version of netCDF library."); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); +#endif + } + else if (file->compression_algorithm == EX_COMPRESS_BZ2) { +#if NC_HAS_BZ2 == 1 + if (value < 0 || value > 9) { + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: invalid value %d for BZIP2 Compression. Must be between 0 and 9 " + "inclusive. Setting value to 1.", + value); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); + value = 1; + } +#else + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: Bzip2 compression is not supported in this version of netCDF library."); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); +#endif + } file->compression_level = value; - assert(value == file->compression_level); } else { file->compression_level = 0; } break; + case EX_OPT_QUANTIZE_NSD: +#if NC_HAS_QUANTIZE == 1 + if (option_value > 15) { + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: invalid value %d for Quantize NSD. Must be less than or equal to 15. " + "Setting value to 15.", + option_value); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); + option_value = 15; + } + file->quantize_nsd = option_value; +#else + { + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: Quanitzation is not supported in this version of netCDF library."); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); + } +#endif + break; case EX_OPT_COMPRESSION_SHUFFLE: /* 0 (disabled); 1 (enabled) */ file->shuffle = option_value != 0 ? 1 : 0; break; diff --git a/packages/seacas/libraries/exodus/src/ex_err.c b/packages/seacas/libraries/exodus/src/ex_err.c index 99f2429b1f..4fb4b08321 100644 --- a/packages/seacas/libraries/exodus/src/ex_err.c +++ b/packages/seacas/libraries/exodus/src/ex_err.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions + * Copyright(C) 1999-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. * @@ -225,6 +225,7 @@ void ex_err_fn(int exoid, const char *module_name, const char *message, int err_ fprintf(stderr, " exerrval = %d\n", EX_ERR_NUM); fprintf(stderr, "\t%s\n", ex_strerror(EX_ERR_NUM)); + fflush(stderr); EX_FUNC_VOID(); } @@ -239,6 +240,7 @@ void ex_err_fn(int exoid, const char *module_name, const char *message, int err_ if (err_num == EX_NULLENTITY) { if (exoptval & EX_NULLVERBOSE) { fprintf(stderr, "\nExodus Library Warning: [%s]\n\t%s\n", module_name, message); + fflush(stderr); } } @@ -262,8 +264,8 @@ void ex_err_fn(int exoid, const char *module_name, const char *message, int err_ fprintf(stderr, "\nExodus Library Warning/Error: [%s]\n\t%s\n", module_name, message); } fprintf(stderr, "\t%s\n", ex_strerror(err_num)); + fflush(stderr); } - fflush(stderr); /* with netCDF 3.4, (fatal) system error codes are > 0; so all EXODUS fatal error codes are > 0 */ diff --git a/packages/seacas/libraries/exodus/src/ex_put_prop.c b/packages/seacas/libraries/exodus/src/ex_put_prop.c index 9300d2fb30..9f6ed4b779 100644 --- a/packages/seacas/libraries/exodus/src/ex_put_prop.c +++ b/packages/seacas/libraries/exodus/src/ex_put_prop.c @@ -243,7 +243,8 @@ int ex_put_prop(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, const c vals[0] = 0; /* fill value */ /* create attribute to cause variable to fill with zeros per routine spec */ - if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) { + if ((status = nc_put_att_longlong(exoid, propid, NC_FillValue, int_type, 1, vals)) != + NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to create property name fill attribute in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); diff --git a/packages/seacas/libraries/exodus/src/ex_put_prop_names.c b/packages/seacas/libraries/exodus/src/ex_put_prop_names.c index bcf063f050..5a8816e19e 100644 --- a/packages/seacas/libraries/exodus/src/ex_put_prop_names.c +++ b/packages/seacas/libraries/exodus/src/ex_put_prop_names.c @@ -172,7 +172,8 @@ int ex_put_prop_names(int exoid, ex_entity_type obj_type, int num_props, char ** /* create attribute to cause variable to fill with zeros per routine spec */ - if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) { + if ((status = nc_put_att_longlong(exoid, propid, NC_FillValue, int_type, 1, vals)) != + NC_NOERR) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: failed to create property name fill attribute in file id %d", exoid); ex_err_fn(exoid, __func__, errmsg, status); diff --git a/packages/seacas/libraries/exodus/src/ex_utils.c b/packages/seacas/libraries/exodus/src/ex_utils.c index 7513e665c5..634ef1e86e 100644 --- a/packages/seacas/libraries/exodus/src/ex_utils.c +++ b/packages/seacas/libraries/exodus/src/ex_utils.c @@ -110,6 +110,16 @@ const char *ex_config(void) #else j += snprintf(buffer + j, buffer_size - j, "\t\tSZip Compression (read/write) NOT enabled\n"); #endif +#if NC_HAS_ZSTD == 1 + j += snprintf(buffer + j, buffer_size - j, "\t\tZstd Compression enabled\n"); +#else + j += snprintf(buffer + j, buffer_size - j, "\t\tZstd Compression NOT enabled\n"); +#endif +#if NC_HAS_QUANTIZE == 1 + j += snprintf(buffer + j, buffer_size - j, "\t\tQuanization support enabled\n"); +#else + j += snprintf(buffer + j, buffer_size - j, "\t\tQuanization support NOT enabled\n"); +#endif #endif #endif #if defined(PARALLEL_AWARE_EXODUS) @@ -1718,6 +1728,7 @@ void exi_set_compact_storage(int exoid, int varid) \internal \undoc */ + void exi_compress_variable(int exoid, int varid, int type) { #if NC_HAS_HDF5 @@ -1731,13 +1742,14 @@ void exi_compress_variable(int exoid, int varid, int type) } else { /* Compression only supported on HDF5 (NetCDF-4) files; Do not try to compress character data */ + int status = NC_NOERR; if ((type == 1 || type == 2) && file->is_hdf5) { if (file->compression_algorithm == EX_COMPRESS_GZIP) { int deflate_level = file->compression_level; if (deflate_level > 0) { int compress = 1; int shuffle = file->shuffle; - nc_def_var_deflate(exoid, varid, shuffle, compress, deflate_level); + status = nc_def_var_deflate(exoid, varid, shuffle, compress, deflate_level); } } else if (file->compression_algorithm == EX_COMPRESS_SZIP) { @@ -1756,12 +1768,58 @@ void exi_compress_variable(int exoid, int varid, int type) /* Even and between 4 and 32; typical values are 8, 10, 16, 32 */ const int SZIP_PIXELS_PER_BLOCK = file->compression_level == 0 ? 32 : file->compression_level; - nc_def_var_szip(exoid, varid, NC_SZIP_NN, SZIP_PIXELS_PER_BLOCK); + status = nc_def_var_szip(exoid, varid, NC_SZIP_NN, SZIP_PIXELS_PER_BLOCK); #else char errmsg[MAX_ERR_LENGTH]; snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: Compression algorithm SZIP is not supported yet (EXPERIMENTAL)."); ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); +#endif + } + else if (file->compression_algorithm == EX_COMPRESS_ZSTD) { +#if NC_HAS_ZSTD == 1 + status = nc_def_var_zstandard(exoid, varid, file->compression_level); +#else + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: Compression algorithm ZSTANDARD is not supported in this version of the " + "netCDF library."); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); +#endif + } + else if (file->compression_algorithm == EX_COMPRESS_BZ2) { +#if NC_HAS_BZ2 == 1 + status = nc_def_var_bzip2(exoid, varid, file->compression_level); +#else + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: Compression algorithm BZIP2 / BZ2 is not supported in this version of the " + "netCDF library."); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); +#endif + } + if (status != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: failed to set compression attribute on variable in file id %d", exoid); + ex_err_fn(exoid, __func__, errmsg, status); + } + + if (type == 2 && file->quantize_nsd > 0) { +#if NC_HAS_QUANTIZE == 1 + // Lossy compression using netCDF quantize methods. + if ((status = nc_def_var_quantize(exoid, varid, NC_QUANTIZE_GRANULARBR, + file->quantize_nsd)) != NC_NOERR) { + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: failed to set quanitzation method on variable in file id %d", exoid); + ex_err_fn(exoid, __func__, errmsg, status); + } +#else + char errmsg[MAX_ERR_LENGTH]; + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: Quanitzation is not supported in this version of netCDF library."); + ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); #endif } } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Field.C b/packages/seacas/libraries/ioss/src/Ioss_Field.C index 0e0b33a8be..2eb5b797c2 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Field.C +++ b/packages/seacas/libraries/ioss/src/Ioss_Field.C @@ -10,6 +10,7 @@ #include "Ioss_VariableType.h" #include #include +#include #include #include #include diff --git a/packages/seacas/libraries/ioss/src/catalyst_tests/Iocatalyst_ConduitReadTest.C b/packages/seacas/libraries/ioss/src/catalyst_tests/Iocatalyst_ConduitReadTest.C index 48bc674704..e8a35adc6c 100644 --- a/packages/seacas/libraries/ioss/src/catalyst_tests/Iocatalyst_ConduitReadTest.C +++ b/packages/seacas/libraries/ioss/src/catalyst_tests/Iocatalyst_ConduitReadTest.C @@ -131,4 +131,4 @@ TEST_F(Iocatalyst_DatabaseIOTest, CellIdsAndCellNodeIds) cnids.raw_count()); EXPECT_EQ(cnidsBuff[0], 1); EXPECT_EQ(cnidsBuff[cnids.raw_count() - 1], 594); -} \ No newline at end of file +} diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C index e0f1b658d1..8d7e067387 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C @@ -231,6 +231,13 @@ namespace Ioex { "IOEX: Setting EX_VERBOSE|EX_DEBUG because EX_DEBUG environment variable is set.\n"); ex_opts(EX_VERBOSE | EX_DEBUG); } + // This is also done down in the exodus library, but helps logic to do it here... + if (util().get_environment("EXODUS_VERBOSE", isParallel)) { + fmt::print( + Ioss::DebugOut(), + "IOEX: Exodus error reporting set to VERBOSE because EXODUS_VERBOSE environment variable is set.\n"); + ex_opts(EX_VERBOSE); + } if (!is_input()) { if (util().get_environment("EX_MODE", exodusMode, isParallel)) { diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C index 1db64ac29a..09d0249fdb 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C @@ -391,19 +391,50 @@ namespace Ioex { #if NC_HAS_SZIP_WRITE exo_method = EX_COMPRESS_SZIP; #else - fmt::print(Ioss::WarnOut(), "The NetCDF library does not have SZip compression enabled." - " 'zlib' will be used instead.\n\n"); + if (myProcessor == 0) { + fmt::print(Ioss::WarnOut(), "The NetCDF library does not have SZip compression enabled." + " 'zlib' will be used instead.\n\n"); + } +#endif + } + else if (method == "zstd") { +#if NC_HAS_ZSTD == 1 + exo_method = EX_COMPRESS_ZSTD; +#else + if (myProcessor == 0) { + fmt::print(Ioss::WarnOut(), + "The NetCDF library does not have ZStandard compression enabled." + " 'zlib' will be used instead.\n\n"); + } +#endif + } + else if (method == "bzip2") { +#if NC_HAS_BZ2 == 1 + exo_method = EX_COMPRESS_BZ2; +#else + if (myProcessor == 0) { + fmt::print(Ioss::WarnOut(), + "The NetCDF library does not have Bzip2 / BZ2 compression enabled." + " 'zlib' will be used instead.\n\n"); + } #endif } else { - fmt::print(Ioss::WarnOut(), - "Unrecognized compression method specified: '{}'." - " 'zlib' will be used instead.\n\n", - method); + if (myProcessor == 0) { + fmt::print(Ioss::WarnOut(), + "Unrecognized compression method specified: '{}'." + " 'zlib' will be used instead.\n\n", + method); + } } ex_set_option(m_exodusFilePtr, EX_OPT_COMPRESSION_TYPE, exo_method); } + if (properties.exists("COMPRESSION_QUANTIZE_NSD")) { + int quant_level = properties.get("COMPRESSION_QUANTIZE_NSD").get_int(); + ex_set_option(m_exodusFilePtr, EX_OPT_QUANTIZE_NSD, quant_level); + } + if (properties.exists("COMPRESSION_LEVEL")) { int comp_level = properties.get("COMPRESSION_LEVEL").get_int(); ex_set_option(m_exodusFilePtr, EX_OPT_COMPRESSION_LEVEL, comp_level); diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C index 19769aa04a..73b6b9412b 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C @@ -715,6 +715,28 @@ namespace Ioex { fmt::print(Ioss::WarnOut(), "The NetCDF library does not have SZip compression enabled." " 'zlib' will be used instead.\n\n"); } +#endif + } + else if (method == "zstd") { +#if NC_HAS_ZSTD == 1 + exo_method = EX_COMPRESS_ZSTD; +#else + if (myProcessor == 0) { + fmt::print(Ioss::WarnOut(), + "The NetCDF library does not have ZStandard compression enabled." + " 'zlib' will be used instead.\n\n"); + } +#endif + } + else if (method == "bzip2") { +#if NC_HAS_BZ2 == 1 + exo_method = EX_COMPRESS_BZ2; +#else + if (myProcessor == 0) { + fmt::print(Ioss::WarnOut(), + "The NetCDF library does not have Bzip2 / BZ2 compression enabled." + " 'zlib' will be used instead.\n\n"); + } #endif } else { @@ -727,6 +749,12 @@ namespace Ioex { } ex_set_option(m_exodusFilePtr, EX_OPT_COMPRESSION_TYPE, exo_method); } + + if (properties.exists("COMPRESSION_QUANTIZE_NSD")) { + int quant_level = properties.get("COMPRESSION_QUANTIZE_NSD").get_int(); + ex_set_option(m_exodusFilePtr, EX_OPT_QUANTIZE_NSD, quant_level); + } + if (properties.exists("COMPRESSION_LEVEL")) { int comp_level = properties.get("COMPRESSION_LEVEL").get_int(); ex_set_option(m_exodusFilePtr, EX_OPT_COMPRESSION_LEVEL, comp_level); diff --git a/packages/seacas/libraries/ioss/src/main/io_shell.C b/packages/seacas/libraries/ioss/src/main/io_shell.C index b33477a8ae..8feb68395d 100644 --- a/packages/seacas/libraries/ioss/src/main/io_shell.C +++ b/packages/seacas/libraries/ioss/src/main/io_shell.C @@ -631,16 +631,27 @@ namespace { properties.add(Ioss::Property("IGNORE_INFO_RECORDS", "YES")); } - if (interFace.compression_level > 0 || interFace.shuffle || interFace.szip) { + if (interFace.compression_level > 0 || interFace.shuffle || interFace.szip || interFace.quant || + interFace.zlib || interFace.zstd || interFace.bz2) { properties.add(Ioss::Property("FILE_TYPE", "netcdf4")); properties.add(Ioss::Property("COMPRESSION_LEVEL", interFace.compression_level)); properties.add(Ioss::Property("COMPRESSION_SHUFFLE", static_cast(interFace.shuffle))); - if (interFace.szip) { + if (interFace.zlib) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "zlib")); + } + else if (interFace.szip) { properties.add(Ioss::Property("COMPRESSION_METHOD", "szip")); } - else if (interFace.zlib) { - properties.add(Ioss::Property("COMPRESSION_METHOD", "zlib")); + else if (interFace.zstd) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "zstd")); + } + else if (interFace.bz2) { + properties.add(Ioss::Property("COMPRESSION_METHOD", "bzip2")); + } + + if (interFace.quant) { + properties.add(Ioss::Property("COMPRESSION_QUANTIZE_NSD", interFace.quantize_nsd)); } } diff --git a/packages/seacas/libraries/ioss/src/main/shell_interface.C b/packages/seacas/libraries/ioss/src/main/shell_interface.C index 40fad4c4e6..17af865fda 100644 --- a/packages/seacas/libraries/ioss/src/main/shell_interface.C +++ b/packages/seacas/libraries/ioss/src/main/shell_interface.C @@ -113,15 +113,15 @@ void IOShell::Interface::enroll_options() options_.enroll("netcdf5", Ioss::GetLongOption::NoValue, "Output database will be a netcdf5 (CDF5) " "file instead of the classical netcdf file format", - nullptr); + nullptr, nullptr, true); options_.enroll("shuffle", Ioss::GetLongOption::NoValue, "Use a netcdf4 hdf5-based file and use hdf5s shuffle mode with compression.", nullptr); options_.enroll("compress", Ioss::GetLongOption::MandatoryValue, - "Specify the hdf5 zlib compression level [0..9] or szip [even, 4..32] to be used " - "on the output file.", + "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( @@ -132,7 +132,20 @@ void IOShell::Interface::enroll_options() options_.enroll( "szip", Ioss::GetLongOption::NoValue, "Use the SZip library if compression is enabled. Not as portable as zlib [exodus only]", - nullptr, nullptr, true); + nullptr); + + options_.enroll("zstd", Ioss::GetLongOption::NoValue, + "Use the Zstandard compression method if compression is enabled [exodus only].", + nullptr); + + options_.enroll("bzip2", Ioss::GetLongOption::NoValue, + "Use the Bzip2 compression method if compression is enabled [exodus only].", + nullptr); + + options_.enroll("quantize_nsd", Ioss::GetLongOption::MandatoryValue, + "Use the lossy quantize compression method. Value specifies number of digits to " + "retain (1..15) [exodus only]", + nullptr, nullptr, true); #if defined(SEACAS_HAVE_MPI) options_.enroll( @@ -424,6 +437,7 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor) netcdf4 = false; netcdf5 = false; ints_32_bit = true; + zlib = false; } if (options_.retrieve("netcdf4") != nullptr) { @@ -442,40 +456,44 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor) if (options_.retrieve("szip") != nullptr) { szip = true; zlib = false; + zstd = false; + bz2 = false; + } + if (options_.retrieve("zstd") != nullptr) { + szip = false; + zlib = false; + zstd = true; + bz2 = false; + } + if (options_.retrieve("zlib") != nullptr) { + szip = false; + zlib = true; + zstd = false; + bz2 = false; + } + if (options_.retrieve("bzip2") != nullptr) { + szip = false; + zlib = false; + zstd = false; + bz2 = true; } - zlib = (options_.retrieve("zlib") != nullptr); - if (szip && zlib) { + if (szip + zlib + zstd + bz2 > 1) { if (my_processor == 0) { - fmt::print(stderr, "ERROR: Only one of 'szip' or 'zlib' can be specified.\n"); + fmt::print(stderr, + "ERROR: Only one of 'szip' or 'zlib' or 'zstd' or 'bzip2' can be specified.\n"); } return false; } - compare = (options_.retrieve("compare") != nullptr); - ignore_qa_info = (options_.retrieve("ignore_qa_info") != nullptr); - ignore_node_map = (options_.retrieve("ignore_node_map") != nullptr); - ignore_elem_map = (options_.retrieve("ignore_element_map") != nullptr); - ignore_edge_map = (options_.retrieve("ignore_edge_map") != nullptr); - ignore_face_map = (options_.retrieve("ignore_face_map") != nullptr); - delete_qa = (options_.retrieve("delete_qa_records") != nullptr); - delete_info = (options_.retrieve("delete_info_records") != nullptr); { - const char *temp = options_.retrieve("absolute"); - if (temp != nullptr) { - abs_tolerance = std::strtod(temp, nullptr); - } - } - { - const char *temp = options_.retrieve("relative"); - if (temp != nullptr) { - rel_tolerance = std::strtod(temp, nullptr); - } - } - { - const char *temp = options_.retrieve("floor"); + const char *temp = options_.retrieve("quantize_nsd"); if (temp != nullptr) { - tol_floor = std::strtod(temp, nullptr); + quant = true; + quantize_nsd = std::strtol(temp, nullptr, 10); + if (szip + zlib + zstd + bz2 == 0) { + zlib = true; + } } } @@ -484,12 +502,16 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor) if (temp != nullptr) { compression_level = std::strtol(temp, nullptr, 10); + if (szip + zlib + zstd + bz2 == 0) { + zlib = true; + } + if (zlib) { if (compression_level < 0 || compression_level > 9) { if (my_processor == 0) { fmt::print(stderr, "ERROR: Bad compression level {}, valid value is between 0 and 9 inclusive " - "for gzip compression.\n", + "for gzip/zlib compression.\n", compression_level); } return false; @@ -518,6 +540,34 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor) } } + compare = (options_.retrieve("compare") != nullptr); + ignore_qa_info = (options_.retrieve("ignore_qa_info") != nullptr); + ignore_node_map = (options_.retrieve("ignore_node_map") != nullptr); + ignore_elem_map = (options_.retrieve("ignore_element_map") != nullptr); + ignore_edge_map = (options_.retrieve("ignore_edge_map") != nullptr); + ignore_face_map = (options_.retrieve("ignore_face_map") != nullptr); + delete_qa = (options_.retrieve("delete_qa_records") != nullptr); + delete_info = (options_.retrieve("delete_info_records") != nullptr); + + { + const char *temp = options_.retrieve("absolute"); + if (temp != nullptr) { + abs_tolerance = std::strtod(temp, nullptr); + } + } + { + const char *temp = options_.retrieve("relative"); + if (temp != nullptr) { + rel_tolerance = std::strtod(temp, nullptr); + } + } + { + const char *temp = options_.retrieve("floor"); + if (temp != nullptr) { + tol_floor = std::strtod(temp, nullptr); + } + } + #if defined(SEACAS_HAVE_MPI) add_processor_id_field = (options_.retrieve("add_processor_id_field") != nullptr); diff --git a/packages/seacas/libraries/ioss/src/main/shell_interface.h b/packages/seacas/libraries/ioss/src/main/shell_interface.h index a391174c7a..9faefcda8e 100644 --- a/packages/seacas/libraries/ioss/src/main/shell_interface.h +++ b/packages/seacas/libraries/ioss/src/main/shell_interface.h @@ -53,6 +53,7 @@ namespace IOShell { int surface_split_type{-1}; int data_storage_type{0}; int compression_level{0}; + int quantize_nsd{0}; int serialize_io_size{0}; int flush_interval{0}; @@ -78,8 +79,11 @@ namespace IOShell { // -> file.A, t=7,8 -> file.B int split_cyclic{0}; bool shuffle{false}; - bool zlib{true}; + bool zlib{false}; bool szip{false}; + bool zstd{false}; + bool bz2{false}; + bool quant{false}; bool debug{false}; bool detect_nans{false}; bool statistics{false}; diff --git a/packages/seacas/libraries/ioss/src/main/test/exodus_Q2_bc_parents.gold b/packages/seacas/libraries/ioss/src/main/test/exodus_Q2_bc_parents.gold index 6020ad82cc..0c991edefa 100644 Binary files a/packages/seacas/libraries/ioss/src/main/test/exodus_Q2_bc_parents.gold and b/packages/seacas/libraries/ioss/src/main/test/exodus_Q2_bc_parents.gold differ diff --git a/packages/seacas/libraries/ioss/src/main/test/exodus_bc_parents.gold b/packages/seacas/libraries/ioss/src/main/test/exodus_bc_parents.gold index d85243b1b3..19d677554b 100644 Binary files a/packages/seacas/libraries/ioss/src/main/test/exodus_bc_parents.gold and b/packages/seacas/libraries/ioss/src/main/test/exodus_bc_parents.gold differ