-
Peter W. Draper authored
Important change is moving flush to immediately after MPI_Rget, if before then the test loop could not see the update, also keep to the passive contract, only flush on the push side, even though we get from the destination, so it knows when to flush
Peter W. Draper authoredImportant change is moving flush to immediately after MPI_Rget, if before then the test loop could not see the update, also keep to the passive contract, only flush on the push side, even though we get from the destination, so it knows when to flush
error.h 1.72 KiB
#include <mpi.h>
#include "clocks.h"
extern int myrank;
/* Exit in error macro. */
#define error(s, ...) \
({ \
fflush(stdout); \
fprintf(stderr, "[%03i] %s %s:%s():%i: " s "\n", myrank, \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
MPI_Abort(MPI_COMM_WORLD, -1); \
})
/* Print a message */
#define message(s, ...) \
({ \
printf("[%04i] %s %s: " s "\n", myrank, clocks_get_timesincestart(), \
__FUNCTION__, ##__VA_ARGS__); \
})
/* Print MPI error string. */
#define mpi_error_message(res, s, ...) \
({ \
fflush(stdout); \
fprintf(stderr, "[%04i] %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(stderr, "%s\n\n", buf); \
})