25 #ifndef OMPI_ERRHANDLER_H
26 #define OMPI_ERRHANDLER_H
28 #include "ompi_config.h"
37 #include "ompi/errhandler/errhandler_predefined.h"
40 #if OPAL_ENABLE_FT_MPI
41 #include "orte/mca/plm/plm_types.h"
53 OMPI_ERRHANDLER_NULL_FORTRAN = 0,
54 OMPI_ERRORS_ARE_FATAL_FORTRAN,
55 OMPI_ERRORS_RETURN_FORTRAN
74 OMPI_ERRHANDLER_LANG_C,
75 OMPI_ERRHANDLER_LANG_CXX,
76 OMPI_ERRHANDLER_LANG_FORTRAN
85 OMPI_ERRHANDLER_TYPE_PREDEFINED,
86 OMPI_ERRHANDLER_TYPE_COMM,
87 OMPI_ERRHANDLER_TYPE_WIN,
88 OMPI_ERRHANDLER_TYPE_FILE
102 void *handle,
int *err_code,
103 const char *message);
111 char eh_name[MPI_MAX_OBJECT_NAME];
123 MPI_Comm_errhandler_function *eh_comm_fn;
124 ompi_file_errhandler_fn *eh_file_fn;
125 MPI_Win_errhandler_function *eh_win_fn;
146 #define PREDEFINED_ERRHANDLER_PAD 1024
198 #define OMPI_ERR_INIT_FINALIZE(name) \
199 if( OPAL_UNLIKELY(!ompi_mpi_initialized || ompi_mpi_finalized) ) { \
200 ompi_mpi_errors_are_fatal_comm_handler(NULL, NULL, name); \
218 #define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
219 ompi_errhandler_invoke((mpi_object)->error_handler, \
221 (int)(mpi_object)->errhandler_type, \
222 ompi_errcode_get_mpi_code(err_code), \
238 #define OMPI_ERRHANDLER_CHECK(rc, mpi_object, err_code, message) \
239 if( OPAL_UNLIKELY(rc != OMPI_SUCCESS) ) { \
240 int __mpi_err_code = ompi_errcode_get_mpi_code(err_code); \
241 OPAL_CR_EXIT_LIBRARY() \
242 ompi_errhandler_invoke((mpi_object)->error_handler, \
244 (int) (mpi_object)->errhandler_type, \
247 return (__mpi_err_code); \
265 #define OMPI_ERRHANDLER_RETURN(rc, mpi_object, err_code, message) \
266 OPAL_CR_EXIT_LIBRARY() \
267 if ( OPAL_UNLIKELY(OMPI_SUCCESS != rc) ) { \
268 int __mpi_err_code = ompi_errcode_get_mpi_code(err_code); \
269 ompi_errhandler_invoke((mpi_object)->error_handler, \
271 (int)(mpi_object)->errhandler_type, \
274 return (__mpi_err_code); \
276 return MPI_SUCCESS; \
331 OMPI_DECLSPEC
int ompi_errhandler_invoke(
ompi_errhandler_t *errhandler,
void *mpi_object,
332 int type,
int err_code,
const char *message);
343 const char *message);
398 if ( OMPI_ERRHANDLER_TYPE_PREDEFINED == errhandler->eh_mpi_object_type )
404 #if OPAL_ENABLE_FT_MPI
409 int ompi_errhandler_internal_rte_init(
void);
410 int ompi_errhandler_internal_rte_finalize(
void);
411 OMPI_DECLSPEC
int ompi_errmgr_mark_failed_peer(
ompi_proc_t *ompi_proc, orte_proc_state_t state);
OMPI_DECLSPEC ompi_predefined_errhandler_t ompi_mpi_errhandler_null
Global variable for MPI_ERRHANDLER_NULL.
Definition: errhandler.c:57
dynamic pointer array
Definition: opal_pointer_array.h:45
Definition: errhandler.h:148
Back-end type for MPI_Errorhandler.
Definition: errhandler.h:108
OMPI_DECLSPEC ompi_predefined_errhandler_t ompi_mpi_errors_are_fatal
Global variable for MPI_ERRORS_ARE_FATAL.
Definition: errhandler.c:58
See opal_bitmap.h for an explanation of why there is a split between OPAL and ORTE for this generic c...
Process identification structure interface.
Remote Open MPI process structure.
Definition: proc.h:56
static bool ompi_errhandler_is_intrinsic(ompi_errhandler_t *errhandler)
Check to see if an errhandler is intrinsic.
Definition: errhandler.h:396
void( ompi_errhandler_generic_handler_fn_t)(void *, int *,...)
Typedef for generic errhandler function.
Definition: errhandler.h:68
OMPI_DECLSPEC void ompi_errhandler_runtime_callback(opal_pointer_array_t *procs)
Callback function from runtime layer to alert the MPI layer of an error at the runtime layer...
Definition: errhandler.c:256
Interface into the MPI portion of the Open MPI Run Time Environment.
ompi_errhandler_lang_t
Enum to denote what language the error handler was created from.
Definition: errhandler.h:73
void( ompi_errhandler_cxx_dispatch_fn_t)(struct ompi_errhandler_t *errhandler, void *handle, int *err_code, const char *message)
C++ invocation function signature.
Definition: errhandler.h:101
int ompi_errhandler_request_invoke(int count, struct ompi_request_t **requests, const char *message)
Invoke an MPI exception on the first request found in the array that has a non-MPI_SUCCESS value for ...
Definition: errhandler_invoke.c:115
Base object.
Definition: opal_object.h:182
OMPI_DECLSPEC ompi_errhandler_t * ompi_errhandler_create(ompi_errhandler_type_t object_type, ompi_errhandler_generic_handler_fn_t *func, ompi_errhandler_lang_t language)
Create a ompi_errhandler_t.
Definition: errhandler.c:208
void( ompi_errhandler_fortran_handler_fn_t)(MPI_Fint *, MPI_Fint *,...)
Typedef for all fortran errhandler functions.
Definition: errhandler.h:62
OMPI_DECLSPEC ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions
Global variable for MPI::ERRORS_THROW_EXCEPTIONS.
Definition: errhandler.c:60
OMPI_DECLSPEC opal_pointer_array_t ompi_errhandler_f_to_c_table
Table for Fortran <-> C errhandler handle conversion.
Definition: errhandler.c:40
#define PREDEFINED_ERRHANDLER_PAD
Padded struct to maintain back compatibiltiy.
Definition: errhandler.h:146
Compiler-specific prefetch functions.
int ompi_errhandler_finalize(void)
Finalize the error handler interface.
Definition: errhandler.c:158
OMPI_DECLSPEC ompi_predefined_errhandler_t ompi_mpi_errors_return
Global variable for MPI_ERRORS_RETURN.
Definition: errhandler.c:59
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
int ompi_errhandler_init(void)
Initialize the error handler interface.
Definition: errhandler.c:75
Main top-level request struct definition.
Definition: request.h:100
ompi_errhandler_type_t
Enum used to describe what kind MPI object an error handler is used for.
Definition: errhandler.h:84