[MOAB-dev] commit/MOAB: danwu: If MBError() is called from the main() routine, call MPI_Abort() to allow the parallel program to be properly shutdown.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Feb 24 15:51:40 CST 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/167086fe3bbe/
Changeset: 167086fe3bbe
Branch: error_handling_enhancement
User: danwu
Date: 2014-02-24 22:51:15
Summary: If MBError() is called from the main() routine, call MPI_Abort() to allow the parallel program to be properly shutdown.
Affected #: 1 file
diff --git a/src/ErrorHandler.cpp b/src/ErrorHandler.cpp
index 8f0d30c..96a373f 100644
--- a/src/ErrorHandler.cpp
+++ b/src/ErrorHandler.cpp
@@ -1,5 +1,8 @@
#include "moab/ErrorHandler.hpp"
#include "ErrorOutput.hpp"
+#ifdef USE_MPI
+#include "moab_mpi.h"
+#endif
#include <stdlib.h>
@@ -60,6 +63,13 @@ ErrorInfo MBError(int line, const char* func, const char* file, const char* dir,
{
MBTraceBackErrorHandler(line, func, file, dir, err_info.get_error_msg(), err_type);
+#ifdef USE_MPI
+ // If this is called from the main() routine we call MPI_Abort() to allow
+ // the parallel program to be properly shutdown
+ if (strncmp(func, "main", 4) == 0)
+ MPI_Abort(MPI_COMM_WORLD, err_info.get_error_code());
+#endif
+
return err_info;
}
#else
@@ -67,6 +77,13 @@ ErrorCode MBError(int line, const char* func, const char* file, const char* dir,
{
MBTraceBackErrorHandler(line, func, file, dir, err_msg, err_type);
+#ifdef USE_MPI
+ // If this is called from the main() routine we call MPI_Abort() to allow
+ // the parallel program to be properly shutdown
+ if (strncmp(func, "main", 4) == 0)
+ MPI_Abort(MPI_COMM_WORLD, err_code);
+#endif
+
return err_code;
}
#endif
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list