|
| 1 | +Almost all MPI routines return an error value; C routines as the return result |
| 2 | +of the function and Fortran routines in the last argument. |
| 3 | + |
| 4 | +Before the error value is returned, the current MPI error handler associated |
| 5 | +with the communication object (e.g., communicator, window, file) is called. |
| 6 | +If no communication object is associated with the MPI call, then the call is |
| 7 | +considered attached to MPI_COMM_SELF and will call the associated MPI error |
| 8 | +handler. When MPI_COMM_SELF is not initialized (i.e., before |
| 9 | +MPI_INIT / MPI_INIT_THREAD, after MPI_FINALIZE, or when using the Sessions |
| 10 | +Model exclusively) the error raises the initial error handler. The initial |
| 11 | +error handler can be changed by calling MPI_COMM_SET_ERRHANDLER on |
| 12 | +MPI_COMM_SELF when using the World model, or the mpi_initial_errhandler CLI |
| 13 | +argument to mpiexec or info key to MPI_COMM_SPAWN[_MULTIPLE]. |
| 14 | +If no other appropriate error handler has been set, then the MPI_ERRORS_RETURN |
| 15 | +error handler is called for MPI I/O functions and the MPI_ERRORS_ABORT error |
| 16 | +handler is called for all other MPI functions. |
| 17 | + |
| 18 | +In the sessions model, the error handler can be set during MPI_Session_init. |
| 19 | + |
| 20 | +Open MPI includes three predefined error handlers that can be used:: |
| 21 | + |
| 22 | + MPI_ERRORS_ARE_FATAL: Causes the program to abort all connected MPI processes. |
| 23 | + MPI_ERRORS_ABORT: An error handler that can be invoked on a communicator, |
| 24 | + window, file, or session. When called on a communicator, it |
| 25 | + acts as if MPI_ABORT was called on that communicator. If |
| 26 | + called on a window or file, acts as if MPI_ABORT was called |
| 27 | + on a communicator containing the group of processes in the |
| 28 | + corresponding window or file. If called on a session, |
| 29 | + aborts only the local process. |
| 30 | + MPI_ERRORS_RETURN: Returns an error code to the application. |
| 31 | + |
| 32 | +MPI applications can also implement their own error handlers. |
| 33 | + |
| 34 | +Custom MPI error handlers can be created by calling: |
| 35 | +:ref:`MPI_Comm_create_errhandler(3) <MPI_Comm_create_errhandler>` |
| 36 | +:ref:`MPI_File_create_errhandler(3) <MPI_File_create_errhandler>` |
| 37 | +:ref:`MPI_Session_create_errhandler(3) <MPI_Session_create_errhandler>` |
| 38 | +:ref:`MPI_Win_create_errhandler(3) <MPI_Win_create_errhandler>` |
| 39 | + |
| 40 | +Predefined and custom error handlers can be set by calling: |
| 41 | +:ref:`MPI_Comm_set_errhandler(3) <MPI_Comm_set_errhandler>` |
| 42 | +:ref:`MPI_File_set_errhandler(3) <MPI_File_set_errhandler>` |
| 43 | +:ref:`MPI_Session_set_errhandler(3) <MPI_Session_set_errhandler>` |
| 44 | +:ref:`MPI_Win_set_errhandler(3) <MPI_Win_set_errhandler>` |
| 45 | + |
| 46 | +Note that MPI does not guarantee that an MPI program can continue past |
| 47 | +an error. |
| 48 | + |
| 49 | +See the MPI man page for a full list of MPI error codes. |
| 50 | + |
| 51 | +See the Error Handling section of the MPI-|mpi_standard_version| standard for |
| 52 | +more information. |
| 53 | + |
0 commit comments