12 #define FAIL(...) FailMessage(rank, ERROR_LOCATION, __VA_ARGS__) 21 #define WARN_RESET(MSG, TO_STRUCT_PTR, FROM_STRUCT_PTR, MEMBER) do { \ 22 (TO_STRUCT_PTR)->MEMBER = (FROM_STRUCT_PTR)->MEMBER; \ 24 fprintf(out_logfile, "WARNING: %s. Using value of %d.\n", \ 25 MSG, (TO_STRUCT_PTR)->MEMBER); \ 27 fflush(out_logfile); \ 32 #define WARN(MSG) do { \ 33 if(aiori_warning_as_errors){ ERR(MSG); } \ 34 if (verbose > VERBOSE_2) { \ 35 fprintf(out_logfile, "WARNING: %s, (%s:%d).\n", \ 36 MSG, __FILE__, __LINE__); \ 38 fprintf(out_logfile, "WARNING: %s.\n", MSG); \ 40 fflush(out_logfile); \ 45 #define EWARNF(FORMAT, ...) do { \ 46 if(aiori_warning_as_errors){ ERRF(FORMAT, __VA_ARGS__); } \ 47 if (verbose > VERBOSE_2) { \ 48 fprintf(out_logfile, "WARNING: " FORMAT ", (%s:%d).\n", \ 49 __VA_ARGS__, __FILE__, __LINE__); \ 51 fprintf(out_logfile, "WARNING: " FORMAT "\n", \ 54 fflush(out_logfile); \ 59 #define EWARN(MSG) do { \ 65 #define EINFO(FORMAT, ...) do { \ 66 if (verbose > VERBOSE_2) { \ 67 fprintf(out_logfile, "INFO: " FORMAT ", (%s:%d).\n", \ 68 __VA_ARGS__, __FILE__, __LINE__); \ 70 fprintf(out_logfile, "INFO: " FORMAT "\n", \ 73 fflush(out_logfile); \ 77 #define ERRF(FORMAT, ...) do { \ 78 fprintf(out_logfile, "ERROR: " FORMAT ", (%s:%d)\n", \ 79 __VA_ARGS__, __FILE__, __LINE__); \ 80 fflush(out_logfile); \ 81 MPI_Abort(MPI_COMM_WORLD, -1); \ 86 #define ERR_ERRNO(MSG) do { \ 92 #define ERR(MSG) do { \ 93 fprintf(out_logfile, "ERROR: %s, (%s:%d)\n", \ 94 MSG, __FILE__, __LINE__); \ 95 fflush(out_logfile); \ 96 MPI_Abort(MPI_COMM_WORLD, -1); \ 106 #define MPI_CHECKF(MPI_STATUS, FORMAT, ...) do { \ 107 char resultString[MPI_MAX_ERROR_STRING]; \ 109 int checkf_mpi_status = MPI_STATUS; \ 111 if (checkf_mpi_status != MPI_SUCCESS) { \ 112 MPI_Error_string(checkf_mpi_status, resultString, &resultLength);\ 113 fprintf(out_logfile, "ERROR: " FORMAT ", MPI %s, (%s:%d)\n", \ 114 __VA_ARGS__, resultString, __FILE__, __LINE__); \ 115 fflush(out_logfile); \ 116 MPI_Abort(MPI_COMM_WORLD, -1); \ 127 #define MPI_CHECK(MPI_STATUS, MSG) do { \ 128 MPI_CHECKF(MPI_STATUS, "%s", MSG); \ void FailMessage(int rank, const char *location, char *format,...)
int aiori_warning_as_errors