16 #define FAIL(...) FailMessage(rank, ERROR_LOCATION, __VA_ARGS__) 20 #define WARN_RESET(MSG, TO_STRUCT_PTR, FROM_STRUCT_PTR, MEMBER) do { \ 21 (TO_STRUCT_PTR)->MEMBER = (FROM_STRUCT_PTR)->MEMBER; \ 23 fprintf(out_logfile, "WARNING: %s. Using value of %d.\n", \ 24 MSG, (TO_STRUCT_PTR)->MEMBER); \ 26 fflush(out_logfile); \ 30 #define WARNF(FORMAT, ...) do { \ 31 if(aiori_warning_as_errors){ \ 32 ERRF(FORMAT, __VA_ARGS__); \ 34 if (verbose > VERBOSE_2) { \ 35 fprintf(out_logfile, "WARNING: " FORMAT ", (%s:%d).\n", \ 36 __VA_ARGS__, __FILE__, __LINE__); \ 38 fprintf(out_logfile, "WARNING: " FORMAT "\n", \ 41 fflush(out_logfile); \ 45 #define WARN(MSG) do { \ 50 #define INFOF(FORMAT, ...) do { \ 51 if (verbose > VERBOSE_2) { \ 52 fprintf(out_logfile, "INFO: " FORMAT ", (%s:%d).\n", \ 53 __VA_ARGS__, __FILE__, __LINE__); \ 55 fprintf(out_logfile, "INFO: " FORMAT "\n", \ 58 fflush(out_logfile); \ 62 #define INFO(MSG) do { \ 67 #define ERRF(FORMAT, ...) do { \ 68 fprintf(out_logfile, "ERROR: " FORMAT ", (%s:%d)\n", \ 69 __VA_ARGS__, __FILE__, __LINE__); \ 70 fflush(out_logfile); \ 71 MPI_Abort(MPI_COMM_WORLD, -1); \ 75 #define ERR(MSG) do { \ 81 #define MPI_CHECKF(MPI_STATUS, FORMAT, ...) do { \ 82 char resultString[MPI_MAX_ERROR_STRING]; \ 84 int _MPI_STATUS = (MPI_STATUS); \ 86 if (_MPI_STATUS != MPI_SUCCESS) { \ 87 MPI_Error_string(_MPI_STATUS, resultString, &resultLength); \ 88 fprintf(out_logfile, "ERROR: " FORMAT ", MPI %s, (%s:%d)\n", \ 89 __VA_ARGS__, resultString, __FILE__, __LINE__); \ 90 fflush(out_logfile); \ 91 MPI_Abort(MPI_COMM_WORLD, -1); \ 97 #define MPI_CHECK(MPI_STATUS, MSG) do { \ 98 MPI_CHECKF(MPI_STATUS, "%s", MSG); \ void FailMessage(int rank, const char *location, char *format,...)
int aiori_warning_as_errors