Computer Organisation and Architecture · UGC NET: Pipeline and Vector Processing Extras
Parallel Processing and Flynn Classification
Overview
Parallel processing is the simultaneous use of multiple processing elements to execute a program faster than a single processor can. It underpins modern multicore CPUs, GPUs, supercomputers, and data centers.
Flynn's classification is the most widely used taxonomy for parallel architectures, categorizing machines by the number of instruction streams and data streams they handle.
This lesson also covers Amdahl's law, which bounds the speedup from parallelism, and Bernstein's conditions, which determine when two instruction streams can run in parallel without data conflicts.
You should already know basic computer organization: CPU, ALU, control unit, memory, and the fetch-decode-execute cycle.
Key concepts
- Parallel processing: Execution of multiple tasks or instructions simultaneously on multiple processing elements.
- Flynn's classification: A taxonomy based on the number of instruction streams and data streams. Four classes: SISD, SIMD, MISD, MIMD.
- SISD (Single Instruction, Single Data): One instruction stream, one data stream. Conventional uniprocessor. Example: a basic scalar CPU.
- SIMD (Single Instruction, Multiple Data): One instruction stream, multiple data streams. One control unit broadcasts the same instruction to many processing elements (PEs), each operating on its own data.
Examples: array processors, vector processors, systolic arrays. - MISD (Multiple Instruction, Single Data): Multiple instruction streams, one data stream. Very rare. A systolic pipeline where each stage applies a different operation to the same data token can be modeled as MISD.
- MIMD (Multiple Instruction, Multiple Data): Multiple instruction streams, multiple data streams. Each processor has its own control unit and program counter. Examples: multicore CPUs, shared-memory multiprocessors, clusters.
- Instruction-level parallelism (ILP): Overlap of instructions in a single processor. Pipelining is a form of ILP where different stages of instruction execution are overlapped.
A pipelined uniprocessor is still SISD in Flynn's taxonomy. - Amdahl's law: The speedup of a parallel program is limited by its sequential portion. If a fraction of the work is parallelizable and processors are used, speedup . As , .
Amdahl's law also applies to improving a portion of a program: if fraction is sped up by factor , overall speedup = . - Bernstein's conditions: Two instruction streams and can execute in parallel if and only if:
- where and are the sets of memory locations read and written. For processors, the conditions must hold pairwise.
- Speedup: .
- Tightly coupled MIMD: Processors share a global memory and communicate via shared variables. Example: shared-memory multiprocessor.
- Loosely coupled MIMD: Each processor has its own private memory; communication via message passing. Example: cluster, multicomputer.
- Supercomputer: A computer at the forefront of processing capacity, primarily distinguished by its high speed (measured in FLOPS), typically using massive parallel processing.
How it works
Flynn's classification depends on two independent streams: the instruction stream (what the control unit fetches and executes) and the data stream (the operands being processed). The four classes are best understood through a flowchart:
SISD executes one instruction at a time on one piece of data. A pipelined CPU still fetches one instruction per cycle (though overlapped), so it remains SISD at the architectural level.
SIMD uses a single control unit to fetch one instruction and broadcast it to all processing elements. Each PE has its own data memory and address register. All PEs execute the same instruction in lockstep.
When a condition (e.g., if (A[i] > 0)) is encountered, masking is used: the instruction is executed by all PEs, but only those satisfying the condition write their results.
The number of SIMD instructions to process a vector of length with PEs is . The last group may be partially masked, but it still consumes one instruction cycle.
MISD is rare in practice. A systolic array where data flows through a pipeline of stages, each performing a different instruction on the same data token, can be viewed as MISD. Fault-tolerant systems that replicate the same data across multiple processors with different programs also fit.
MIMD is the most flexible and most common for general-purpose parallel computing. Each processor executes its own instruction stream on its own data.
In a tightly coupled system, processors share a global memory; synchronization is through shared variables and locks.
In a loosely coupled system, each processor has a private memory; communication is via message passing (e.g., MPI).
Amdahl's law derivation: Let total sequential execution time be 1. A fraction can be parallelized; the remaining fraction is strictly sequential. With processors, the parallel part takes time .
Total time = .
Speedup = .
As , the parallel part time tends to 0, so maximum speedup = .
Bernstein's conditions: For two instruction streams to be independent, neither should write to a location the other reads or writes. The three conditions ensure no read-after-write (RAW), write-after-read (WAR), or write-after-write (WAW) hazards. For processors, check every pair.
Drawing the diagram…
Formulas
-
Let:
-
= fraction of work that is parallelizable (0 ≤ f ≤ 1)
-
= sequential fraction
-
= number of processors
-
= speedup with P processors
-
= vector length
-
= number of processing elements (SIMD)
-
= read set and write set of processor i
-
Amdahl's Law:
-
Amdahl's Law for an enhancement: If a fraction of execution time is improved by a factor , then overall speedup . This reduces to the parallel case when and .
-
Speedup:
-
SIMD Execution Time:
-
Number of SIMD instructions = .
-
If scalar time per element is , scalar time = .
-
SIMD time = (assuming one instruction per group, masked elements still take a full cycle).
-
Speedup = .
-
Bernstein's Conditions (for processors i and j):
-
For processors, these must hold for all .
Worked examples
Example 1 (Amdahl's Law – finite processors)
A program has 70% of its execution time that can be parallelized. It runs on a 64-processor machine. Using Amdahl's law, find the expected speedup.
Here , . Rounded to two decimals, speedup ≈ 3.22.
Example 2 (Amdahl's Law – infinite processors)
If 5% of a program is strictly sequential and the remaining part is perfectly parallelizable, what is the maximum speedup achievable with an infinite number of processors?
Sequential fraction , so parallel fraction . As , . Answer: 20.
Example 3 (Bernstein's Conditions)
Two processors P1 and P2 have the following read/write sets:
- P1: reads {a, b}, writes {c}
- P2: reads {c, d}, writes {a}
Check if they can execute in parallel using Bernstein's conditions.
, , , .
Check .
Since the intersection is non-empty, the condition fails. Therefore, P1 and P2 cannot execute in parallel without a conflict (P1 reads a which P2 writes).
Example 4 (SIMD Speedup)
A SIMD machine has 8 processing elements. It executes a vector loop of 50 elements. Each SIMD instruction handles 8 elements; the final partial group is masked but still consumes one cycle. If a scalar instruction takes 1 cycle per element, compute the speedup.
Scalar time = 50 cycles.
Number of SIMD instructions = .
SIMD time = 7 cycles (assuming each SIMD instruction takes 1 cycle, including masked).
Speedup = .
Example 5 (Flynn Match)
Match the following:
List-I: A. SISD, B. SIMD, C. MISD, D. MIMD
List-II: i. Classical uniprocessor, ii. Array processor, iii. Several instruction streams, one data stream, iv. Multiprocessor with independent cores.
Matching:
- SISD → i (classical uniprocessor)
- SIMD → ii (array processor)
- MISD → iii (several instruction streams, one data stream)
- MIMD → iv (multiprocessor with independent cores)
Comparison
Table 1: Flynn's Classification
| Class | Instruction Streams | Data Streams | Control Units | Typical Examples |
|---|---|---|---|---|
| SISD | 1 | 1 | 1 | Conventional uniprocessor |
| SIMD | 1 | Many | 1 | Array processor, vector processor, systolic array |
| MISD | Many | 1 | Many | Systolic pipeline (model), fault-tolerant systems |
| MIMD | Many | Many | Many | Multicore, multiprocessor, cluster |
Table 2: Tightly vs Loosely Coupled MIMD
| Feature | Tightly Coupled | Loosely Coupled |
|---|---|---|
| Memory | Shared global memory | Private memory per processor |
| Communication | Shared variables | Message passing |
| Example | Shared-memory multiprocessor | Cluster, multicomputer |
Table 3: SIMD vs MIMD
| Feature | SIMD | MIMD |
|---|---|---|
| Control | Single control unit | Multiple control units |
| Instructions | Same instruction for all PEs | Different instructions per PE |
| Synchronization | Lockstep | Asynchronous |
| Example | Array processor | Multicore CPU |
Table 4: Pipelining vs Parallel Processing
| Feature | Pipelining | Parallel Processing |
|---|---|---|
| Granularity | Instruction-level | Task/thread-level |
| Resource usage | Overlap stages of same task | Multiple tasks simultaneously |
| Example | Instruction pipeline | Multicore processor |
Revision summary
- Flynn's taxonomy uses two dimensions: instruction streams and data streams.
- SISD = uniprocessor;
SIMD = array/vector processor;
MIMD = multicore/multiprocessor;
MISD = rarest, often systolic pipelines. - Descending order of complexity: MIMD > SIMD > SISD (MISD is separate, rarely compared).
- Amdahl's law: speedup limited by sequential fraction; maximum speedup = 1/sequential fraction.
- Speedup formula: .
- Bernstein's three conditions: RAW, WAR, WAW hazards must be absent.
- SIMD executes in lockstep; conditional operations use masking.
- Number of SIMD instructions = ceil(vector length / number of PEs).
- Pipelining is a form of parallelism but a pipelined uniprocessor is SISD.
- Tightly coupled MIMD uses shared memory; loosely coupled uses message passing.
- Supercomputers are distinguished by high speed (FLOPS), not accuracy or capacity.
- Cost of parallel processing is primarily determined by switching complexity (interconnection network).
Previous-year exam insights
- Direct definition questions: identify the Flynn class from a description (e.g., "array processor" → SIMD).
- Match List-I (class) with List-II (example or property) – learn the standard examples by heart.
- Statement-based questions on SIMD and MIMD: check lockstep, control unit count, memory sharing, and program counter independence.
- Numeric problems on Amdahl's law: identify the parallel fraction or sequential fraction , apply , and for infinite processors use .
- Bernstein's conditions: given read/write sets, check the three intersections; a non-empty intersection means no parallel execution.
- Complexity order: remember MIMD > SIMD > SISD; MISD is least common and not usually in ordering.
- Traps: a pipelined uniprocessor is still SISD; SIMD uses one control unit but many ALUs; MIMD processors have independent program counters.
- Supercomputer question: the key feature is highest speed, not accuracy or capacity.
- Cost of parallel processing is dominated by switching (interconnection) complexity, not circuit complexity.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- Classify any given computer architecture into SISD, SIMD, MISD, or MIMD with justification.
- State the full forms and one standard example for each Flynn class.
- Explain why a pipelined uniprocessor is classified as SISD.
- Apply Amdahl's law to compute speedup for a given parallel fraction and number of processors.
- Compute the maximum speedup as the number of processors tends to infinity.
- Check Bernstein's conditions for two or more processors and determine if they can run in parallel.
- Calculate the number of SIMD instructions and speedup for a vector loop with masking.
- Distinguish tightly coupled and loosely coupled MIMD systems.
- Identify the least common Flynn class and give a scenario where it is used.
- Explain the difference between pipelining and parallel processing in one sentence.
Attempt the sub-topic test first, then the subject test.