Re: [MPI3 Fortran] MPI non-blocking transfer
Hi, Thanks. Can you clarify why MPI would be putting anything into the buffer engaged in the MPI_Isend? As far as I understand, the "silly" example mentioned below would cause a problem only in this case. Imagine that MPI_Isend does not touch the buffer at all. Will anything change in this scenario? Best regards. Alexander -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Aleksandar Donev Sent: Tuesday, February 10, 2009 7:06 AM To: Rolf Rabenseifner Cc: [email protected]; [email protected]; [email protected] Subject: Re: [MPI3 Fortran] MPI non-blocking transfer Hi,
I do not understand, why the DD trick should not work together in the cases of MPI_Isend + MPI_Wait + DD (to prohibit overwriting before MPI_Wait) I do not wish to rehash all the previous Fortran committee discussions, but, let me give the simplest, albeit contrived, example. The Fortran standard is designed so as to permit the compiler great freedom in optimization, for example, by giving the compiler the freedom to assume that a variable does not get modified behind its back. The permitted "optimizations" (code transformations) include, among other things, perfectly useless/harmless code motion:
call MPI_Isend(buffer,...) ... call DD(buffer) the compiler *may* transform into intermediate code that does: call MPI_Isend(buffer,...) ... temp=buffer(1) buffer(1)=temp ... call DD(buffer) which will be broken since during the silly temp motion buffer(1) may change and then be overwritten. This is a silly example, but the point here is that there exist transformations that are rare, but allowed, and can cause parts of buffer to be copied to temporary storage and then back, overwritting what MPI is putting there. The only way to *properly* prevent that is to tell the compiler what is going on, rather than trying to *trick* it. Best, Aleks -- Aleksandar Donev, Ph.D. Lawrence Postdoctoral Fellow @ LLNL High Performance Computational Materials Science and Chemistry E-mail: [email protected] Phone: (925) 424-6816 Fax: (925) 423-0785 Address: P.O.Box 808, L-367, Livermore, CA 94551-9900 Web: http://cherrypit.princeton.edu/donev _______________________________________________ mpi3-fortran mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran --------------------------------------------------------------------- Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen Germany Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer Registergericht: Muenchen HRB 47456 Ust.-IdNr. VAT Registration No.: DE129385895 Citibank Frankfurt (BLZ 502 109 00) 600119052 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
participants (1)
-
Supalov, Alexander