6.1.3 · D5Parallelism & Multicore

Question bank — Amdahl's Law and Gustafson's Law

2,027 words9 min readBack to topic

Before any trap makes sense we must own the two formulas outright — not borrow them. Everything below rests on these, so we build them here from scratch.

Building Amdahl's formula (fixed problem)

Take the whole job on one core, time . Split it into its serial and parallel slices (figure below, top bar): serial , parallel .

Figure — Amdahl's Law and Gustafson's Law

Now hand the parallel slice to workers. The serial slice cannot be split, so it still costs ; the parallel slice divides evenly into (figure, lower bars). Add them:

Speedup is the ratio, and cancels top and bottom:

Let : the term , leaving the hard ceiling .

Building Gustafson's formula (growing problem)

Now flip the reference. We own cores and a fixed time . Measure the slices in that run: serial , parallel (figure below, upper bar). The trick is: the parallel slice was spread across cores, so to redo that same amount of work on one core takes times as long — the parallel term inflates to (lower bar), while the serial term is unchanged:

Figure — Amdahl's Law and Gustafson's Law

Speedup again is the ratio, and cancels:

Expand and collect:

So the linear term comes directly from doing the parallel work; the is the "tax" the un-inflatable serial slice charges. (Same thing as .)

The two names for these two worlds

Recall Which question does each law ask?

Amdahl (strong scaling) ::: "The problem is a fixed size — how fast can I finish it?" , capped at . Gustafson (weak scaling) ::: "I have workers and a fixed time budget — how much more work can I do?" , near-linear when is small.


True or false — justify

Give a reason every time; a naked true/false earns nothing.

TF1. "With enough cores, any program can be made arbitrarily fast."
False — in Amdahl the denominator never falls below , so ; with you can never beat however many cores you add.
TF2. "Amdahl and Gustafson contradict each other."
False — they answer different questions (strong vs weak scaling). Amdahl fixes the problem size, Gustafson fixes the time and grows the problem; both are correct for their own assumption.
TF3. "If , Amdahl's speedup equals ."
True — substitute : ; with no serial term the denominator is purely , so speedup is exactly linear.
TF4. "If , adding cores still helps a little."
False — set : for every ; the parallel term is zero, so extra cores sit idle and speedup stays exactly .
TF5. "Gustafson's speedup can exceed the number of processors ."
False — and so the subtracted term is , giving ; it approaches as but never passes it.
TF6. "A larger serial fraction always lowers speedup in both laws."
True — in Amdahl a bigger raises the denominator (its derivative in is ), and in Gustafson subtracts more; both punish serial work.
TF7. "Doubling cores from to doubles Amdahl speedup."
False — only the parallel term halves to ; the serial stays put in the denominator, so speedup rises but by strictly less than double, and less each time you double.
TF8. "The parallel fraction is simply one minus the serial fraction, both measured as time."
True — they are two shares of the same 100% of run time ( and ), so by definition they add to .
TF9. "Gustafson with gives exactly linear speedup."
True — , the same perfect-scaling endpoint Amdahl reaches at ; the laws agree at the no-serial extreme.
TF10. "If measured speedup is much lower than predicts, your algorithm's is wrong."
Often true in spirit — real overheads (Cache Coherence traffic, Thread Synchronization waits, communication) add time that behaves like extra serial fraction, so the effective is bigger than the algorithmic one you assumed.

Spot the error

Each statement hides one flaw — name it.

SE1. "Only 3 of my 100 functions run serially, so ."
The error is counting code, not time. is the share of run-time; three tiny functions could be a lock eating 40% of the clock, or three heavy ones could dominate. You must profile.
SE2. "I have 8 cores so I'll get ."
This assumes and zero overhead. Any serial slice keeps in Amdahl's denominator, and real synchronization plus Load Balancing costs push effective speedup strictly below .
SE3. "My problem is fixed-size, so I'll use Gustafson to promise near-linear scaling."
Wrong law — a fixed problem is strong scaling, which is Amdahl's domain. Gustafson assumes the problem grows with ; for a fixed problem Amdahl gives the honest cap .
SE4. "Speedup of on 10 cores means the code is broken."
Not necessarily — with , Amdahl gives exactly. A sub- speedup is the normal consequence of a serial slice, not a bug.
SE5. "Since Gustafson gives on 100 cores, we finish the original job faster."
The error is confusing more work with faster. Gustafson's is a weak-scaling claim — a bigger problem in the same time — not the old problem in of the time.
SE6. " changes when I switch from 4 cores to 400 cores."
In the ideal models is a property of the workload, held constant while varies (that is exactly why or cancels). Real overhead makes effective drift, but the textbook laws treat it as fixed per problem.
SE7. "Amdahl's denominator can go negative for big ."
Impossible — both and , so the denominator is always positive and shrinks toward , never below it.

Why questions

WQ1. Why does the total single-core time cancel out of Amdahl's speedup?
Because and has as a common factor; dividing removes it, so speedup depends only on the fraction and , never on absolute time.
WQ2. Why is the serial term left untouched when we divide by ?
The serial work is a chain of dependent steps — each needs the previous one's result — so extra workers have nothing to do; only the independent parallel slice divides by .
WQ3. Why does Amdahl's law approach rather than infinity as ?
In the term , leaving ; the fixed serial slice becomes the entire remaining runtime and acts as a hard floor.
WQ4. Why does Gustafson measure work relative to the parallel run time instead of ?
Because the practical situation is "I own cores and a fixed time window" — the observed quantity is , and we ask how long that same work would take alone (), which produces the inflation.
WQ5. Why is Gustafson called "optimistic" and Amdahl "pessimistic"?
Gustafson (weak scaling) lets the parallel workload grow with , so the serial slice becomes a shrinking share and ; Amdahl (strong scaling) freezes the workload, so the fixed serial slice dominates and caps speedup at .
WQ6. Why can optimizing the serial 5% beat adding more cores?
Once cores are plentiful, Amdahl's speedup is pinned near ; halving doubles that ceiling directly, while adding cores only nudges toward zero with diminishing return. See Scalability Analysis.
WQ7. Why do communication and Cache Coherence traffic make real speedup worse than either law predicts?
Both ideal laws assume the parallel part divides perfectly and for free; real cores must exchange data, invalidate cache lines, and wait at barriers, adding time that behaves like extra serial fraction. Track it via Performance Metrics.
WQ8. Why does GPU Computing fit Gustafson's mindset so well?
GPUs win by attacking huge data-parallel problems (millions of pixels/particles) — you scale the problem to the hardware, exactly Gustafson's weak-scaling assumption, rather than racing a tiny fixed task.

Edge cases

EC1. What is Amdahl's speedup at ?
— one processor is the baseline, so by construction speedup equals exactly .
EC2. What is Gustafson's speedup at ?
— also exactly , so both laws correctly agree that a single processor gives no speedup.
EC3. Both laws at — what happens and do they agree?
Amdahl gives , Gustafson gives ; with no serial work both collapse to perfect linear speedup, so the laws coincide at this extreme.
EC4. Both laws at — what happens?
Amdahl gives ; Gustafson gives ; a fully serial job cannot be sped up in either framework, again agreeing.
EC5. What does ever mean, and can the ideal formulas produce it?
means the parallel version is slower than serial — a real "slowdown" from overhead swamping the work; the ideal and never dip below , so seeing it signals real-world costs the models omit.
EC6. As , what does Gustafson's speedup do?
It grows without bound as — a straight line of slope — because the problem keeps growing, unlike Amdahl which flat-lines at .
EC7. If a job is truly embarrassingly parallel () but you observe only on 8 cores, what's the culprit?
The algorithmic is near zero, so the loss must come from effective serial overhead — poor Load Balancing, synchronization stalls, or memory bandwidth limits — inflating the effective toward the value that solves , roughly .
EC8. Two programs both have but one runs 1 ms and the other 1 hour — do they get the same Amdahl speedup on the same ?
Yes — Amdahl depends only on and (absolute time cancels), so both reach the same ; in practice the 1 ms job may be dominated by fixed launch overhead the model ignores.