[MPIWG Fortran] Data type of F08 subarray

Junchao Zhang jczhang at mcs.anl.gov
Tue May 13 10:08:30 CDT 2014

p626 of MPI-3.0 gives such an example

REAL s(100), r(100)
CALL MPI_Isend(s(1:100:5), 3, MPI_REAL, ..., rq, ierror)

All nonblocking MPI functions behave as if the user-specified elements of
choice buffers are copied to a contiguous scratch buffer in the MPI runtime
environment. All datatype descriptions (in the example above, “3,
MPI_REAL”) read and store data from and to this virtual contiguous scratch
buffer ...

Here,  data type of s(100) match with MPI_REAL, so everything is fine.  But
I want to know if MPI permits mismatched types, for example, can s(100) be
an integer array?  If the answer is no, then compilers can not detect this
error ; if yes, then it is hard to implement that. To avoid memory copying
to a scratch buffer, I want to use MPI datatypes. But if I have two types,
one is given by the choice buffer itself, the other is given by the
MPI_Datatype argument,  how could I do that?

Any thoughts?


--Junchao Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-fortran/attachments/20140513/692e9ebc/attachment.html>

More information about the mpiwg-fortran mailing list