Skip to content

Commit 865d644

Browse files
committed
IOSS: Fix calling output_summary in fpp mode from single rank
1 parent 94f52b1 commit 865d644

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/seacas/libraries/ioss/src/Ioss_Region.C

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "Ioss_Property.h"
3131
#include "Ioss_PropertyManager.h"
3232
#include "Ioss_Region.h"
33+
#include "Ioss_SerializeIO.h"
3334
#include "Ioss_SideBlock.h"
3435
#include "Ioss_SideSet.h"
3536
#include "Ioss_SmartAssert.h"
@@ -594,8 +595,15 @@ namespace Ioss {
594595
int num_width = Ioss::Utils::number_width(max_entity, true) + 2;
595596
int sb_width = Ioss::Utils::number_width(max_sb, true) + 2;
596597

597-
int change_set_count = get_database()->num_internal_change_set();
598-
auto change_set_name = get_internal_change_set_name();
598+
int change_set_count = -1;
599+
std::string change_set_name = "unknown";
600+
601+
// If in file-per-rank parallel and serialize io is enabled, then usually only want summary on single rank.
602+
// If called that way, then the following calls will fail since they expect all ranks to call...
603+
if (!Ioss::SerializeIO::isEnabled()) {
604+
change_set_count = get_database()->num_internal_change_set();
605+
change_set_name = get_internal_change_set_name();
606+
}
599607
if (!change_set_name.empty() && change_set_name != "/") {
600608
change_set_name = ",\t[CS: " + change_set_name + "]";
601609
}

0 commit comments

Comments
 (0)