[MPI3 Fortran] [Fwd: Library-based ASYNCHRONOUS I/O and SYNC MEMORY]
Hubert Ritzdorf
ritzdorf at it.neclab.eu
Tue Sep 9 15:27:24 CDT 2008
Iain Bason wrote:
> [Just to introduce myself to those who don't know me, I am a member of
> the Sun Fortran compiler development team. I meant to join this email
> alias a while ago, but only just got around to it.]
>
> On Sep 7, 2008, at 6:24 AM, Hubert Ritzdorf wrote:
>
>> Hi,
>>
>> also I think that a begin and end section is required and the
>> compiler needs
>> full control. One possibility would be:
>>
>> !cdir noopt_begin{buffer1, buffer2, buffer3)
>> ...
>> !cdir noopt_end (buffer1)
>> ...
>> !cdir noopt_end (buffer1, buffer2)
>>
>> which simply turns off any optimization for the buffers
>> "buffer1, buffer2, buffer3" within the block defined by
>> "begin" and "end" such as the Fortran compiler knows
>> the buffers "buffer1, buffer2, buffer3". The user program
>> is responsible to provide enough Fortran internal info
>> on the buffers.
>
> Why is that necessary? Which optimizations do you think need to be
> disabled?
>
> So far as MPI asynchronous send/receive are concerned, I don't see any
> reason to disable any optimizations aside from those that move access
> to the buffer across a call to MPI_ISEND/MPI_IRECV/MPI_WAIT. What you
> are proposing is going to have a much bigger impact on performance.
>
>
One old example was
! ==============
subroutine test_send ()
integer:: buffer (10000)
integer:: i, ierror, req
do i = 1, 10000
buffer (i) = i
end do
call MPI_Isend (buffer, 10000, MPI_INTEGER, ..., req, ierror)
... (statements without access to buffer)
call MPI_Wait (req)
return
end
! =============
In such a case, Fortran compiler often removes "buffer" after the MPI_Isend.
The MPI_Wait, which may really transfer "buffer", can fail since "buffer"
was already removed. The idea was to inform the compiler by any kind
of begin/end section that "buffer" is still in use.
Similar examples were
(*) the compiler might move assignment statements to "buffer"
that are located after the MPI_Wait before the MPI_Wait since
the compiler doesn't see that "buffer" is used in MPI_Wait
(*) other examples were optimizations where are held in registers
and which couldn't be accessed by one sided calls.
It was clear to us that you can add in the example above:
call dummy_subroutine (buffer)
after the MPI_Wait, in order to inform the compiler that
"buffer" is still in use. But we were looking for a different
approach in order to solve problems mentioned above and
similar ones.
Best regards
Hubert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-fortran/attachments/20080909/90aa496e/attachment-0001.bin>
More information about the mpiwg-fortran
mailing list