SAS Synchronization

The goal of this programming problem is to implement various synchronization primitives for shared address space programs. In particular, you will implement different lock and barrier synchronization algorithms for the LOCK/UNLOCK and BARRIER calls in the m4 macros API. For this purpose, you may need to use inline assembly code to get access to atomic assembly instructions. You can implement the assignment on any shared memory parallel system. The suggested platform is the shared memory platofrm of assignment 2. 

SC hardware shared memory platform

  1. Implement a library with the following lock synchronization algorithms: 
  2. Implement a library with the following barrier synchronization algorithms: 
  3. Modify c.m4.linux to include macros for the locks/barriers you have implemented. You will also need to adjust the types of the lock and barrier variables. The user should be able to choose among lock/barrier algorithms by using a Makefile parameter.
  4. Use the SAS LU, WaterNsquared (from SPLASH-2) and your matrix multiply (MM) programs of the previous assignment to measure: 

(extra credit) RC SC hardware shared memory platform

Repeat 1-4 above assuming the underlying system is RC. In this case you have no base atomic operations to use (why? could this be different?), but you may use basic memory synchronizing primitives (e.g. memory barriers), provided by the platform:

  1. Implement locks: spin locks, mcs 
  2. Implement barriers: counter-based, [Extra credit: tree barriers] 
  3. Use the SAS LU, WaterNsquared (from SPLASH-2) and your matrix multiply (MM) programs of the previous assignment to measure: 

References

Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. J. M. Mellor-Crummey and M. L. Scott. ACM Trans. on Computer Systems, February 1991. 

Submission

Turn in (by mail to b i l a s @ c s d . u o c . g r) a tar file that contains your solutions and a README file stating assumptions or special features.