From 94536d018ecd7faa475d643eb1edd7bf48dabc5c Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 7 Aug 2024 15:41:25 -0600 Subject: [PATCH] IOSS: Add flag to enable/disable building of exonull --- cmake-config | 1 + cmake-exodus | 1 + .../ioss/cmake/SEACASIoss_config.h.in | 2 ++ .../seacas/libraries/ioss/src/CMakeLists.txt | 9 ++++++- .../libraries/ioss/src/Ioss_CodeTypes.h | 1 + .../ioss/src/init/Ionit_Initializer.C | 6 ++++- .../libraries/ioss/src/main/shell_interface.C | 26 +++++++++++-------- 7 files changed, 33 insertions(+), 13 deletions(-) diff --git a/cmake-config b/cmake-config index 1b9662c3ed..443bdb7822 100755 --- a/cmake-config +++ b/cmake-config @@ -497,6 +497,7 @@ cmake -G "${GENERATOR}" \ -D BUILD_SHARED_LIBS:BOOL=${SHARED} \ -D CMAKE_BUILD_TYPE=${BUILD_TYPE} \ ${SUBSET_OPTIONS} \ +-D ENABLE_ExoNull:BOOL=YES \ -D Seacas_ENABLE_Zoltan:BOOL=${ZOLTAN} \ -D Seacas_ENABLE_TESTS=ON \ -D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_PATH} \ diff --git a/cmake-exodus b/cmake-exodus index 09f9ff6c2d..bb753d0904 100755 --- a/cmake-exodus +++ b/cmake-exodus @@ -353,6 +353,7 @@ cmake -G "${GENERATOR}" \ -D BUILD_SHARED_LIBS:BOOL=${SHARED} \ -D CMAKE_BUILD_TYPE=${BUILD_TYPE} \ -D Seacas_ENABLE_SEACASExodus=YES \ +-D ENABLE_ExoNull=YES \ -D Seacas_ENABLE_SEACASExodus_for=${FORTRAN} \ -D Seacas_ENABLE_SEACASExoIIv2for32=${FORTRAN} \ -D Seacas_ENABLE_TESTS=YES \ diff --git a/packages/seacas/libraries/ioss/cmake/SEACASIoss_config.h.in b/packages/seacas/libraries/ioss/cmake/SEACASIoss_config.h.in index 15b62c0bea..808f36ece4 100644 --- a/packages/seacas/libraries/ioss/cmake/SEACASIoss_config.h.in +++ b/packages/seacas/libraries/ioss/cmake/SEACASIoss_config.h.in @@ -11,6 +11,8 @@ #cmakedefine SEACAS_HAVE_EXODUS +#cmakedefine SEACAS_HAVE_EXONULL + #cmakedefine SEACAS_HAVE_CGNS #cmakedefine SEACAS_HAVE_PAMGEN diff --git a/packages/seacas/libraries/ioss/src/CMakeLists.txt b/packages/seacas/libraries/ioss/src/CMakeLists.txt index ee0779d4fd..3ab10755d3 100644 --- a/packages/seacas/libraries/ioss/src/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/CMakeLists.txt @@ -28,8 +28,12 @@ ENDIF() IF (${PACKAGE_NAME}_ENABLE_SEACASExodus) SET(SEACAS_HAVE_EXODUS ON) + IF (ENABLE_ExoNull) + SET(SEACAS_HAVE_EXONULL ON) + ENDIF() ENDIF() + TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") @@ -111,9 +115,12 @@ endif() IF (${PACKAGE_NAME}_ENABLE_SEACASExodus) ADD_SUBDIRECTORY(exodus) - ADD_SUBDIRECTORY(exonull) + IF (ENABLE_ExoNull) + ADD_SUBDIRECTORY(exonull) + ENDIF() ENDIF() + IF (TPL_ENABLE_Pamgen OR Trilinos_ENABLE_Pamgen ) ADD_SUBDIRECTORY(pamgen) ENDIF() diff --git a/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h b/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h index f799bad41f..a88d7816b5 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h +++ b/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h @@ -35,6 +35,7 @@ inline std::string IOSS_SYM_TENSOR() { return {"sym_tensor_33"}; } /* #undef IOSS_THREADSAFE */ /* #undef SEACAS_HAVE_KOKKOS */ #define SEACAS_HAVE_EXODUS +#define SEACAS_HAVE_EXONULL #define SEACAS_HAVE_CGNS /* #undef SEACAS_HAVE_FAODEL */ #define SEACAS_HAVE_PAMGEN diff --git a/packages/seacas/libraries/ioss/src/init/Ionit_Initializer.C b/packages/seacas/libraries/ioss/src/init/Ionit_Initializer.C index f589b7f134..02f00dc7e1 100644 --- a/packages/seacas/libraries/ioss/src/init/Ionit_Initializer.C +++ b/packages/seacas/libraries/ioss/src/init/Ionit_Initializer.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 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. // @@ -10,8 +10,10 @@ #if defined(SEACAS_HAVE_EXODUS) #include "exodus/Ioex_IOFactory.h" +#if defined(SECAS_HAVE_EXONULL) #include "exonull/Ioexnl_IOFactory.h" #endif +#endif #include "gen_struc/Iogs_DatabaseIO.h" #include "generated/Iogn_DatabaseIO.h" @@ -74,8 +76,10 @@ namespace Ioss::Init { #if defined(SEACAS_HAVE_EXODUS) Ioex::IOFactory::factory(); // Exodus +#if defined(SECAS_HAVE_EXONULL) Ioexnl::IOFactory::factory(); #endif +#endif #if defined(SEACAS_HAVE_PAMGEN) Iopg::IOFactory::factory(); // Pamgen #endif diff --git a/packages/seacas/libraries/ioss/src/main/shell_interface.C b/packages/seacas/libraries/ioss/src/main/shell_interface.C index 1bd0003843..40fad4c4e6 100644 --- a/packages/seacas/libraries/ioss/src/main/shell_interface.C +++ b/packages/seacas/libraries/ioss/src/main/shell_interface.C @@ -48,6 +48,9 @@ void IOShell::Interface::enroll_options() "Database type for output file:" #if defined(SEACAS_HAVE_EXODUS) " exodus" +#if defined(SEACAS_HAVE_EXONULL) + " exonull" +#endif #endif #if defined(SEACAS_HAVE_CGNS) " cgns" @@ -55,7 +58,7 @@ void IOShell::Interface::enroll_options() #if defined(SEACAS_HAVE_FAODEL) " faodel" #endif - ".\n\t\tIf not specified, guess from extension or exodus is the default.", + " null.\n\t\tIf not specified, guess from extension or exodus is the default.", "unknown"); options_.enroll("compare", Ioss::GetLongOption::NoValue, "Compare the contents of the INPUT and OUTPUT files.", nullptr); @@ -215,10 +218,10 @@ void IOShell::Interface::enroll_options() "Files are decomposed externally into a file-per-processor in a parallel run.", nullptr); - options_.enroll( - "add_processor_id_field", Ioss::GetLongOption::NoValue, - "Add a cell-centered field whose value is the processor id of that cell", nullptr); - + options_.enroll("add_processor_id_field", Ioss::GetLongOption::NoValue, + "Add a cell-centered field whose value is the processor id of that cell", + nullptr); + options_.enroll("serialize_io_size", Ioss::GetLongOption::MandatoryValue, "Number of processors that can perform simultaneous IO operations in " "a parallel run;\n\t\t0 to disable", @@ -233,10 +236,11 @@ void IOShell::Interface::enroll_options() "If non-zero, then put <$val> timesteps in each file. Then close file and start new file.", nullptr); - options_.enroll("split_cyclic", Ioss::GetLongOption::MandatoryValue, - "If non-zero, then the `split_times` timesteps will be put into <$val> files\n\t\tand " - "then recycle filenames.", - nullptr); + options_.enroll( + "split_cyclic", Ioss::GetLongOption::MandatoryValue, + "If non-zero, then the `split_times` timesteps will be put into <$val> files\n\t\tand " + "then recycle filenames.", + nullptr); options_.enroll("file_per_state", Ioss::GetLongOption::NoValue, "put transient data for each timestep in separate file (EXPERIMENTAL)", nullptr); @@ -320,7 +324,7 @@ void IOShell::Interface::enroll_options() options_.enroll("omit_sets", Ioss::GetLongOption::MandatoryValue, "comma-separated list of nodeset/edgeset/faceset/elemset/sideset names\n" - "\t\tthat should NOT be transferred to output database", + "\t\tthat should NOT be transferred to output database", nullptr); options_.enroll("boundary_sideset", Ioss::GetLongOption::NoValue, @@ -560,7 +564,7 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor) } if (options_.retrieve("line_decomp") != nullptr) { - line_decomp = true; + line_decomp = true; decomp_extra = options_.get_option_value("line_decomp", decomp_extra); }