NAME
MMPPIITTyyppeemmaattcchhssiizzee - Returns an MPI datatype of a given type and size
SSYYNNTTAAXX CC SSyynnttaaxx#include
int MPITypematchsize(int typeclass, int size, MPIDatatype *type) FFoorrttrraann SSyynnttaaxx INCLUDE 'mpif.h'MPITYPEMATCHSIZE(TYPECLASS, SIZE, TYPE, IERROR)
INTEGER TYPECLASS, SIZE, TYPE, IERROR
CC++++ SSyynnttaaxx#include
static MPI::Datatype MPI::Matchsize(int typeclass, int size) IINNPPUUTT PPAARRAAMMEETTEERRSS typeclass Generic type specifier (integer). size Size, in bytes, of representation (integer). OOUUTTPPUUTT PPAARRAAMMEETTEERRSS type Datatype with correct type and size (handle).IERROR Fortran only: Error status (integer).
DESCRIPTION
The function returns an MPI datatype matching a local variable of type(typeclass, size). The returned type is a reference (handle) to a pre-
defined named datatype, not a duplicate. This type cannot be freed. The value of typeclass may be set to one of MPITYPECLASSREAL, MPITYPECLASSINTEGER, or MPITYPECLASSCOMPLEX, corresponding to the desired datatype.MPItypematchsize can be used to obtain a size-specific type that
matches a Fortran numeric intrinsic type: first call MPISizeof to com-
pute the variable size, then call MPITypematchsize to find a suit-
able datatype. In C and C++, use the sizeof builtin instead of MPISizeof. It is erroneous to specify a size not supported by the compiler. 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 the MPI man page for a full list of MPI error codes.SEE ALSO
MPISizeof MPITypegetextent Open MPI 1.2 September 2006 MPITypematchsize(3OpenMPI)