




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























Prof. Onur Mutlu Carnegie Mellon University
Required
Lamport, “How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs,” IEEE Transactions on Computers, 1979
Recommended
Gharachorloo et al., “Memory Consistency and Event Ordering in Scalable Shared-Memory Multiprocessors,” ISCA 1990. Charachorloo et al., “Two Techniques to Enhance the Performance of Memory Consistency Models,” ICPP 1991. Ceze et al., “BulkSC: bulk enforcement of sequential consistency,” ISCA 2007.
Loosely coupled multiprocessors
No shared global memory address space Multicomputer network Network-based multiprocessors Usually programmed via message passing Explicit calls (send, receive) for communication
Tightly coupled multiprocessors
Shared global memory address space Traditional multiprocessing: symmetric multiprocessing (SMP) Existing multi-core processors, multithreaded processors Programming model similar to uniprocessors (i.e., multitasking uniprocessor) except Operations on shared data require synchronization
Shared memory synchronization
Locks, atomic operations
Cache consistency
More commonly called cache coherence
Ordering of memory operations
What should the programmer expect the hardware to provide?
Resource sharing, contention, partitioning
Communication: Interconnection networks
Load imbalance
Synchronization: Operations manipulating shared data cannot be parallelized Locks, mutual exclusion, barrier synchronization Communication: Tasks may need values from each other
Load Imbalance: Parallel tasks may have different lengths
Due to imperfect parallelization or microarchitectural effects
Resource Contention: Parallel tasks can share hardware resources, delaying each other Replicating all resources (e.g., memory) expensive
Little difficulty if parallelism is natural
“Embarrassingly parallel” applications Multimedia, physical simulation, graphics Large web servers, databases?
Difficulty is in
Getting parallel programs to work correctly Optimizing performance in the presence of bottlenecks
Much of parallel computer architecture is about
Designing machines that overcome the sequential and parallel bottlenecks to achieve higher performance and efficiency Making programmer’s job easier in writing correct and high- performance parallel programs
Operations: A, B, C, D
In what order should the hardware execute (and report the results of) these operations?
A contract between programmer and microarchitect
Specified by the ISA
Preserving an “expected” (more accurately, “agreed upon”) order simplifies programmer’s life Ease of debugging; ease of state recovery, exception handling
Preserving an “expected” order usually makes the hardware designer’s life difficult Especially if the goal is to design a high performance processor: Load-store queues in out of order execution
Specified by the von Neumann model
Sequential order
Hardware executes the load and store operations in the order specified by the sequential program
Out-of-order execution does not change the semantics
Hardware retires (reports to software the results of) the load and store operations in the order specified by the sequential program
Advantages: 1) Architectural state is precise within an execution. 2) Architectural state is consistent across different runs of the program Easier to debug programs
Disadvantage: Preserving order adds overhead, reduces performance
Each processor’s memory operations are in sequential order with respect to the “thread” running on that processor (assume each processor obeys the von Neumann model)
Multiple processors execute memory operations concurrently
How does the memory see the order of operations from all processors? In other words, what is the ordering of operations across different processors?
Ease of debugging
It is nice to have the same execution done at different times have the same order of memory operations
Correctness
Can we have incorrect execution if the order of memory operations is different from the point of view of different processors?
Performance and overhead
Enforcing a strict “sequential ordering” can make life harder for the hardware designer in implementing performance enhancement techniques (e.g., OoO execution, caches)
Programmer needs to make sure mutual exclusion (synchronization) is correctly implemented We will assume this But, correct parallel programming is an important topic Reading: Dijkstra, “Cooperating Sequential Processes,” 1965. http://www.cs.utexas.edu/users/EWD/transcriptions/EWD01xx/EWD 123.html See Dekker’s algorithm for mutual exclusion
Programmer relies on hardware primitives to support correct synchronization
If hardware primitives are not correct (or unpredictable), programmer’s life is tough
If hardware primitives are correct but not easy to reason about or use, programmer’s life is still tough
Assume P1 is in critical section. Intuitively, it must have executed A, which means F1 must be 1 (as A happens before B), which means P2 should not enter the critical section.