1. Gyanastra
  2. Computer Organisation and Architecture
  3. UGC NET: Pipeline and Vector Processing Extras
  4. Parallel Processing and Flynn Classification
Free lesson, no account needed 11 min read 24 practice questions after it
Asked in past papers6 times
  • ISRO20162008
  • UGC NET2020201320102004

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 ff of the work is parallelizable and PP processors are used, speedup S(P)=1(1−f)+f/PS(P) = \frac{1}{(1-f) + f/P}. As P→∞P \to \infty, Smax⁡=11−fS_{\max} = \frac{1}{1-f}.
    Amdahl's law also applies to improving a portion of a program: if fraction pp is sped up by factor kk, overall speedup = 1/((1−p)+p/k)1/((1-p) + p/k).
  • Bernstein's conditions: Two instruction streams ii and jj can execute in parallel if and only if:
    • Ri∩Wj=∅R_i \cap W_j = \emptyset
    • Wi∩Rj=∅W_i \cap R_j = \emptyset
    • Wi∩Wj=∅W_i \cap W_j = \emptyset where RR and WW are the sets of memory locations read and written. For kk processors, the conditions must hold pairwise.
  • Speedup: S=TsequentialTparallelS = \frac{T_{\text{sequential}}}{T_{\text{parallel}}}.
  • 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 LL with NN PEs is ⌈L/N⌉\lceil L/N \rceil. 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 ff can be parallelized; the remaining fraction 1−f1-f is strictly sequential. With PP processors, the parallel part takes time f/Pf/P.
Total time = (1−f)+f/P(1-f) + f/P.
Speedup = 1/[(1−f)+f/P]1 / [(1-f) + f/P].
As P→∞P \to \infty, the parallel part time tends to 0, so maximum speedup = 1/(1−f)1/(1-f).

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 kk processors, check every pair.

Figure. Notice the instruction and data streams. SISD uses one instruction and one data, SIMD one instruction and many data, MISD many instructions and one data, and MIMD many instructions and many data; examples include uniprocessor, array processor, systolic pipeline, and multicore.

Formulas

  • Let:

  • ff = fraction of work that is parallelizable (0 ≤ f ≤ 1)

  • s=1−fs = 1-f = sequential fraction

  • PP = number of processors

  • S(P)S(P) = speedup with P processors

  • LL = vector length

  • NN = number of processing elements (SIMD)

  • Ri,WiR_i, W_i = read set and write set of processor i

  • Amdahl's Law: S(P)=1s+1−sP=1(1−f)+fPS(P) = \frac{1}{s + \frac{1-s}{P}} = \frac{1}{(1-f) + \frac{f}{P}} Smax⁡=lim⁡P→∞S(P)=1s=11−fS_{\max} = \lim_{P \to \infty} S(P) = \frac{1}{s} = \frac{1}{1-f}

  • Amdahl's Law for an enhancement: If a fraction pp of execution time is improved by a factor kk, then overall speedup S=1(1−p)+p/kS = \frac{1}{(1-p) + p/k}. This reduces to the parallel case when k=Pk = P and p=fp = f.

  • Speedup: S=TsequentialTparallelS = \frac{T_{\text{sequential}}}{T_{\text{parallel}}}

  • SIMD Execution Time:

  • Number of SIMD instructions = ⌈L/N⌉\lceil L/N \rceil.

  • If scalar time per element is tt, scalar time = L⋅tL \cdot t.

  • SIMD time = ⌈L/N⌉⋅t\lceil L/N \rceil \cdot t (assuming one instruction per group, masked elements still take a full cycle).

  • Speedup = L/⌈L/N⌉L / \lceil L/N \rceil.

  • Bernstein's Conditions (for processors i and j): Ri∩Wj=∅,Wi∩Rj=∅,Wi∩Wj=∅R_i \cap W_j = \emptyset, \quad W_i \cap R_j = \emptyset, \quad W_i \cap W_j = \emptyset

  • For kk processors, these must hold for all i≠ji \neq j.

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 f=0.70f = 0.70, P=64P = 64. S=1(1−0.70)+0.70/64=10.30+0.0109375=10.3109375≈3.216S = \frac{1}{(1-0.70) + 0.70/64} = \frac{1}{0.30 + 0.0109375} = \frac{1}{0.3109375} \approx 3.216 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 s=0.05s = 0.05, so parallel fraction f=0.95f = 0.95. As P→∞P \to \infty, Smax⁡=1/s=1/0.05=20S_{\max} = 1/s = 1/0.05 = 20. 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.

R1={a,b}R_1 = \{a,b\}, W1={c}W_1 = \{c\}, R2={c,d}R_2 = \{c,d\}, W2={a}W_2 = \{a\}.
Check R1∩W2={a,b}∩{a}={a}≠∅R_1 \cap W_2 = \{a,b\} \cap \{a\} = \{a\} \neq \emptyset.
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 = ⌈50/8⌉=⌈6.25⌉=7\lceil 50/8 \rceil = \lceil 6.25 \rceil = 7.
SIMD time = 7 cycles (assuming each SIMD instruction takes 1 cycle, including masked).
Speedup = 50/7≈7.1450 / 7 \approx 7.14.

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

ClassInstruction StreamsData StreamsControl UnitsTypical Examples
SISD111Conventional uniprocessor
SIMD1Many1Array processor, vector processor, systolic array
MISDMany1ManySystolic pipeline (model), fault-tolerant systems
MIMDManyManyManyMulticore, multiprocessor, cluster

Table 2: Tightly vs Loosely Coupled MIMD

FeatureTightly CoupledLoosely Coupled
MemoryShared global memoryPrivate memory per processor
CommunicationShared variablesMessage passing
ExampleShared-memory multiprocessorCluster, multicomputer

Table 3: SIMD vs MIMD

FeatureSIMDMIMD
ControlSingle control unitMultiple control units
InstructionsSame instruction for all PEsDifferent instructions per PE
SynchronizationLockstepAsynchronous
ExampleArray processorMulticore CPU

Table 4: Pipelining vs Parallel Processing

FeaturePipeliningParallel Processing
GranularityInstruction-levelTask/thread-level
Resource usageOverlap stages of same taskMultiple tasks simultaneously
ExampleInstruction pipelineMulticore 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: S=Tseq/TparS = T_{\text{seq}} / T_{\text{par}}.
  • 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 ff or sequential fraction ss, apply S=1/(s+f/P)S = 1/(s + f/P), and for infinite processors use 1/s1/s.
  • 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.

Pages 1–2 of 2