Skip to main content

4.3 Parallel Processing & Multiprocessor Architectures

Parallel processing exploits concurrency at multiple levels — from instruction-level parallelism within a single CPU to massive data parallelism across hundreds of processing elements. This chapter covers vector processing, array processors, multiprocessor architectures, interconnection networks, synchronization mechanisms, cache coherence protocols, and superscalar processor design.

Learning Objectives

  • Explain the levels of parallelism in computer systems (bit, instruction, data, task).
  • Describe vector processor and array processor architectures with appropriate diagrams.
  • Compare multiprocessor interconnection structures: bus, crossbar, multistage, and hypercube.
  • Analyze inter-processor communication methods including shared memory and message passing.
  • Evaluate cache coherence protocols, particularly the MESI snoopy protocol.
  • Describe superscalar processor design principles and out-of-order execution.

Prerequisites

Before studying this chapter, ensure you have reviewed the following topics:

1. Introduction to Parallel Processing

Performance scalability of single-processor architectures is constrained by three physical limits: the **memory wall** (memory latency gap), the **ILP wall** (diminishing returns of instruction-level parallelism), and the **power wall** (thermal dissipation limits of CMOS technology). To continue scaling compute performance, architectures exploit **concurrency** across multiple layers:

  • Bit-Level Parallelism: Increasing word size (e.g., from 32-bit to 64-bit ALUs) to reduce instruction counts for large calculations.
  • Instruction-Level Parallelism (ILP): Overlapping instructions using pipelining and superscalar execution.
  • Data-Level Parallelism (DLP): Operating on arrays of data simultaneously using vector or array processing.
  • Task-Level Parallelism (TLP): Running independent thread processes concurrently on multiple physical cores or CPUs.

The speedup limit of parallelizing any program is governed by **Amdahl's Law**:

$$S = \frac{1}{(1-f) + \frac{f}{N}}$$

Equation 4.3.1: Amdahl's Law, where f is the fraction of the program that is parallelizable, and N is the number of parallel processing elements.

2. Vector and Array Processing

Both vector and array processors utilize data-level parallelism (SIMD) to accelerate mathematical matrix computations.

Vector Processing

Vector processors operate on entire arrays of data using a single instruction (e.g., adding two vectors $A+B$ of length 64). Rather than replicating ALUs, a vector processor uses deeply pipelined **vector functional units**. Operands are streamed continuously from high-speed **vector registers** into the execution pipeline, producing one vector element result per clock cycle once the pipeline is full.

Array Processors

Unlike vector processors which pipeline operations, **Array Processors** utilize a spatial array of independent **Processing Elements (PEs)**, each with its own local memory, controlled by a central **Master Control Unit (MCU)**. The MCU fetches and decodes instructions, broadcasting the control signals to all PEs. All PEs execute the same instruction on different local data elements in parallel.

3. Multiprocessor System Architectures

A multiprocessor system contains two or more processing units sharing memory and input-output systems:

  • Shared Memory (Tightly Coupled): Processors share a single, global physical address space. Communication occurs implicitly through shared memory reads and writes. These systems are classified as **Symmetric Multiprocessors (SMP)** (uniform memory access time) or **Non-Uniform Memory Access (NUMA)** (memory access time varies depending on physical distance to memory bank).
  • Distributed Memory (Loosely Coupled): Each processor has its own local memory and address space. Communication occurs explicitly by passing messages over a message-passing network interface.
Tightly Coupled (Shared Memory) CPU 1 CPU 2 CPU 3 Shared Memory Loosely Coupled (Distributed Memory) CPU 1 + Mem 1 CPU 2 + Mem 2 Message Passing Network
Figure 4.3.1: Multiprocessor System Models. Tightly coupled systems connect CPUs to a shared global memory, while loosely coupled systems isolate local memories and communicate via message-passing networks.

4. Interconnection Structures

To link multiple processors with memory modules or message interfaces, systems utilize different interconnection network topologies:

  • Time-Shared Common Bus: All processors and memory share a single communication bus. Cost is minimal ($O(1)$), but bandwidth limits performance as processor counts scale due to bus contention.
  • Crossbar Switch Matrix: Provides a dedicated, separate switch at every path junction between $N$ processors and $M$ memory modules. Cost is high ($O(N \times M)$), but contention only occurs if two processors target the exact same memory module simultaneously.
  • Multistage Interconnection Network (MIN): Balances cost and performance using smaller $2\times2$ crossbar switches organized in cascading stages. An example is the **Omega Network**, which uses a shuffle-exchange wiring pattern. An $N \times N$ network requires: $$\text{Stages} = \log_2 N, \quad \text{Switches per Stage} = \frac{N}{2}$$
  • Hypercube Topology: An $n$-dimensional hypercube connects $N = 2^n$ nodes. Each node represents a vertex of an $n$-dimensional cube and is connected to exactly $n$ neighbor nodes. The node address is represented by binary labels, and links exist only between nodes whose binary addresses differ by exactly 1 bit (Hamming distance of 1).

5. Inter-processor Arbitration & Bus Contention

When multiple processors share a common bus, an **Arbitration Circuit** must resolve conflicting requests:

  • Daisy Chain (Serial) Arbitration: A single bus grant signal is routed serially through all master modules. The first processor in the chain requesting the bus intercepts the signal, preventing downstream processors from accessing the bus. This circuit is cheap ($O(1)$ lines) but assigns static priority based on physical location, introducing a single point of failure.
  • Parallel Arbitration: Each processor has dedicated bus request ($BR_i$) and bus grant ($BG_i$) lines connected to a central arbiter. The arbiter resolves conflicts using dynamic algorithms (e.g., Round Robin or Rotating Priority).

6. Cache Coherence & The MESI Snoopy Protocol

In shared-memory multiprocessors, each processor features its own local cache. If multiple processors cache the same memory block $X$, and processor $P_1$ writes a new value to $X$, the other caches contain stale data. This is the **Cache Coherence Problem**.

To maintain consistency, processors implement **Snoopy Protocols**, where cache controllers monitor (snoop) the shared bus to detect writes to cached memory blocks.

The MESI snoopy protocol defines 4 states for a cache block:

  • M (Modified): The block is present only in the local cache and contains modified, dirty data that differs from main memory. The local cache is responsible for writing it back.
  • E (Exclusive): The block is present only in the local cache, containing clean data that matches main memory.
  • S (Shared): The block is present in multiple caches, containing clean data matching main memory.
  • I (Invalid): The block does not contain valid data.
M E S I Remote Write Invalidation
Figure 4.3.2: MESI Cache Coherence Protocol State Transition Diagram. The dotted path shows invalidation: a remote write on the bus transitions a block from Shared (S) or Exclusive (E) to Invalid (I).

7. Superscalar Processors & Instruction Concurrency

While pipelining overlaps instructions sequentially, a **Superscalar Processor** exploits Instruction-Level Parallelism (ILP) by executing multiple instructions *in parallel during the same clock cycle*.

A superscalar CPU features multiple parallel execution units (multiple ALUs, FPUs, and Load/Store units) and an instruction fetch unit that retrieves multiple instructions per cycle.

To maximize ALU utilization, modern superscalar CPUs implement **Out-of-Order (OoO) Execution**. Instructions are fetched and decoded in-order, placed in **Reservation Stations**, executed out-of-order as soon as their data operands become available, and finally retired in-order using a **Reorder Buffer (ROB)** to maintain correct program execution logic.

8. Worked Examples

Worked Example 4.3.1 (Numerical)

Amdahl's Law Speedup Bounds

Problem: An algorithm is designed such that 85% of its execution time is highly parallelizable, while the remaining 15% must execute sequentially on a single thread. Calculate:

  1. The overall speedup achieved when running on $N = 8$ parallel processors.
  2. The theoretical limit of the speedup as the number of parallel processors approaches infinity ($N \to \infty$).

Solution:

Given: $f = 0.85$ (parallel fraction), $1 - f = 0.15$ (sequential fraction).

  1. Speedup with $N = 8$ Processors: Using Equation 4.3.1: $$S = \frac{1}{(1-f) + \frac{f}{N}}$$ $$S = \frac{1}{0.15 + \frac{0.85}{8}} = \frac{1}{0.15 + 0.10625} = \frac{1}{0.25625} \approx 3.90\times \text{ speedup}$$
  2. Theoretical Speedup Limit ($N \to \infty$): As $N \to \infty$, the term $\frac{f}{N} \to 0$. Thus: $$S_{\max} = \frac{1}{1-f} = \frac{1}{0.15} \approx 6.67\times \text{ speedup limit}$$

Conclusion: With 8 processors, the speedup is **3.90×**. The maximum speedup limit is **6.67×**, regardless of the number of processors added, due to the sequential execution bottleneck.

Worked Example 4.3.2 (Analytical)

MESI Protocol State Transitions

Problem: Trace the cache state transitions for a shared memory block $X$ in a 3-processor system ($P_1, P_2, P_3$) executing the following timeline of events. Assume block $X$ starts as **Invalid (I)** in all caches.

  1. Step 1: $P_1$ reads block $X$ from memory.
  2. Step 2: $P_2$ reads block $X$ from memory.
  3. Step 3: $P_1$ writes to block $X$.
  4. Step 4: $P_3$ reads block $X$.

Solution:

Step Event P1 State P2 State P3 State Bus Action / Explanation
0 Initial I I I Data is invalid in all caches.
1 $P_1$ reads $X$ E I I **BusRd** transaction. Block is loaded only in $P_1$, transitioning to **Exclusive**.
2 $P_2$ reads $X$ S S I **BusRd** transaction. $P_1$ snoops the bus, detects shared interest, and both caches transition to **Shared**.
3 $P_1$ writes $X$ M I I **BusRdX** (read with intent to write) or **Invalidate** transaction. $P_2$'s copy is invalidated. $P_1$'s copy is **Modified** (dirty).
4 $P_3$ reads $X$ S I S **BusRd** transaction. $P_1$ intercepts, flushes modified data to main memory and $P_3$. Both transition to **Shared**.
Worked Example 4.3.3 (Numerical)

Omega Network Routing Complexity

Problem: Design a multistage Omega network to connect $N = 16$ input processors to $N = 16$ output memory modules using $2\times2$ crossbar switches. Calculate:

  1. The total number of switches required for the network.
  2. The number of routing stages.
  3. The binary path routing sequence to connect Input Processor 5 ($0101_2$) to Output Memory 12 ($1100_2$).

Solution:

  1. Routing Stages: $$\text{Stages} = \log_2 N = \log_2(16) = 4 \text{ stages}$$
  2. Total Switches: Each stage contains $\frac{N}{2} = 8$ switches. $$\text{Total Switches} = \text{Stages} \times \frac{N}{2} = 4 \times 8 = 32 \text{ switches}$$
  3. Binary Routing Path: In an Omega network, routing is determined by the destination binary address ($D = 1100_2$). At stage $i$, routing uses bit $d_{4-i}$ of the destination address: * **Stage 1** (uses first bit of $D = 1$): Route to the **lower output** ($1$) of the switch. * **Stage 2** (uses second bit of $D = 1$): Route to the **lower output** ($1$) of the switch. * **Stage 3** (uses third bit of $D = 0$): Route to the **upper output** ($0$) of the switch. * **Stage 4** (uses fourth bit of $D = 0$): Route to the **upper output** ($0$) of the switch.

Conclusion: The network requires **32 switches** across **4 stages**. To connect Processor 5 to Memory 12, the path follows the routing bits **1 → 1 → 0 → 0**.

9. Practice Numerical Problems

Problem 4.3.1: A program takes 100 seconds to run on a single processor. 90% of the program's instructions can execute in parallel. What is the execution time if we run the program on 8 processors?

Answer: Sequential execution is $10$ seconds, parallel execution is $90 / 8 = 11.25$ seconds. Total parallel execution time is $10 + 11.25 = 21.25$ seconds. Speedup is $100 / 21.25 = 4.71\times$.

Problem 4.3.2: A hypercube multiprocessor contains 64 physical processing nodes. Calculate the dimensionality of the hypercube, the degree of each node, and the total number of physical links.

Answer: Dimensionality $d = \log_2(64) = 6$. Degree of each node = $6$. Total links = $$d \times 2^{d-1} = 6 \times 32 = 192 \text{ links}$$.

10. Assessment Bank (GATE & University)

GATE Questions

GATE Q4.3.1: An $N$-dimensional hypercube network has $2^N$ nodes. What is the maximum distance (diameter) between any two nodes in this network?

(A) $N/2$   (B) $N$   (C) $2^N - 1$   (D) $2^{N-1}$

Answer & Analysis: **(B)**. The diameter of an $N$-dimensional hypercube is exactly $N$. The maximum distance between two nodes corresponds to nodes whose binary addresses are bit-wise complements (e.g., $000$ and $111$ in 3D), which differs by exactly $N$ bits, requiring $N$ routing steps. Correct option is (B).

GATE Q4.3.2: In the MESI cache coherence protocol, a cache line is in the **Shared (S)** state. If the local processor executes a write to this cache line, its state changes to:

(A) Modified   (B) Exclusive   (C) Shared   (D) Invalid

Answer & Analysis: **(A)**. When a processor writes to a block that is currently Shared, it must invalidate all other cached copies by broadcasting an invalidate signal on the bus. Since the local processor has updated the block data, its local copy becomes the sole valid copy and differs from main memory, transitioning to the **Modified (M)** state. Correct option is (A).

University Exam Questions

UQ 4.3.1: Define and compare Symmetric Multiprocessors (SMP) and Non-Uniform Memory Access (NUMA) multiprocessors. (8 marks)

UQ 4.3.2: Describe the 4 states of the MESI cache coherence protocol. Detail the transition that occurs when a processor reads a block that is in the Modified state in another processor's cache. (10 marks)

Viva Voce Questions

VQ 4.3.1: What is the difference between tightly coupled and loosely coupled multiprocessors?

Model Answer: Tightly coupled multiprocessors share a single global memory address space, and processors communicate implicitly through shared memory variables. Loosely coupled multiprocessors possess independent local address spaces and memory blocks, communicating explicitly by passing message packets over a network interface.

🎯 Key Takeaways

  • Parallel Processing targets performance bottlenecks using instruction, data, or task-level parallelism.
  • Interconnection Topologies range from simple, low-cost shared buses to high-bandwidth crossbar matrices and scale-optimized hypercubes.
  • Cache Coherence is maintained via snooping protocols like MESI, which track block modification status across caches.
  • Amdahl's Law limits parallel speedup bounds based on the sequential fraction of a program.

References

  1. Syed Arsalaan, "Handwritten COA Notes", 2026, Pages 115–120. [Local Verified]
  2. William Stallings, "Computer Organization and Architecture: Designing for Performance", 2019, 11th Edition, Pearson. [Pending Verification]
  3. David A. Patterson and John L. Hennessy, "Computer Organization and Design: The Hardware/Software Interface", 2018, RISC-V Edition, Morgan Kaufmann. [Pending Verification]