6.1.3 · D3Parallelism & Multicore

Worked examples — Amdahl's Law and Gustafson's Law

2,706 words12 min readBack to topic

This page drills the parent laws against every kind of input they can face: the friendly middle-of-the-road case, the two extremes ( and ), the "infinite cores" limit, a serial fraction hidden inside a word problem, and the classic exam trap where you must pick the right law. Before we compute anything, let us name every symbol.

The scenario matrix

Every worked example below is tagged with the cell it lands on. Together they touch every cell.

# Case class What is special about the input Which law Example
A Typical mid-range , finite Amdahl Ex 1
B Degenerate: nothing serial both Ex 2
C Degenerate: nothing parallel both Ex 2
D Limit serial ceiling Amdahl Ex 3
E Hidden (profiling trap) from time, not code lines Amdahl Ex 4
F Scaled workload problem grows with Gustafson Ex 5
G Same numbers, both laws compare pessimist vs optimist both Ex 6
H Inverse problem given , solve for Amdahl Ex 7
I Exam twist: choose the law word problem, ambiguous judgment Ex 8

The picture that ties the whole matrix together — how speedup bends as changes. Figure s01: the horizontal axis is the number of processors (1 to 64); the vertical axis is the Amdahl speedup . The grey dashed line is the impossible ideal . The green curve () rides on that ideal; as grows to (blue), (orange), (red) the curves peel away and flatten sooner — the red arrow marks how a bigger gives a flatter, lower curve.

Figure — Amdahl's Law and Gustafson's Law

Case A — the ordinary Amdahl case ()

Load imbalance and coordination make the effective worse than the algorithmic one — see Load Balancing and Thread Synchronization.


Cases B & C — the two degenerate ends ( and )


Case D — the infinite-core ceiling

The dashed line in the figure below is exactly this ceiling. Figure s02: horizontal axis is (1 to 120), vertical axis is for (blue curve). The red dashed horizontal line sits at . Two dots mark our worked points — the orange dot at and the green dot at — showing the curve creeping toward but never touching the red ceiling.

Figure — Amdahl's Law and Gustafson's Law

Case E — the hidden serial fraction (profiling trap)


Case F — the scaled workload (Gustafson)

Where does live relative to Amdahl? Figure s03: horizontal axis is (1 to 64); vertical axis is speedup. The green line is Gustafson for — it rides just under the grey dashed ideal and keeps climbing. The blue curve is Amdahl for the same , which flattens toward its ceiling (red dashed). The gap between green and blue is the whole "pessimist vs optimist" story.

Figure — Amdahl's Law and Gustafson's Law

Case G — same numbers, both laws (pessimist vs optimist)


Case H — the inverse problem (given speedup, find the bottleneck)


Case I — the exam twist: which law?


Recall Quick self-test

and mean ::: run-time on one core, and run-time on cores, respectively. Amdahl measures against which clock? ::: the one-core time . Gustafson measures against which clock? ::: the -core run-time . At Amdahl and Gustafson both give ::: (they agree). The Amdahl ceiling as is ::: . To recover from a measured use ::: . The single word that decides Amdahl-vs-Gustafson is ::: whether the problem is fixed or scaled.