My Project
programmer's documentation
|
Go to the source code of this file.
Typedefs | |
typedef void() | bft_error_handler_t(const char *const file_name, const int line_num, const int sys_error_code, const char *const format, va_list arg_ptr) |
Function pointer to opaque error handler. More... | |
Functions | |
void | bft_error (const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...) |
Calls the error handler (set by bft_error_handler_set() or default). More... | |
bft_error_handler_t * | bft_error_handler_get (void) |
Returns the error handler associated with the bft_error() function. More... | |
void | bft_error_handler_set (bft_error_handler_t *const handler) |
Associates an error handler with the bft_error() function. More... | |
bft_error_handler_t |
Function pointer to opaque error handler.
[in] | file_name | name of source file from which error handler called. |
[in] | line_num | line of source file from which error handler called. |
[in] | sys_error_code | error code if error in system or libc call, 0 otherwise. |
[in] | format | format string, as printf() and family. |
[in,out] | arg_ptr | pointer to variable argument list based on format string. |
In an MPI environment, it is recommended to replace the default error handler. This requires using the following headers:
An error handler function similar to the BFT default with MPI-awareness added looks like:
In a more complex environment, MPI_COMM_WORLD
could be replaced by another communicator.
void bft_error | ( | const char *const | file_name, |
const int | line_num, | ||
const int | sys_error_code, | ||
const char *const | format, | ||
... | |||
) |
Calls the error handler (set by bft_error_handler_set() or default).
With the default error handler, bft_print_flush() is called, an error message is output to stderr, and the current process exits with an EXIT_FAILURE code.
[in] | file_name | name of source file from which error handler called. |
[in] | line_num | line of source file from which error handler called. |
[in] | sys_error_code | error code if error in system or libc call, 0 otherwise. |
[in] | format | format string, as printf() and family. |
[in] | ... | variable arguments based on format string. |
bft_error_handler_t* bft_error_handler_get | ( | void | ) |
Returns the error handler associated with the bft_error() function.
void bft_error_handler_set | ( | bft_error_handler_t *const | handler | ) |
Associates an error handler with the bft_error() function.
[in] | handler | pointer to the error handler function. |