IBM Books

MPI Subroutine Reference

MPI_COMM_CALL_ERRHANDLER, MPI_Comm_call_errhandler

Purpose

Calls the error handler assigned to the communicator with the error code supplied.

C synopsis

#include <mpi.h>
int MPI_Comm_call_errhandler (MPI_Comm comm, int errorcode);

C++ synopsis

#include mpi.h
void MPI::Comm::Call_errhandler(int errorcode) const;

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_COMM_CALL_ERRHANDLER(INTEGER COMM, INTEGER ERRORCODE, INTEGER IERROR)

Parameters

comm
is the communicator with the error handler (handle) (IN)

errorcode
is the error code (integer) (IN)

IERROR
is the FORTRAN return code. It is always the last argument.

Description

This subroutine calls the error handler assigned to the communicator with the error code supplied.

Notes

MPI_COMM_CALL_ERRHANDLER returns MPI_SUCCESS in C and C++ and the same value in IERROR if the error handler was successfully called (assuming the error handler itslef is not fatal).

The default error handler for communicators is MPI_ERRORS_ARE_FATAL. Thus, calling MPI_COMM_CALL_ERRHANDLER will terminate the job if the default error handler has not been changed for this communicator or on the parent before the communicator was created. When a predefined error handler is used on comm, the error message printed by PE MPI will indicate the error code that is passed in. You cannot force PE MPI to issue a specific predefined error by passing its error code to this subroutine.

Error handlers should not be called recursively with MPI_COMM_CALL_ERRHANDLER. Doing this can create a situation where an infinite recursion is created. This can occur if MPI_COMM_CALL_ERRHANDLER is called inside an error handler.

Error codes and classes are associated with a task, so they can be used in any error handler. An error handler should be prepared to deal with any error code it is given. Furthermore, it is good practice to only call an error handler with the appropriate error codes. For example, communicator errors would normally be sent to the communicator error handler.

Errors

Invalid communicator

Invalid error code

MPI not initialized

MPI already finalized

Related information

MPI_COMM_CREATE_ERRHANDLER
MPI_COMM_GET_ERRHANDLER
MPI_COMM_SET_ERRHANDLER
MPI_ERRHANDLER_FREE


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]