Docsity

Coherence Synchronization - Parallel Computing - Lecture Slides, Slides of Parallel Computing and Programming

Toggle sidebar
bg1
Parallel Computing Platforms:
Shared Memory Coherence & Synchronization
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Coherence Synchronization - Parallel Computing - Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Parallel Computing Platforms:

Shared Memory Coherence & Synchronization

2 Topics for Today

  • Cache coherence —definition —update vs. invalidate —snoopy vs. directory —protocol examples
  • Shared-memory synchronization —approaches —primitives —operations - initialize, signal, acknowledge, reinitialize —techniques - sense switching - paired data structures - avoid interconnect traffic due to spin waiting (local spinning)

Approaches to Cache Coherence

  • Hardware —caches implement coherence protocols to ensure that data appears globally consistent —common in systems today
  • Software —relies on compiler and/or runtime support - may or may not have help from the hardware —must be conservative to be safe - assume the worst about potential memory aliases —of increasing interest - concerns about cost of coherence in joules - scales well for microprocessors based on “tiled” designs Intel Scalable Cloud Computer (SCC), 2010 4

y = 2 y = 2 y = 2 memory y = 2 5 Cache Coherence Protocols

When changing a variable’s value: invalidate or update all copies

Update protocol Invalidate protocol y = 2 y = 2 y = 2 P load y P load y memory y = 4 y = 4 y = 4 P write 4, y memory y = 2 y = 2 y = 2 P load y P load y memory y = 2 y = 2 memory y = 4 P write 4, y

7 Using Invalidate Protocols

  • Each copy of a data item is associated with a state
  • Example set of states: modified, exclusive, shared, or invalid —modified: only one copy exists - a write need not generate any invalidates —exclusive: only one copy exists - a write need not generate any invalidates —shared: multiple valid copies of the data item - a write needs to generate an invalidate —invalid: data copy is invalid - a read generates a data request and updates the state

8 State Diagram for 4-state Invalidate Protocol

MESI states: Modified, Exclusive, Shared, and Invalid

Figure credit: http://lwn.net/images/cpumemory/cpumemory.13.png

M E S I

M

E

S

I

10 Operation of Snoopy Caches

  • Once a datum is tagged modified or exclusive —all subsequent operations can be performed locally in cache —no external traffic needed
  • If a data item is read by a number of processors —transitions to the shared state in all caches —all subsequent read operations become local
  • If multiple processors read and update data —generate coherence requests on the bus —bus is bandwidth limited: imposes a limit on updates per second

11 The Cost of Coherence

  • Snoopy caches —each coherence operation is sent to all processors —hurts scalability
  • Why not send coherence requests to only those processors

that need to be notified?

Some Directory Implementation Alternatives

  • Bit vector —presence bit for each cache line along with its global state
  • Pointer set —limited set of pointers (node ids) - less overhead than full map —issue: widespread sharing 13

14 Performance of Directory-based Schemes

  • Bits to store the directory may add significant overhead —think about scaling to many processors - data bits per cache block vs. presence bits per cache block
  • Underlying network must carry all coherence requests
  • Directory becomes a point of contention —distributed directory schemes are necessary for scalability

SGI Altix UV (2010)

**- System overview: 32-2048 cores; cache coherent single system image

  • Coherence** — directory-based coherence - each 128B cache line has an entry in a directory - directories distributed among the compute/memory blade nodes, like the data homes - directory size = 1/16 main memory - line states in a directory unowned: when a line is not cached exclusive: when only one processor has a copy shared: when more than one processor has a copy - bit vector indicates which caches may contain a copy — invalidation-based protocol: write invalidates copies & acquires exclusive ownership 16 rack unit (16 nodes) node blade Figure credits: http://bit.ly/hLX85a

SGI Altix UV (2010) Figure credits: http://bit.ly/hLX85a 17 node blade

SGI Altix UV (2010) 19 rack unit (16 nodes) Figure credits: http://bit.ly/hLX85a

Evolution of Node Interconnects 20 Shared front-side bus (through 2004) Dual independent buses (circa 2005) Intel Quickpath interconnect (2009 - present) Figure credits: Introduction to Intel QuickPath Interconnect in Weaving High Performance Multiprocessor Fabric, Robert A. Maddox, Gurbir Singh, and Robert J. Safranek, Intel Press