Open MPI logo

MPI_Comm_create_errhandler(3) man page (version 5.0.0rc2)

  |   Home   |   Support   |   FAQ   |  

« Return to documentation listing

Table of Contents

Name

C]MPI_Comm_create_errhandlerR] - Creates an error handler that can be attached to communicators.

Syntax

C Syntax



C]#include <mpi.h>int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function *function, MPI_Errhandler *errhandler)R]Fortran Syntax



C]USE MPI! or the older form: INCLUDE [aq]mpif.h[aq]MPI_COMM_CREATE_ERRHANDLER(FUNCTION, ERRHANDLER, IERROR) EXTERNAL FUNCTION INTEGER ERRHANDLER, IERRORR]Fortran 2008 Syntax



C]USE mpi_f08MPI_Comm_create_errhandler(comm_errhandler_fn, errhandler, ierror) PROCEDURE(MPI_Comm_errhandler_function) :: comm_errhandler_fn TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler INTEGER, OPTIONAL, INTENT(OUT) :: ierrorR]Deprecated Type Name Note

MPI-2.2 deprecated the C]MPI_Comm_errhandler_fnR]

and
C]MPI::Comm::Errhandler_fnR] types in favor of C]MPI_Comm_errhandler_functionR] and C]MPI::Comm::Errhandler_functionR], respectively. Open MPI supports both names (indeed, the _fn names are typedefs to the _function names).

Input Parameter

[bu]
C]functionR] : User-defined error handling procedure (function).

Output Parameters

[bu]
C]errhandlerR] : MPI error handler (handle).
[bu]
C]IERRORR] : Fortran only: Error status (integer).

Description

C]MPI_Comm_create_errhandlerR] creates an error handler that can be attached to communicators. This C]functionR] is identical to C]MPI_Errhandler_createR], the use of which is deprecated. In C, the user routine should be a C]functionR] of type C]MPI_Comm_errhandler_functionR], which is defined as


C]typedef void MPI_Comm_errhandler_function(MPI_Comm *, int *, ...);R]The first argument is the communicator in use.
The second is the error code to be returned by the MPI routine that raised the error. This typedef replaces C]MPI_Handler_functionR], the use of which is deprecated. In Fortran, the user routine should be of this form:

C]SUBROUTINE COMM_ERRHANDLER_FUNCTION(COMM, ERROR_CODE, ...) INTEGER COMM, ERROR_CODER]Errors

Almost all MPI routines return an error value;

C routines as the value
of the C]functionR] and Fortran routines in the last argument. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O C]functionR] errors. The error handler may be changed with C]MPI_Comm_set_errhandlerR]; the predefined error handler C]MPI_ERRORS_RETURNR] may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.


Table of Contents

« Return to documentation listing