Commit b1c6062b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Also flush stdout before printing to stderr in the other MPI error and assertion macros.

parent fd13cc8f
......@@ -50,7 +50,7 @@
extern int engine_rank;
#define error(s, ...) \
({ \
fflush(stdout); \
fflush(stdout); \
fprintf(stderr, "[%04i] %s %s:%s():%i: " s "\n", engine_rank, \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
......@@ -59,7 +59,7 @@ extern int engine_rank;
#else
#define error(s, ...) \
({ \
fflush(stdout); \
fflush(stdout); \
fprintf(stderr, "%s %s:%s():%i: " s "\n", clocks_get_timesincestart(), \
__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
swift_abort(1); \
......@@ -74,6 +74,7 @@ extern int engine_rank;
*/
#define mpi_error(res, s, ...) \
({ \
fflush(stdout); \
fprintf(stderr, "[%04i] %s %s:%s():%i: " s "\n", engine_rank, \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
......@@ -86,6 +87,7 @@ extern int engine_rank;
#define mpi_error_string(res, s, ...) \
({ \
fflush(stdout); \
fprintf(stderr, "[%04i] %s %s:%s():%i: " s "\n", engine_rank, \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
......@@ -124,6 +126,7 @@ extern int engine_rank;
#define assert(expr) \
({ \
if (!(expr)) { \
fflush(stdout); \
fprintf(stderr, "[%04i] %s %s:%s():%i: FAILED ASSERTION: " #expr " \n", \
engine_rank, clocks_get_timesincestart(), __FILE__, \
__FUNCTION__, __LINE__); \
......@@ -135,6 +138,7 @@ extern int engine_rank;
#define assert(expr) \
({ \
if (!(expr)) { \
fflush(stdout); \
fprintf(stderr, "%s %s:%s():%i: FAILED ASSERTION: " #expr " \n", \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__); \
fflush(stderr); \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment