[MPI3 Fortran] ASYNC attribute
Bill Long
longb at cray.com
Wed May 6 15:58:57 CDT 2009
Jeff Squyres wrote:
> On May 6, 2009, at 9:21 AM, Bill Long wrote:
>
>> > 2. Yes, the MPI_Request argument to MPI_Wait is inout.
>>
>> Question: Is MPI_Request actually a Fortran derived TYPE, or is it just
>> a KIND value for an INTEGER? I had thought that all of these flag and
>> handle-like arguments were treated as integers in the Fortran interface.
>> Making it an actual defined type would have some advantages, but would
>> that cause a problem with existing codes?
>>
>
>
> In MPI-1 and MPI-2, they're INTEGERs. But we're toying with the idea
> of using ISO_C_BIND for MPI-3 and therefore tying the MPI_Request in
> Fortran to be whatever it is in C (likely either the equivalent of a C
> int or a pointer).
>
OK. Ignoring the compatibility problem mentioned above, the advantage of
a structure is the ability to add extra components. If your interface
uses dimension(..) for the buf argument, then it is passed as a (pointer
to) a descriptor. Copy-in/copy-out would never occur. The Isend/Irecv
routines could be written as wrappers, and use two extra pointer
elements in the request structure to hold the addresses of the original
descriptor and the local temp. This would allow a safe copy-in into the
low level C transfer routine that requires contiguous arguments. The
copy-out step would occur inside the MPI_Wait wrapper using the
information delivered in the request struct. I can provide a detailed
scheme if you like. Such wrappers would solve the copy-in/copy-out
problem by allowing it to be done safely, rather than prohibiting it.
Cheers,
Bill
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
More information about the mpiwg-fortran
mailing list