Skip to content

Commit

Permalink
IOSS: Add line_decomp io_shell option; clean up output
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Jun 12, 2024
1 parent 164c967 commit 8ef4dbf
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 deletions.
10 changes: 7 additions & 3 deletions packages/seacas/libraries/ioss/src/Ioss_Decomposition.C
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ namespace Ioss {
"\nIOSS: Using decomposition method '{}' for {} elements on {} mpi ranks.\n",
m_method, fmt::group_digits(m_globalElementCount), m_processorCount);

if (!m_decompExtra.empty()) {
fmt::print(Ioss::OUTPUT(), "\tDecomposition extra data: '{}'.\n", m_decompExtra);
}

if ((size_t)m_processorCount > m_globalElementCount) {
fmt::print(Ioss::WarnOut(),
"Decomposing {} elements across {} mpi ranks will "
Expand Down Expand Up @@ -459,7 +463,7 @@ namespace Ioss {
if (m_method == "MAP") {
guided_decompose();
}
if (m_method == "SPECIFIED") {
if (m_method == "LINE_DECOMP") {
// Currently used for line decomposition with another decomposition type.
// The line-modified decomposition is done prior to this and builds the
// `m_elementToProc` which is then used here to decompose the elements...
Expand Down Expand Up @@ -679,7 +683,7 @@ namespace Ioss {
template <typename INT> void Decomposition<INT>::guided_decompose()
{
show_progress(__func__);
assert(m_method == "MAP" || m_method == "VARIABLE" || m_method == "SPECIFIED");
assert(m_method == "MAP" || m_method == "VARIABLE" || m_method == "LINE_DECOMP");
// - Read my portion of the map / variable.
// - count # of exports to each rank
// -- exportElementCount[proc]
Expand All @@ -706,7 +710,7 @@ namespace Ioss {
// [0..m_processorCount).
double scale = 1.0;
auto pos = m_decompExtra.find(",");
if (m_method != "SPECIFIED" && pos != std::string::npos) {
if (m_method != "LINE_DECOMP" && pos != std::string::npos) {
// Extract the string following the comma...
auto scale_str = m_decompExtra.substr(pos + 1);
if (scale_str == "AUTO" || scale_str == "auto") {
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/ioss/src/Ioss_DecompositionUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace Ioss {

float ver = 0.0;
Zoltan_Initialize(argc, argv, &ver);
fmt::print("Using Zoltan version {:.2}, method {}\n", static_cast<double>(ver), method);
fmt::print("\tUsing Zoltan version {:.2}, method {}\n", static_cast<double>(ver), method);

Zoltan zz(Ioss::ParallelUtils::comm_self());

Expand Down Expand Up @@ -354,7 +354,7 @@ namespace Ioss {
decompose_zoltan(region, num_ranks, method, element_to_proc, weights, false, false, false,
dummy);
double end = Ioss::Utils::timer();
fmt::print(stderr, "Decompose elements = {:.5}\n", end - start);
fmt::print(stderr, "\tDecompose elements = {:.5}\n", end - start);
region.get_database()->progress("exit decompose_elements");

// Make sure all elements on a chain are on the same processor rank...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ namespace Ioex {
MPI_Scatterv(Data(element_to_proc_global), Data(sendcounts), Data(displs), MPI_INT,
Data(m_decomposition.m_elementToProc), decomp_elem_count(), MPI_INT, 0,
m_decomposition.m_comm);
m_decomposition.m_method = "SPECIFIED";
m_decomposition.m_method = "LINE_DECOMP";
m_decomposition.show_progress("***LINE_DECOMPOSE END***");
}

Expand Down
3 changes: 3 additions & 0 deletions packages/seacas/libraries/ioss/src/main/io_shell.C
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ namespace {
if (interFace.decomp_method == "MAP" || interFace.decomp_method == "VARIABLE") {
properties.add(Ioss::Property("DECOMPOSITION_EXTRA", interFace.decomp_extra));
}
if (interFace.line_decomp) {
properties.add(Ioss::Property("LINE_DECOMPOSITION", interFace.decomp_extra));
}
}

if (interFace.retain_empty_blocks) {
Expand Down
24 changes: 18 additions & 6 deletions packages/seacas/libraries/ioss/src/main/shell_interface.C
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ void IOShell::Interface::enroll_options()
"\t\t(if auto) by `int((max_entry+1)/proc_count)`.",
nullptr);

options_.enroll("line_decomp", Ioss::GetLongOption::OptionalValue,
"Generate the `lines` or `columns` of elements from the specified surface(s).\n"
"\t\tSpecify a comma-separated list of surface/sideset names from which the "
"lines will grow.\n"
"\t\tDo not split a line/column across processors.\n"
"\t\tOmit or enter 'ALL' for all surfaces in model.",
nullptr, "ALL");

options_.enroll("external", Ioss::GetLongOption::NoValue,
"Files are decomposed externally into a file-per-processor in a parallel run.",
nullptr);
Expand All @@ -213,7 +221,7 @@ void IOShell::Interface::enroll_options()

options_.enroll("serialize_io_size", Ioss::GetLongOption::MandatoryValue,
"Number of processors that can perform simultaneous IO operations in "
"a parallel run; 0 to disable",
"a parallel run;\n\t\t0 to disable",
nullptr, nullptr, true);
#endif

Expand All @@ -226,7 +234,7 @@ void IOShell::Interface::enroll_options()
nullptr);

options_.enroll("split_cyclic", Ioss::GetLongOption::MandatoryValue,
"If non-zero, then the `split_times` timesteps will be put into <$val> files and "
"If non-zero, then the `split_times` timesteps will be put into <$val> files\n\t\tand "
"then recycle filenames.",
nullptr);

Expand Down Expand Up @@ -274,7 +282,7 @@ void IOShell::Interface::enroll_options()

options_.enroll("field_suffix_separator", Ioss::GetLongOption::MandatoryValue,
"Character used to separate a field suffix from the field basename\n"
"\t\t when recognizing vector, tensor fields. Enter '0' for no separator",
"\t\twhen recognizing vector, tensor fields. Enter '0' for no separator",
"_");

options_.enroll("disable_field_recognition", Ioss::GetLongOption::NoValue,
Expand Down Expand Up @@ -311,9 +319,8 @@ void IOShell::Interface::enroll_options()
nullptr);

options_.enroll("omit_sets", Ioss::GetLongOption::MandatoryValue,
"comma-separated list of nodeset/edgeset/faceset/elemset/sideset names that "
"should NOT be transferred to "
"output database",
"comma-separated list of nodeset/edgeset/faceset/elemset/sideset names\n"
"\t\tthat should NOT be transferred to output database",
nullptr);

options_.enroll("boundary_sideset", Ioss::GetLongOption::NoValue,
Expand Down Expand Up @@ -552,6 +559,11 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor)
decomp_extra = options_.get_option_value("variable", decomp_extra);
}

if (options_.retrieve("line_decomp") != nullptr) {
line_decomp = true;
decomp_extra = options_.get_option_value("line_decomp", decomp_extra);
}

if (options_.retrieve("cyclic") != nullptr) {
decomp_method = "CYCLIC";
}
Expand Down
1 change: 1 addition & 0 deletions packages/seacas/libraries/ioss/src/main/shell_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ namespace IOShell {
bool ignore_face_map{false};
bool delete_qa{false};
bool delete_info{false};
bool line_decomp{false};
char fieldSuffixSeparator{'_'};
};
} // namespace IOShell

0 comments on commit 8ef4dbf

Please sign in to comment.