[MPIWG Fortran] Data type of F08 subarray

Rolf Rabenseifner rabenseifner at hlrs.de
Tue May 13 10:20:45 CDT 2014


Dear Junchao,

MPI-3.0 p25:7-8 describes only communication with language type
of the buffer argument matches to the MPI datatype used
in the datatype argument.
Same p83:36-37.

Therefore, the answer is no and the compiler cannot detect
a mismatch beteen language buffer specification and
MPI datatype specification.

I hope my answer could help.

Best regards
Rolf


----- Original Message -----
> From: "Junchao Zhang" <jczhang at mcs.anl.gov>
> To: "MPI-WG Fortran working group" <mpiwg-fortran at lists.mpi-forum.org>
> Sent: Tuesday, May 13, 2014 5:08:30 PM
> Subject: [MPIWG Fortran] Data type of F08 subarray
> 
> 
> 
> 
> 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?
> 
> Thanks
> 
> --Junchao Zhang
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran

-- 
Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner at hlrs.de
High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530
University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832
Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner
Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)



More information about the mpiwg-fortran mailing list