18static void error_handler(
int error_code)
21 char error_string[BUFSIZ];
22 int length_of_error_string, error_class;
24 MPI_Comm_rank(MPI_COMM_WORLD,&rank);
26 MPI_Error_class(error_code, &error_class);
27 MPI_Error_string(error_class, error_string, &length_of_error_string);
28 std::cerr << rank <<
": " << error_string;
29 MPI_Error_string(error_code, error_string, &length_of_error_string);
30 std::cerr << rank <<
": " << error_string;
33#define MPI_SAFE_CALL(call) {\
35 if (MPI_SUCCESS != err) {\
36 std::cerr << "MPI error: "<< __FILE__ << " " << __LINE__ << "\n";\
38 MPI_Abort(MPI_COMM_WORLD,-1);\