[MPI3 Fortran] Proposing changes to Fortran 2008
Aleksandar Donev
donev1 at llnl.gov
Thu Mar 27 16:04:31 CDT 2008
On Thursday 27 March 2008 13:49, Hubert Ritzdorf wrote:
> Yes, if derived MPI datatypes are used.
C_LOC should be used for MPI_Get_address to solve the issue you described.
Then the offsets are correct and even if there is copy in/out the base is
right and the offsets would be right so there should be no problem.
> The requirement of target attribute is not really acceptable from the
> MPI standard; for example I would
> expect that that MPI_Isend (C_LOC(buf(1000:2000)), ...) would not be
> allowed.
You can do MPI_Isend (C_LOC(buf(1000)), ...) if you'd like...the C standard
guarantees that the address of buf(1000:2000) and buf(1000) are the same.
C_LOC(buf(1000:2000)) is not allowed in Fortran 2003, but it is in Fortran
2008. We formalized the concept of "simply-contiguous array" in Fortran 2008
and your buf(1000:2000) is such an array and allowed in C_LOC (I was the one
that proposed that, actually). It would be easy for compiler vendors to add
this to compilers even without implementing anything else in Fortran 2003.
Best,
Aleks
More information about the mpiwg-fortran
mailing list