Skip to content
Snippets Groups Projects
Commit 0e6693f3 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add macro to report the MPI error

parent 8d4c4bc9
No related branches found
No related tags found
No related merge requests found
......@@ -19,3 +19,15 @@ extern int myrank;
printf("[%04i] %s %s: " s "\n", myrank, clocks_get_timesincestart(), \
__FUNCTION__, ##__VA_ARGS__); \
})
/* Print MPI error as a string. */
#define mpi_error_string(res, s, ...) \
({ \
fprintf(stdout, "[%03i] %s %s:%s():%i: " s "\n", myrank, \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
int len = 1024; \
char buf[len]; \
MPI_Error_string(res, buf, &len); \
fprintf(stdout, "%s\n\n", buf); \
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment