[Beowulf] mutex (remote memory access) question for MPI-2
gropp at mcs.anl.gov
Mon Aug 1 07:05:27 PDT 2005
At 12:49 PM 7/31/2005, Plinius Frobenius wrote:
>I've red through the chapter in "Using MPI-2" about mutexes.
>Suppose that you know in advance that only one cumputer (say node y) can
>access the memory-window on node x (except node x itself).
>How should your mutex-code look like (you still need a mutex, since both x
>and y can access the memory)? (since you won't need the entire
>"tree-mutex-code" provided by Rajeev Thakur, I guess, since there are only
>two processes able to acces the memory...). I haven't enough experience
>yet to find this one by myself, and really need it for the program I'm
You don't need mutexes for this. Simply use MPI_Win_lock with a mode of
MPI_LOCK_EXCLUSIVE, followed by either MPI_Put, MPI_Get, or MPI_Accumulate
(from node y) or simple language access on node x (e.g., *a = 1; where a
points into node x's memory window)., followed by MPI_Win_unlock.
>Thanks for any ideas/hints/help...
>Beowulf mailing list, Beowulf at beowulf.org
>To change your subscription (digest mode or unsubscribe) visit
More information about the Beowulf