NAME
MMPPIITTyyppeeccrreeaatteekkeeyyvvaall - Generates a new attribute key for caching on
data types. SSYYNNTTAAXX CC SSyynnttaaxx#include
int MPITypecreatekeyval(MPITypecopyattrfunction *typecopyattrfn, MPITypedeleteattrfunction *typedeleteattrfn, int *typekeyval, void *extrastate) FFoorrttrraann SSyynnttaaxx ((sseeee FFOORRTTRRAANN 7777 NNOOTTEESS)) INCLUDE 'mpif.h' MPITYPECREATEKEYVAL(TYPECOPYATTRFN, TYPEDELETEATTRFN,TYPEKEYVAL, EXTRASTATE, IERROR)
EXTERNAL TYPECOPYATTRFN, TYPEDELETEATTRFNINTEGER TYPEKEYVAL, IERROR
INTEGER(KIND=MPIADDRESSKIND) EXTRASTATE CC++++ SSyynnttaaxx#include
static int MPI::Datatype::Createkeyval(MPI::Datatype::Copyattrfunction* typecopyattrfn, MPI::Datatype::Deleteattrfunction* typedeleteattrfn, void* extrastate) IINNPPUUTT PPAARRAAMMEETTEERRSS typecopyattrfn Copy callback function for typekeyval (function). typedeleteattrfn Delete callback function for typekeyval (function). extrastate Extra state for callback functions. OOUUTTPPUUTT PPAARRAAMMEETTEERRSS typekeyval Key value for future access (integer).IERROR Fortran only: Error status (integer).
DESCRIPTION
MPITypecreatekeyval generates a new attribute key for caching on data types. This routine partially replaces MPIKeyvalcreate. The argument typecopyattrfn may be specified as MPITYPENULLCOPYFN or MPITYPEDUPFN from C, C++, or Fortran. MPITYPENULLCOPYFN is a function that does nothing other thanreturning flag = 0 and MPISUCCESS. MPITYPEDUPFN is a simple-minded
copy function that sets flag = 1, returns the value of attributevalin in attributevalout, and returns MPISUCCESS. The argument typedeleteattrfn may be specified as MPITYPENULLDELETEFN from C, C++, or Fortran.MPITYPENULLDELETEFN is a function that does nothing beyond return-
ing MPISUCCESS. The C callback functions are: typedef int MPITypecopyattrfunction(MPIDatatype oldtype, int typekeyval, void *extrastate, void *attributevalin, void *attributevalout, int *flag); and typedef int MPITypedeleteattrfunction(MPIDatatype type, int typekeyval, void *attributeval, void *extrastate); The Fortran callback functions are: SUBROUTINE TYPECOPYATTRFN(OLDTYPE, TYPEKEYVAL, EXTRASTATE,ATTRIBUTEVALIN, ATTRIBUTEVALOUT, FLAG, IERROR)
INTEGER OLDTYPE, TYPE KEYVAL, IERROR
INTEGER(KIND=MPIADDRESSKIND) EXTRASTATE, ATTRIBUTEVALIN, ATTRIBUTEVALOUT LOGICAL FLAG and SUBROUTINE TYPEDELETEATTRFN(TYPE, TYPEKEYVAL, ATTRIBUTEVAL, EXTRASTATE,IERROR)
INTEGER TYPE, TYPEKEYVAL, IERROR
INTEGER(KIND=MPIADDRESSKIND) ATTRIBUTE VAL, EXTRASTATE The C++ callbacks are: typedef int MPI::Datatype::Copyattrfunction(const MPI::Datatype& oldtype, int typekeyval, void* extrastate, const void* attributevalin, void* attributevalout, bool& flag); and typedef int MPI::Datatype::Deleteattrfunction(MPI::Datatype& type, int typekeyval, void* attributeval, void* extrastate); FFOORRTTRRAANN 7777 NNOOTTEESS The MPI standard prescribes portable Fortran syntax for the EXTRASTATEargument only for Fortran 90. FORTRAN 77 users may use the non-porta-
ble syntax INTEGER*MPIADDRESSKIND EXTRASTATE where MPIADDRESSKIND is a constant defined in mpif.h and gives the length of the declared integer in bytes. 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. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed withMPICommseterrhandler; the predefined error handler MPIERRORSRETURN
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.SEE ALSO
MPITypefreekeyval Open MPI 1.2 September 2006MPITypecreatekeyval(3OpenMPI)