Skip to content
Snippets Groups Projects
Commit fa1c714d authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

die in an MPI-conformant way when running with MPI.

Former-commit-id: 600e09db0adf4742d48ed3ea66caaaec8a2d52cc
parent 10025b12
Branches
Tags
No related merge requests found
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*/ */
#ifdef WITH_MPI #ifdef WITH_MPI
extern int engine_rank; extern int engine_rank;
#define error(s, ...) { fprintf( stderr , "[%03i] %s:%s():%i: " s "\n" , engine_rank , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); abort(); } #define error(s, ...) { fprintf( stderr , "[%03i] %s:%s():%i: " s "\n" , engine_rank , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); MPI_Abort(MPI_COMM_WORLD, -1); }
#else #else
#define error(s, ...) { fprintf( stderr , "%s:%s():%i: " s "\n" , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); abort(); } #define error(s, ...) { fprintf( stderr , "%s:%s():%i: " s "\n" , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); abort(); }
#endif #endif
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
#include <math.h> #include <math.h>
#ifdef WITH_MPI
#include <mpi.h>
#endif
#include "const.h" #include "const.h"
#include "cycle.h" #include "cycle.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment