Section Error Handling describes the methods for creating and associating error handlers with communicators, files, windows, and sessions. Error handlers can be invoked implicitly when errors are raised during MPI operations, but can also be called by the user.
MPI_COMM_CALL_ERRHANDLER(comm, errorcode) | |
IN comm | communicator with error handler (handle) |
IN errorcode | error code (integer) |
This function invokes the error handler assigned to the communicator with the error code supplied. This function returns MPI_SUCCESS in C and the same value in IERROR if the error handler was successfully called (assuming the process is not aborted and the error handler returns).
MPI_WIN_CALL_ERRHANDLER(win, errorcode) | |
IN win | window with error handler (handle) |
IN errorcode | error code (integer) |
This function invokes the error handler assigned to the window with the error code supplied. This function returns MPI_SUCCESS in C and the same value in IERROR if the error handler was successfully called (assuming the process is not aborted and the error handler returns).
Advice to users.
In contrast to communicators, the error handler MPI_ERRORS_ARE_FATAL is associated with a
window when it is created.
( End of advice to users.)
MPI_FILE_CALL_ERRHANDLER(fh, errorcode) | |
IN fh | file with error handler (handle) |
IN errorcode | error code (integer) |
This function invokes the error handler assigned to the file with the error code supplied. This function returns MPI_SUCCESS in C and the same value in IERROR if the error handler was successfully called (assuming the process is not aborted and the error handler returns).
Advice to users.
The default error handler for files is
MPI_ERRORS_RETURN.
( End of advice to users.)
MPI_SESSION_CALL_ERRHANDLER(session, errorcode) | |
IN session | session with error handler (handle) |
IN errorcode | error code (integer) |
This function invokes the error handler assigned to the session with the error code supplied. This function returns MPI_SUCCESS in C and the same value in IERROR if the error handler was successfully called (assuming the process is not aborted and the error handler returns).
Advice to users.
Users are warned that handlers should not be called recursively with MPI_COMM_CALL_ERRHANDLER, MPI_FILE_CALL_ERRHANDLER, MPI_WIN_CALL_ERRHANDLER, or MPI_SESSION_CALL_ERRHANDLER. Doing this can create a situation where an infinite recursion is created. This can occur if MPI_COMM_CALL_ERRHANDLER, MPI_FILE_CALL_ERRHANDLER, MPI_WIN_CALL_ERRHANDLER, or MPI_SESSION_CALL_ERRHANDLER is called inside an error handler.
Error codes and classes are associated with a process. As a result,
they may be used in any error handler. Error handlers should be
prepared to deal with any error code
they are
given. Furthermore, it is
good practice to only call an error handler with the appropriate
error codes. For example, file errors would normally be sent to the
file error
handler.
( End of advice to users.)