[MPICH] order of one-sided communication

William Gropp gropp at mcs.anl.gov
Thu Feb 22 08:21:06 CST 2007


No, the MPI standard is very clear that both the Get and Accumulate  
operations are nonblocking and may not reference the same storage  
locations in the same access epoch.

This is a limitation of the MPI standard.  For this particular  
operation (fetch and increment), there is an implementation in our  
book, Using MPI2, and we distribute code that implements this  
operation.  For more general read-modify-write operations, it can be  
very difficult to create these operations.

Bill

On Feb 21, 2007, at 7:21 PM, Hu Zhan wrote:

> Hi,
>
> I'm wondering if it's guaranteed that the following MPI_Get will  
> access
> the target before MPI_Accumulate updates the same target (which  
> appears
> to be so on my cluster)
>
>   ...
>   int l, one = 1;
>   MPI_Win_lock(MPI_LOCK_EXCLUSIVE, 0, 0, win);
>   MPI_Get(&l, 1, MPI_INT, 0, 0, 1, MPI_INT, win);
>   MPI_Accumulate(&one, 1, MPI_INT, 0, 0, 1, MPI_INT, MPI_SUM, win);
>   MPI_Win_unlock(0, win);
>   ...
>
> The MPICH2 standard seems to suggest that the order will not be
> deterministic. If so, is there a way to ensure the order without
> bracketing each function in a pair of MPI_Win_lock & MPI_Win_unlock
> (because I don't want other processes to access and/or update the
> target before a process finishes accessing and updating the same
> target)?
>
> Thanks!
>
> Hu
>




More information about the mpich-discuss mailing list