(j3.2006) MPI usage problems in Fortran
Craig Rasmussen
crasmussen
Fri Mar 21 11:46:05 EDT 2008
On Mar 20, 2008, at 11:10 AM, Aleksandar Donev wrote:
>> As Bill says, this is very much like asynchronous I/O in
>> Fortran and should be treated similarly.
> Yes, but if only ASYNCHRONOUS were itself treated consistently, we
> could have
> something to work from...
>
>> Perhaps it would be helpful
>> to have the ASYNCHRONOUS attribute apply to procedures, i.e.,
>> ASYNCHRONOUS FUNCTION MPI_Isend(...)
> And what exactly does this mean?
A description of one problem (text partially borrowed from MPI
documentation at Argonne):
-----------------------------
To prevent instruction reordering or the allocation of a buffer in a
register there are two possibilities in portable Fortran code:
The compiler may be prevented from moving a reference to a buffer
across a call to an MPI subroutine by surrounding the call by calls
to an external subroutine with the buffer as an actual argument.
call MPI_IRECV(buf,...,req)
....
call MPI_WAIT(rec,...)
call DD(buf)
with the separately compiled
subroutine DD(buf)
integer buf
end
------------------------------
So with appropriate wording in the standard, could something like the
following be made to work?
interface
ASYNCHRONOUS function MPI_Irecv(...) ! similar effect as
asynchronous specifier (9.6.2.5) and
ASYNCHRONOUS function MPI_Wait(...) ! any statement to
these functions involve asynchronous operations
end interface
integer, ASYNCHRONOUS :: buf(*) ! ASYNCHRONOUS rather than TARGET
to limit the effect to local scoping unit
call MPI_Irecv(C_LOC(buf),...,req) ! C_LOC modified to include
ASYNCHRONOUS variables
....
call MPI_Iwait(req,...) ! last asynchronous function seen
in this scoping unit so optimizations can be turned back on?
Regards,
Craig
More information about the J3
mailing list