MPI_ERRHANDLER_SET, MPI_Errhandler_set Purpose Associates a new error handler with a communicator. C synopsis #include int MPI_Errhandler_set(MPI_Comm comm,MPI_Errhandler errhandler); FORTRAN synopsis include 'mpif.h' or use mpi MPI_ERRHANDLER_SET(INTEGER COMM, INTEGER ERRHANDLER, INTEGER IERROR) Parameters comm is a communicator (handle) (IN) errhandler is a new MPI error handler for comm (handle) (IN) IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine associates error handler errhandler with communicator comm. The association is local. MPI will use the specified error handling routine for any exception that takes place during a call on this communicator. Different tasks can attach different error handlers to the same communicator. MPI calls not related to a specific communicator are considered as attached to the communicator MPI_COMM_WORLD. Notes An error handler that does not end in the MPI job being terminated, creates undefined risks. Some errors are harmless, while others are catastrophic. For example, an error detected by one member of a collective operation can result in other members waiting indefinitely for an operation which will never occur. It is also important to note that the MPI standard does not specify the state the MPI library should be in after an error occurs. MPI does not provide a way for users to determine how much, if any, damage has been done to the MPI state by a particular error. The default error handler is MPI_ERRORS_ARE_FATAL, which behaves as if it contains a call to MPI_ABORT. MPI_ERRHANDLER_SET allows users to replace MPI_ERRORS_ARE_FATAL with an alternate error handler. The MPI standard provides MPI_ERRORS_RETURN, and IBM adds the non-standard MPE_ERRORS_WARN. These are pre-defined handlers that cause the error code to be returned and MPI to continue to run. Error handlers that are written by MPI users may call MPI_ABORT. If they do not abort, they too will cause MPI to deliver an error return code to the caller and continue to run. Error handlers that let MPI return should only be used if every MPI call checks its return code. Continuing to use MPI after an error involves undefined risks. You may do cleanup after an MPI error is detected, as long as it doesn't use MPI calls. This should normally be followed by a call to MPI_ABORT. The error Invalid error handler will be raised if errhandler is either a file error handler (created with MPI_FILE_CREATE_ERRHANDLER) or a window error handler (created with MPI_WIN_CREATE_ERRHANDLER). The predefined error handlers MPI_ERRORS_ARE_FATAL and MPI_ERRORS_RETURN can be associated with both communicators and file handles. Errors Invalid communicator Invalid error handler MPI not initialized MPI already finalized Related information MPI_ERRHANDLER_CREATE MPI_ERRHANDLER_GET