The MPI spec:
http://mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf
says that:
MPI_INTEGER1 corresponds to INTEGER*1
MPI_INTEGER2 corresponds to INTEGER*2
MPI_INTEGER4 corresponds to INTEGER*4
MPI_INTEGER8 corresponds to INTEGER*8
MPI_INTEGER16 corresponds to INTEGER*16
(Secs. 3.2.2, A.1) which is not completely portable.
However, it also says, in 13.5.3 User-Defined Data Representations,
that these optional types have the following lengths in bytes:
MPI_INTEGER1 1
MPI_INTEGER2 2
MPI_INTEGER4 4
MPI_INTEGER8 8
MPI_INTEGER16 16
It further says explicitly in 17.1. FORTRAN SUPPORT,
Support for Size-specific MPI Datatypes:
"...MPI_<TYPE>n in C and Fortran where <TYPE> is one of REAL, INTEGER
and COMPLEX, and n is the length in bytes of the machine representation."
which suggests therefore that these MPI datatypes
*always* correspond to F2008 named constants for integer kinds as:
MPI_INTEGER1 int8
MPI_INTEGER2 int16
MPI_INTEGER4 int32
MPI_INTEGER8 int64
MPI_INTEGER16 ---- ?
This mapping does seem to work in my limited tests, but...
My question - can the program logic rely
on int8 *always* matching MPI_INTEGER1, etc. or
am I missing some other assumptions or corner cases?
And for real kinds - is it *always* true that e.g.
real32 kind will match MPI_REAL4, etc.?
Thanks
Anton
|