(j3.2006) MPI usage problems in Fortran

Jim Xia jimxia
Tue Mar 18 14:48:17 EDT 2008


j3-bounces at j3-fortran.org wrote on 03/18/2008 02:35:57 PM:

> 
> 
> Craig Rasmussen wrote:
> > A problem was described to me at the MPI Forum meeting last week. 
> > Using split-phase communication (asynchronous) the user can call send 
> > on a buffer, do computation, then call wait before reusing the 
> > buffer.  The sequence is:
> >
> >
> >        A = 3
> >        call MPI_Isend(A, ...., request, ...)
> >        ! do computation not involving A
> >        call MPI_Wait(request, ...)
> >
> > The problem is that the way the interfaces are currently defined, the 
> > compiler can't know that MPI_Isend has retained a pointer to A that 
> > it doesn't release until after the MPI_Wait call. 
> 
> Most of the time that is not really a problem.  If the "not involving A" 

> claim is correct, then you only have to worry about A being deallocated 
> by the compiler.  This brings up the real problem with these routines. 
> If A is an array section that is not contiguous, for example, the 
> compiler will make a local copy, pass the address of the copy, and then 
> possibly delete the copy (which is associated with the pointer inside 
> Isend) before the asynchronous Isend routine is done with the data. 
> Thus, the real concern is to make sure the compiler does not generate 
> copy-in/copy-out code for the buffer argument.  Apart from that, bad 
> things should not happen.
> 
> Cheers,
> Bill

Just add to Bill's comments, a TARGET attribute will not solve the memory 
deallocation problem if copy-in/copy-out occurs.  The attribute simply 
marks an entity having the ability to appear in the RHS of a data pointer 
assignment.

Cheers,

Jim Xia

RL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444  Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20080318/49d81c1c/attachment.html 



More information about the J3 mailing list