Skip to content

Commit

Permalink
IOSS: Add option to delete qa and/or info records from output
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Mar 7, 2024
1 parent 8d50455 commit 16f2df5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
9 changes: 8 additions & 1 deletion packages/seacas/libraries/ioss/src/main/io_shell.C
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

namespace {
std::string codename;
std::string version = "6.3 (2024/02/28)";
std::string version = "6.4 (2024/03/07)";

bool mem_stats = false;

Expand Down Expand Up @@ -597,6 +597,13 @@ namespace {
properties.add(Ioss::Property("MEMORY_WRITE", 1));
}

if (interFace.delete_qa) {
properties.add(Ioss::Property("IGNORE_QA_RECORDS", "YES"));
}
if (interFace.delete_info) {
properties.add(Ioss::Property("IGNORE_INFO_RECORDS", "YES"));
}

if (interFace.compression_level > 0 || interFace.shuffle || interFace.szip) {
properties.add(Ioss::Property("FILE_TYPE", "netcdf4"));
properties.add(Ioss::Property("COMPRESSION_LEVEL", interFace.compression_level));
Expand Down
19 changes: 12 additions & 7 deletions packages/seacas/libraries/ioss/src/main/shell_interface.C
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ void IOShell::Interface::enroll_options()
options_.enroll("floor", Ioss::GetLongOption::MandatoryValue,
"Only compare values if `|a| > floor && |b| > floor`", nullptr);
options_.enroll("ignore_qa_info", Ioss::GetLongOption::NoValue,
"If comparing databases, do not compare the qa and info records.", nullptr,
nullptr, true);
"If comparing databases, do not compare the qa and info records.", nullptr, nullptr, true);

options_.enroll("ignore_node_map", Ioss::GetLongOption::NoValue,
"Do not read the global node id map (if any) from the input database.", nullptr,
Expand Down Expand Up @@ -245,10 +244,6 @@ void IOShell::Interface::enroll_options()
"comma-separated list of times that should be transferred to output database",
nullptr);

options_.enroll("delete_timesteps", Ioss::GetLongOption::NoValue,
"Do not transfer any timesteps or transient data to the output database",
nullptr);

options_.enroll("append_after_time", Ioss::GetLongOption::MandatoryValue,
"add steps on input database after specified time on output database", nullptr);

Expand All @@ -259,7 +254,15 @@ void IOShell::Interface::enroll_options()
"Specify the number of steps between database flushes.\n"
"\t\tIf not specified, then the default database-dependent setting is used.\n"
"\t\tA value of 0 disables flushing.",
nullptr, nullptr, true);
nullptr);
options_.enroll("delete_timesteps", Ioss::GetLongOption::NoValue,
"Do not transfer any timesteps or transient data to the output database",
nullptr);

options_.enroll("delete_qa_records", Ioss::GetLongOption::NoValue,
"Do not output qa records to output database.", nullptr);
options_.enroll("delete_info_records", Ioss::GetLongOption::NoValue,
"Do not output info records to output database.", nullptr, nullptr, true);

options_.enroll("field_suffix_separator", Ioss::GetLongOption::MandatoryValue,
"Character used to separate a field suffix from the field basename\n"
Expand Down Expand Up @@ -413,6 +416,8 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor)
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");
Expand Down
2 changes: 2 additions & 0 deletions packages/seacas/libraries/ioss/src/main/shell_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ namespace IOShell {
bool ignore_elem_map{false};
bool ignore_edge_map{false};
bool ignore_face_map{false};
bool delete_qa{false};
bool delete_info{false};
char fieldSuffixSeparator{'_'};
};
} // namespace IOShell

0 comments on commit 16f2df5

Please sign in to comment.