Go to the documentation of this file.
31 #include <esio/visibility.h>
90 int esio_errno) ESIO_API;
107 const char *reason) ESIO_API;
149 const char * reason);
202 #define ESIO_ERROR(reason, esio_errno) \
204 esio_error (reason, __FILE__, __LINE__, esio_errno) ; \
205 return esio_errno ; \
216 #define ESIO_ERROR_VAL(reason, esio_errno, value) \
218 esio_error (reason, __FILE__, __LINE__, esio_errno) ; \
229 #define ESIO_ERROR_VOID(reason, esio_errno) \
231 esio_error (reason, __FILE__, __LINE__, esio_errno) ; \
243 #define ESIO_ERROR_NULL(reason, esio_errno) \
244 ESIO_ERROR_VAL(reason, esio_errno, 0)
254 #define ESIO_ERROR_REPORT(reason, esio_errno) \
256 esio_error (reason, __FILE__, __LINE__, esio_errno) ; \
261 #define ESIO_MPICHKx_TEMPLATE(esio_error_macro,stmt) \
263 const int _chk_stat = (stmt); \
264 if (_chk_stat != MPI_SUCCESS) { \
265 char _chk_reason[384]; \
266 char _chk_mpistring[MPI_MAX_ERROR_STRING]; \
268 const int _chk_string_stat \
269 = MPI_Error_string(_chk_stat,_chk_mpistring,&_chk_len); \
270 snprintf(_chk_reason, sizeof(_chk_reason)/sizeof(_chk_reason[0]), \
271 "Encountered MPI error code %d: %s", _chk_stat, \
272 (_chk_string_stat == MPI_SUCCESS) \
273 ? _chk_mpistring : "UNKNOWN"); \
274 esio_error_macro(_chk_reason, ESIO_EFAILED); \
292 #define ESIO_MPICHKQ(stmt) \
293 ESIO_MPICHKx_TEMPLATE(ESIO_ERROR,stmt)
307 #define ESIO_MPICHKN(stmt) \
308 ESIO_MPICHKx_TEMPLATE(ESIO_ERROR_NULL,stmt)
322 #define ESIO_MPICHKV(stmt) \
323 ESIO_MPICHKx_TEMPLATE(ESIO_ERROR_VOID,stmt)
337 #define ESIO_MPICHKR(stmt) \
338 ESIO_MPICHKx_TEMPLATE(ESIO_ERROR_REPORT,stmt)
@ ESIO_EFAILED
Generic failure.
Definition: error.h:61
esio_status
Standardized error status codes used throughout ESIO.
Definition: error.h:57
void esio_error(const char *reason, const char *file, int line, int esio_errno)
Calls the error handler last set using esio_set_error_handler when invoked.
esio_error_handler_t * esio_set_error_handler_off(void)
An error handler implementation that disables all error reporting.
esio_stream_handler_t * esio_set_stream_handler(esio_stream_handler_t *new_handler)
Sets the current stream handler for the process.
const char * esio_strerror(const int esio_errno)
Look up a human-readable error message for the given error status.
@ ESIO_ENOMEM
Memory allocation failed.
Definition: error.h:63
FILE * esio_set_stream(FILE *new_stream)
Set the default stream for error message display.
@ ESIO_EFAULT
Invalid pointer.
Definition: error.h:59
void esio_stream_handler_t(const char *label, const char *file, int line, const char *reason)
Defines the function prototype necessary for a stream handler.
Definition: error.h:146
@ ESIO_ESANITY
Sanity check failed - shouldn't happen.
Definition: error.h:62
@ ESIO_EINVAL
Invalid argument supplied by user.
Definition: error.h:60
void esio_stream_printf(const char *label, const char *file, int line, const char *reason)
Print an error message to the current error stream.
@ ESIO_SUCCESS
Success.
Definition: error.h:58
esio_error_handler_t * esio_set_error_handler(esio_error_handler_t *new_handler)
Sets the current error handler for the process.
@ ESIO_NOTFOUND
Object not found.
Definition: error.h:64
void esio_error_handler_t(const char *reason, const char *file, int line, int esio_errno)
Defines the function prototype necessary for an error handler.
Definition: error.h:130
Generated on Sat Jul 4 2026 17:52:45 for ESIO
by
doxygen
1.8.17