[MPI3 Fortran] ASYNC attribute

Bill Long longb at cray.com
Wed May 6 08:21:52 CDT 2009



Jeff Squyres wrote:
> 1. How does the MPI_Wait know that it can have no code motion with 
> respect to buf?

The declaration for buf should have been REAL,ASYNC ...... 
(ASYNC_EXTERNAL was an earlier spelling).  Motion of code involving an 
ASYNC variable would be suppressed across any call except to an 
intrinsic procedure that is known by the compiler to be "safe". 

>
> 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?

Cheers,
Bill


>
>
> On May 5, 2009, at 7:45 PM, Craig Rasmussen wrote:
>
>> I'm at the WG5 Fortran standards meeting and I think we've made
>> significant advances regarding the MPI-3 Fortran API.  We are
>> discussing adding a new variable attribute, ASYNC.  I'd like to get
>> feedback from the MPI-3 Fortran working group on these possible changes.
>>
>> ASYNC implies that a variable is potentially active in asynchronous
>> operations outside of Fortran.  The use of this new attribute should
>> give the compiler enough information to inhibit optimizations similar
>> to inhibitions involved in Fortran asynchronous I/O, specifically
>> copyin/copyout and code motion.  The compiler will likely have to
>> inhibit code motion regarding any use of a variable with the ASYNC
>> attribute and procedures other than intrinsics.  The affect is similar
>> to the use of the volatile attribute (but not regarding loads and
>> stores).
>>
>> Usage is outlined below:
>>
>> ----------------
>>
>> real, ASYNC_EXTERNAL :: buf(100,100)
>> type(MPI_Request) :: request
>>
>> ! initiate data transfer of boundary
>> CALL MPI_IRecv(buf(:,1),...,request,...)  ! no copyin/copyout will
>> happen
>>
>> ! do work on interior of the buffer while transfer is in progress
>> CALL UPDATE_INTERIOR(buf)  ! dummy arg should have ASYNC attribute
>>
>> ! wait for the communication to finish
>> CALL MPI_Wait(request,...)   ! no code motion allowed with respect to
>> buf
>>
>> ! finish work on buffer boundaries
>> CALL UPDATE_BOUNDARIES(buf)  ! should copyin/copyout be allowed here?
>>
>> ----------------
>>
>> So how does this look?  Anything we've left out?  I'm also including
>> the interface definition.
>>
>> - craig
>>
>> ----------------
>>
>> interface
>>
>> SUBROUTINE MPI_Irecv(buf, count, datatype, source, tag, comm, request,
>> err) BIND(C, name="MPI_Irecv")
>>     import MPI_Datatype, MPI_Comm, MPI_Request
>>     TYPE(*), DIMENSION(..), ASYNC   :: buf
>>     integer, value,     intent(in)  :: count
>>     type(MPI_Datatype), intent(in)  :: datatype
>>     integer, value,     intent(in)  :: source
>>     integer, value,     intent(in)  :: tag
>>     type(MPI_Comm),     intent(in)  :: comm
>>     type(MPI_Request),  intent(out) :: request
>>     integer,            intent(out) :: err
>> END SUBROUTINE MPI_Irecv
>>
>> SUBROUTINE MPI_Isend(buf, count, datatype, dest, tag, comm, request,
>> err) BIND(C, name="MPI_Isend")
>>     import MPI_Datatype, MPI_Comm, MPI_Request
>>     TYPE(*), DIMENSION(..), ASYNC   :: buf
>>     integer, value,     intent(in)  :: count
>>     type(MPI_Datatype), intent(in)  :: datatype
>>     integer, value,     intent(in)  :: dest
>>     integer, value,     intent(in)  :: tag
>>     type(MPI_Comm),     intent(in)  :: comm
>>     type(MPI_Request),  intent(out) :: request
>>     integer,            intent(out) :: err
>> END SUBROUTINE MPI_Isend
>>
>> SUBROUTINE MPI_Wait(request, status, err) BIND(C, name="MPI_Wait")
>>     import MPI_Request, MPI_Status
>>     type(MPI_Request), intent(in)  :: request  !        inout?
>>     type(MPI_Status),  intent(out) :: status
>>     integer,           intent(out) :: err
>> END SUBROUTINE MPI_Wait
>>
>> end interface
>>
>>
>>
>>
>>
>> _______________________________________________
>> mpi3-fortran mailing list
>> mpi3-fortran at lists.mpi-forum.org
>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran
>
>

-- 
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