10.3.4. Error Handlers for Sessions

PreviousUpNext
Up: Error Handling Next: Freeing Errorhandlers and Retrieving Error Strings Previous: Error Handlers for Files

MPI_SESSION_CREATE_ERRHANDLER(session_errhandler_fn, errhandler)
IN session_errhandler_fnuser defined error handling procedure (function)
OUT errhandler MPI error handler (handle)
C binding
int MPI_Session_create_errhandler(MPI_Session_errhandler_function *session_errhandler_fn, MPI_Errhandler *errhandler)
Fortran 2008 binding
MPI_Session_create_errhandler(session_errhandler_fn, errhandler, ierror)

PROCEDURE(MPI_Session_errhandler_function) :: session_errhandler_fn
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_CREATE_ERRHANDLER(SESSION_ERRHANDLER_FN, ERRHANDLER, IERROR)

EXTERNAL SESSION_ERRHANDLER_FN
INTEGER ERRHANDLER, IERROR

Creates an error handler that can be attached to a session object. In C, the session_errhandler_fn argument should be a function of type MPI_Session_errhandler_function, which is defined as

typedef void MPI_Session_errhandler_function(MPI_Session *session, int *error_code, ...);

The first argument is the session in use, the second is the error code to be returned. The remaining arguments are ``varargs'' arguments whose number and meaning is implementationdependent. An implementation should clearly document these arguments.

With the Fortran mpi_f08 module, the session_errhandler_fn argument should be of the form:

ABSTRACT INTERFACE
    SUBROUTINE MPI_Session_errhandler_function(session, error_code)

TYPE(MPI_Session) :: session
INTEGER :: error_code

With the Fortran mpi module and (deprecated) mpif.h include file, the SESSION_ERRHANDLER_FN argument should be of the form:

SUBROUTINE SESSION_ERRHANDLER_FUNCTION(SESSION, ERROR_CODE)

INTEGER SESSION, ERROR_CODE

MPI_SESSION_SET_ERRHANDLER(session, errhandler)
INOUT sessionsession (handle)
IN errhandlernew error handler for session (handle)
C binding
int MPI_Session_set_errhandler(MPI_Session session, MPI_Errhandler errhandler)
Fortran 2008 binding
MPI_Session_set_errhandler(session, errhandler, ierror)

TYPE(MPI_Session), INTENT(IN) :: session
TYPE(MPI_Errhandler), INTENT(IN) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_SET_ERRHANDLER(SESSION, ERRHANDLER, IERROR)

INTEGER SESSION, ERRHANDLER, IERROR

Attaches a new error handler to a session. The error handler must be either a predefined error handler, or an error handler created by a call to MPI_SESSION_CREATE_ERRHANDLER.

MPI_SESSION_GET_ERRHANDLER(session, errhandler)
IN sessionsession (handle)
OUT errhandlererror handler currently associated with session (handle)
C binding
int MPI_Session_get_errhandler(MPI_Session session, MPI_Errhandler *errhandler)
Fortran 2008 binding
MPI_Session_get_errhandler(session, errhandler, ierror)

TYPE(MPI_Session), INTENT(IN) :: session
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_GET_ERRHANDLER(SESSION, ERRHANDLER, IERROR)

INTEGER SESSION, ERRHANDLER, IERROR

Retrieves the error handler currently associated with a session.


PreviousUpNext
Up: Error Handling Next: Freeing Errorhandlers and Retrieving Error Strings Previous: Error Handlers for Files


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023