NAME
MMPPIIRReeggiisstteerrddaattaarreepp - Defines data representation.
SSYYNNTTAAXX C Syntax#include
int MPIRegisterdatarep(char *datarep, MPIDatarepconversionfunction *readconversionfn, MPIDatarepconversionfunction *writeconversionfn, MPIDatarepextentfunction *dtypefileextentfn, void *extrastate) Fortran Syntax INCLUDE 'mpif.h' MPIREGISTERDATAREP(DATAREP, READCONVERSIONFN, WRITECONVERSIONFN, DTYPEFILEEXTENTFN,EXTRASTATE, IERROR)
CHARACTER*(*) DATAREP EXTERNAL READCONVERSIONFN, WRITECONVERSIONFN, DTYPEFILEEXTENTFNINTEGER IERROR
INTEGER(KIND=MPIADDRESSKIND) EXTRASTATE CC++++ SSyynnttaaxx#include
void MPI::Registerdatarep(const char* datarep, MPI::Datarepconversionfunction* readconversionfn, MPI::Datarepconversionfunction* writeconversionfn, MPI::Datarepextentfunction* dtypefileextentfn, void* extrastate) IINNPPUUTT PPAARRAAMMEETTEERRSS datarep Data representation identifier (string). readconversionfn Function invoked to convert from file representation to native representation (function). writeconversionfn Function invoked to convert from native representation to file representation (function). dtypefileextentfnFunction invoked to get the extent of a data type as repre-
sented in the file (function). extrastate Extra state. OOUUTTPPUUTT PPAARRAAMMEETTEERRIERROR Fortran only: Error status (integer).
DESCRIPTION
MPIRegisterdatarep defines a data representation. It associates the data representation's identifier (a string) with the functions that convert from file representation to the native representation and viceversa, with the function that gets the extent of a data type as repre-
sented in the file, as well as with "extra state," which is used for passing arguments. Once a data representation has been registered using this routine, you may specify its identifier as an argument toMPIFilesetview, causing subsequent data-access operations to call
the specified conversion functions. The call associates readconversionfn, writeconversionfn, and dtypefileextentfn with the data representation identifier datarep. datarep can then be used as an argument to MPIFilesetview, causing subsequent data access operations to call the conversion functions to convert all data items accessed between file data representation and native representation. MPIRegisterdatarep is a local operation and only registers the data representation for the calling MPI process. If datarep is already defined, an error in the error class MPIERRDUPDATAREP is raised using the default file error handler. The length of a data representation string is limited to the value of MPIMAXDATAREPSTRING. MPIMAXDATAREPSTRING must have a value of at least 64. No routines are provided to delete data representations and free the associated resources; it is not expected that an application will generate them in significant numbers. NNOOTTEESS The Fortran version of each MPI I/O routine includes a final argument,IERROR, which is not defined in the PARAMETERS sections. This argument
is used to return the error status of the routine in the manner typical for Fortran library routines. The C version of each routine returns an error status as an integer return value. Error classes are found in mpi.h (for C), mpif.h (for Fortran), and mpi++.h (for C++). EERRRROORRSS Almost all MPI routines return an error value; C routines as the valueof the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set toMPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. For MPI I/O function errors, the default error handler is setto MPIERRORSRETURN. The error handler may be changed with
MPIFileseterrhandler; the predefined error handlerMPIERRORSAREFATAL may be used to make I/O errors fatal. Note that
MPI does not guarantee that an MPI program can continue past an error. Open MPI 1.2 September 2006 MPIRegisterdatarep(3OpenMPI)