Skip to content
Snippets Groups Projects
Commit e329b722 authored by Bert Vandenbroucke's avatar Bert Vandenbroucke Committed by Matthieu Schaller
Browse files

Added warning macro that flushes immediately and writes to the standard error.

parent a1d48895
No related branches found
No related tags found
1 merge request!1353Draft: Subtask speedup - Still requires work
......@@ -131,6 +131,28 @@ extern int engine_rank;
})
#endif
/**
* @brief Macro to print a localized warning message with variable arguments.
*
* Same as message(), but this version prints to the standard error and is
* flushed immediately.
*
*/
#ifdef WITH_MPI
extern int engine_rank;
#define warning(s, ...) \
({ \
fprintf(stderr, "[%04i] %s %s: WARNING: " s "\n", engine_rank, \
clocks_get_timesincestart(), __FUNCTION__, ##__VA_ARGS__); \
})
#else
#define warning(s, ...) \
({ \
fprintf(stderr, "%s %s: WARNING: " s "\n", clocks_get_timesincestart(), \
__FUNCTION__, ##__VA_ARGS__); \
})
#endif
/**
* @brief Assertion macro compatible with MPI
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment