Skip to content

Commit 53aa8bf

Browse files
committed
IOSS: Possibly help parallel errror output
1 parent 5588a49 commit 53aa8bf

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

packages/seacas/libraries/ioss/src/Ioss_Utils.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ namespace Ioss {
3535
enum class ElementShape : unsigned int;
3636
} // namespace Ioss
3737

38-
[[noreturn]] inline void IOSS_ERROR(const std::ostringstream &errmsg)
38+
[[noreturn]] inline void IOSS_ERROR(const std::string &errmsg)
3939
{
40-
throw std::runtime_error((errmsg).str());
41-
}
42-
43-
[[noreturn]] inline void IOSS_ERROR(const std::string &errmsg) { throw std::runtime_error(errmsg); }
44-
45-
#ifdef NDEBUG
46-
#define IOSS_ASSERT_USED(x) (void)x
40+
#if defined(SEACAS_HAVE_MPI)
41+
std::cerr "ERROR: " << errmsg << "\n";
42+
MPI_Abort(MPI_COMM_WORLD);
4743
#else
48-
#define IOSS_ASSERT_USED(x)
44+
throw std::runtime_error(errmsg);
4945
#endif
46+
}
47+
48+
[[noreturn]] inline void IOSS_ERROR(const std::ostringstream &errmsg)
49+
{
50+
IOSS_ERROR(errmsg.str());
51+
}
5052

5153
// We have been relying on the assumption that calling `.data()` on an empty vector
5254
// will return `nullptr`. However, according to cppreference (based on the standard):

0 commit comments

Comments
 (0)