[mpich-discuss] MCS lock and MPI RMA problem

Balaji, Pavan balaji at anl.gov
Mon Mar 13 23:50:02 CDT 2017


> On Mar 13, 2017, at 1:43 PM, Ask Jakobsen <afj at qeye-labs.com> wrote:
> I have discovered that the code from the book in mcs-lock.c deviates from "High-Performance Distributed RMA Locks" pseudo code (see Listing 3 in paper) and the original MCS paper "Algorithms for scalable Sync on shared memory multiprocessors". If I add to the original mcs-lock.c code
> 
> lmem[nextRank]=-1;

This change will be incorrect.

Apart from the fact that you are modidying the window outside of the epoch (which is not allowed), it'll conflict with the MODE_NOCHECK hint.  With MODE_NOCHECK, you are promising that the window buffer will not be accessed without shared-mode RMA routines (PUT/GET to different locations or atomic operations only).  The reason I suggested that optimization was because all accesses to lmem were through RMA and the algorithm was already ensuring atomicity.  If you change lmem through a direct store operation, that hint will no longer be valid.

I think you should ignore what the paper says and reason through the algorithm yourself.  That's causing more of a distraction than help at this point.

  -- Pavan

_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list