Skip to content

Commit

Permalink
IOSS: Fix file type ifdefs so actually do correct thing
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Sep 27, 2024
1 parent f186770 commit 486a767
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C
Original file line number Diff line number Diff line change
Expand Up @@ -273,51 +273,51 @@ namespace Ioex {
if (type == "netcdf3" || type == "netcdf-3") {
exodusMode = EX_CLOBBER; // Reset back to default...
}
#if NC_HAS_HDF5
if (type == "netcdf4" || type == "netcdf-4" || type == "hdf5") {
#if NC_HAS_HDF5
exodusMode |= EX_NETCDF4;
}
#else
fmt::print(Ioss::OUTPUT(), "IOEX: HDF5/netcdf-4 is not supported in this build. FILE_TYPE "
"setting will be ignored.\n");
fmt::print(Ioss::OUTPUT(), "IOEX: HDF5/netcdf-4 is not supported in this build. FILE_TYPE "
"setting will be ignored.\n");
#endif
#if NC_HAS_CDF5
}
else if (type == "netcdf5" || type == "netcdf-5" || type == "cdf5") {
#if NC_HAS_CDF5
exodusMode |= EX_64BIT_DATA;
}
#else
fmt::print(Ioss::OUTPUT(), "IOEX: CDF5/netcdf-5 is not supported in this build. FILE_TYPE "
"setting will be ignored.\n");
fmt::print(Ioss::OUTPUT(), "IOEX: CDF5/netcdf-5 is not supported in this build. FILE_TYPE "
"setting will be ignored.\n");
#endif
}
}

#if NC_HAS_HDF5
if (properties.exists("ENABLE_FILE_GROUPS")) {
#if NC_HAS_HDF5
exodusMode |= EX_NETCDF4;
exodusMode |= EX_NOCLASSIC;
}
#else
fmt::print(Ioss::OUTPUT(), "IOEX: HDF5/netcdf-4 is not supported in this build. "
"ENABLE_FILE_GROUPS setting will be ignored.\n");
fmt::print(Ioss::OUTPUT(), "IOEX: HDF5/netcdf-4 is not supported in this build. "
"ENABLE_FILE_GROUPS setting will be ignored.\n");
#endif
}

#if NC_HAS_HDF5
bool compress = ((properties.exists("COMPRESSION_LEVEL") &&
properties.get("COMPRESSION_LEVEL").get_int() > 0) ||
(properties.exists("COMPRESSION_SHUFFLE") &&
properties.get("COMPRESSION_SHUFFLE").get_int() > 0));

if (compress) {
#if NC_HAS_HDF5
if (!(exodusMode & EX_NETCDF4)) {
fmt::print(Ioss::OUTPUT(), "IOEX: Compression requires netcdf-4/HDF5-based file. Setting "
"file type to netcdf-4.\n");
exodusMode |= EX_NETCDF4;
}
}
#else
fmt::print(Ioss::OUTPUT(), "IOEX: HDF5/netcdf-4 is not supported in this build. Compression "
"setting will be ignored.\n");
fmt::print(Ioss::OUTPUT(), "IOEX: HDF5/netcdf-4 is not supported in this build. Compression "
"setting will be ignored.\n");
#endif
}

if (properties.exists("MAXIMUM_NAME_LENGTH")) {
maximumNameLength = properties.get("MAXIMUM_NAME_LENGTH").get_int();
Expand Down

0 comments on commit 486a767

Please sign in to comment.