203. Error Handlers for Files

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

MPI_FILE_CREATE_ERRHANDLER(file_errhandler_fn, errhandler)
IN file_errhandler_fnuser defined error handling procedure (function)
OUT errhandler MPI error handler (handle)

int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn, MPI_Errhandler *errhandler)

MPI_File_create_errhandler(file_errhandler_fn, errhandler, ierror)
PROCEDURE(MPI_File_errhandler_function) :: file_errhandler_fn
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_FILE_CREATE_ERRHANDLER(FILE_ERRHANDLER_FN, ERRHANDLER, IERROR)
EXTERNAL FILE_ERRHANDLER_FN
INTEGER ERRHANDLER, IERROR

Creates an error handler that can be attached to a file object. The user routine should be, in C, a function of type MPI_File_errhandler_function, which is defined as

typedef void MPI_File_errhandler_function(MPI_File *, int *, ...);

The first argument is the file in use, the second is the error code to be returned.

With the Fortran mpi_f08 module, the user routine file_errhandler_fn should be of the form:

SUBROUTINE MPI_File_errhandler_function(file, error_code)
TYPE(MPI_File) :: file
INTEGER :: error_code

With the Fortran mpi module and mpif.h, the user routine FILE_ERRHANDLER_FN should be of the form:

SUBROUTINE FILE_ERRHANDLER_FUNCTION(FILE, ERROR_CODE)
INTEGER FILE, ERROR_CODE

MPI_FILE_SET_ERRHANDLER(file, errhandler)
INOUT filefile (handle)
IN errhandlernew error handler for file (handle)

int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler)

MPI_File_set_errhandler(file, errhandler, ierror)
TYPE(MPI_File), INTENT(IN) :: file
TYPE(MPI_Errhandler), INTENT(IN) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_FILE_SET_ERRHANDLER(FILE, ERRHANDLER, IERROR)
INTEGER FILE, ERRHANDLER, IERROR

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

MPI_FILE_GET_ERRHANDLER(file, errhandler)
IN filefile (handle)
OUT errhandlererror handler currently associated with file (handle)

int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)

MPI_File_get_errhandler(file, errhandler, ierror)
TYPE(MPI_File), INTENT(IN) :: file
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_FILE_GET_ERRHANDLER(FILE, ERRHANDLER, IERROR)
INTEGER FILE, ERRHANDLER, IERROR

Retrieves the error handler currently associated with a file.


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


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

(Unofficial) MPI-3.1 of June 4, 2015
HTML Generated on June 4, 2015