90 likes | 252 Views
TreadMarks. CS 498LVK Hassan Jafri. Agenda. The DSM Architecture The Parallel Programming Model. Programming Primitives. Shared Memory Allocation Tmk_malloc()/Tmk_free(…) Synchronization Tmk_barrier() Tmk_lock_acquire(…)/Tmk_lock_free(…) Others Tmk_startup(…), Tmk_exit(…)
E N D
TreadMarks CS 498LVK Hassan Jafri
Agenda The DSM Architecture The Parallel Programming Model
Programming Primitives • Shared Memory Allocation • Tmk_malloc()/Tmk_free(…) • Synchronization • Tmk_barrier() • Tmk_lock_acquire(…)/Tmk_lock_free(…) • Others • Tmk_startup(…), Tmk_exit(…) • Tmk_nprocs, Tmp_proc_id • Jacobi example
DSM Architecture • Big Issues • Memory Model • Sequential Consistency (example IVY) • Total Order on all memory accesses • Read will return the last thing written • Read fault, Write faults • False sharing leading to “ping-pong” effect • HUGE OVERHEAD
DSM Architecture • Big Issues • Memory Model • Release Consistency (TMK) • Latest possible time when shared memory updates mist be visible • Provide sufficient synchronization to avoid races that would make updates unnecessary until synchronization • Formally: • Acquire: Departure from barrier or lock acquire • Release: Arrival at barrier or lock release
DSM Architecture • Big Issues • Memory Model • Release Consistency (TMK) • Lazy Release Consistency (TMK) • Eager Release Consistency
DSM Architecture • Big Issues • Memory Model • Multiple Writer Protocol • P1 and P2 write to the same page • Page write-protected, first write access will generate fault and a twin of the page will be created • At barrier, P1 and P2 will invalidate that pages • Next time P1 and P2 access the page, diffs will be exchanged • What if P1 and P2 modify overlapping portions of the page? Learn how to program
Performance Comparison • TMK vs. MPI for Jacobi • TMK vs. MPI for FFT