Self-Assessment Quiz: Why Parallel?
Twenty questions to confirm the concepts landed before you start writing parallel code in Chapter 32. Aim for 16 or more. Work the numeric ones by hand before checking; the answer key and a topic map are at the end.
Question 1
Which of these ended around 2005 and is the direct reason single-core clock speeds stopped rising? - A. Moore's Law (transistor count doubling) - B. Dennard scaling (constant power density as transistors shrink) - C. Amdahl's Law - D. Gustafson's Law
Question 2
Since ~2005, the extra transistors that Moore's Law keeps delivering have mostly gone into: - A. A single, ever-faster core - B. More cores per chip - C. Higher clock frequencies - D. Smaller chips with fewer transistors
Question 3
Amdahl's Law for a program with parallelizable fraction $p$ on $N$ processors is: - A. $S(N) = p + (1-p)N$ - B. $S(N) = 1 / ((1-p) + p/N)$ - C. $S(N) = N / p$ - D. $S(N) = pN$
Question 4
A program is 90% parallelizable. Its maximum possible speedup, on any number of cores, is: - A. 90× - B. 100× - C. 10× - D. Unbounded
Question 5
The same 90%-parallel program on 8 cores achieves a speedup closest to: - A. 8.0× - B. 7.2× - C. 4.7× - D. 10.0×
Question 6
True or false, with justification: raising the parallel fraction from 95% to 99% multiplies the Amdahl ceiling by 5.
Question 7
Gustafson's Law gives a scaled speedup that, as a function of the number of processors $N$, is: - A. Bounded by $1/(1-p)$ - B. Roughly linear in $N$ - C. Roughly $\log N$ - D. Independent of $N$
Question 8
The key assumption that makes Gustafson's Law give a different answer from Amdahl's is: - A. Gustafson ignores the serial fraction - B. Gustafson lets the problem size grow with the processor count - C. Gustafson assumes zero communication cost - D. Gustafson only applies to GPUs
Question 9
In a shared-memory model, parallel workers coordinate primarily by: - A. Sending explicit messages over a network - B. Reading and writing the same variables in one address space - C. Copying data to a GPU and back - D. Writing to separate files
Question 10
Which model scales to the largest machines (thousands of nodes), and how do its workers communicate? - A. Shared memory; through common variables - B. Distributed memory; by explicit message passing - C. GPU; through device memory - D. Shared memory; by message passing
Question 11
Which Fortran feature is a native, standardized parallel model that can target both shared and distributed memory with one notation? - A. OpenMP - B. MPI - C. Coarrays - D. OpenACC
Question 12
Applying the identical stencil update to every interior cell of the plate at once is an example of: - A. Task parallelism - B. Data parallelism - C. Weak scaling - D. A data race
Question 13
Holding the total problem size fixed while increasing the core count, and measuring speedup, is: - A. Weak scaling - B. Strong scaling - C. Task parallelism - D. Gustafson's regime
Question 14
Parallel efficiency is defined as: - A. $S(N) \times N$ - B. $S(N) / N$ - C. $N / S(N)$ - D. $1 - p$
Question 15
A code reaches 15× speedup on 64 cores. Its parallel efficiency is closest to: - A. 96% - B. 24% - C. 15% - D. 64%
Question 16
True or false, with justification: "We achieved a 12× speedup" is a complete, evaluable performance claim.
Question 17
Why must the heat solver's time loop run sequentially rather than in parallel across steps? - A. Because I/O can only happen one step at a time - B. Because step $n+1$ depends on the completed field from step $n$ - C. Because Fortran arrays are column-major - D. Because OpenMP does not support loops
Question 18
According to §31.5, the correct order of operations when preparing to parallelize is: - A. Parallelize first, then optimize the serial code - B. Make the serial code fast, profile, then parallelize the hot spot - C. Buy more cores, then measure - D. Rewrite in Python for the multiprocessing library
Question 19
Real measured strong-scaling curves fall below the Amdahl prediction for the same serial fraction because: - A. Amdahl's Law is wrong - B. Real parallelism adds overhead (thread launch, messages, transfers) that Amdahl's ideal ignores - C. Compilers cannot vectorize parallel code - D. Efficiency is always exactly 100%
Question 20
What does this program print (assume p = 0.98, and reason from the ceiling formula)?
print '(f6.2)', 1.0_dp / (1.0_dp - p)
- A.
0.98 - B.
50.00 - C.
2.00 - D.
98.00
Answer Key
| Q | Ans | Why |
|---|---|---|
| 1 | B | Dennard scaling (constant power density) ended; that is why clocks stalled. Moore's Law (count) continued. |
| 2 | B | Extra transistors now buy more cores, not a faster one. |
| 3 | B | $S = 1/((1-p) + p/N)$ — the definition of Amdahl's Law. |
| 4 | C | Ceiling $= 1/(1-p) = 1/0.1 = 10\times$, on any number of cores. |
| 5 | C | $1/(0.1 + 0.9/8) = 1/0.2125 \approx 4.7\times$. |
| 6 | True | Ceiling $= 1/(1-p)$: at 95% it is $1/0.05 = 20$; at 99% it is $1/0.01 = 100$ — a fivefold jump from shrinking the serial fraction 5% → 1%. Small changes near the top have outsized effects. |
| 7 | B | $S = s + (1-s)N$ is linear in $N$ — no ceiling. |
| 8 | B | Gustafson grows the problem with the cores; the parallel work scales up, so the serial fraction shrinks relatively. |
| 9 | B | Shared memory: one address space; coordinate through common variables (OpenMP). |
| 10 | B | Distributed memory scales to clusters; workers send explicit messages (MPI). |
| 11 | C | Coarrays — native since Fortran 2008, one notation across shared and distributed memory. |
| 12 | B | Same operation on much data = data parallelism (the stencil sweep). |
| 13 | B | Fixed problem, rising cores, measure speedup = strong scaling (Amdahl's regime). |
| 14 | B | Efficiency $E = S/N$, the fraction of each core actually used. |
| 15 | B | $15/64 \approx 0.234 \approx 24\%$. |
| 16 | False | A speedup is meaningless without the core count (and ideally the efficiency); "12× on how many cores?" |
| 17 | B | The future depends on the present: step $n+1$ needs step $n$'s finished field — a true data dependency. |
| 18 | B | Fast serial first, profile to find the hot spot, then parallelize it — Amdahl's Law is why. |
| 19 | B | Overhead (thread launch, network messages, host-device copies) is real work Amdahl's ideal omits. |
| 20 | B | $1/(1-0.98) = 1/0.02 = 50.00$. |
Topics to review by question
- Q1–2 → §31.1 (Dennard vs Moore, the end of the free lunch).
- Q3–6, Q20 → §31.2 (Amdahl's Law, the ceiling, the effect of the serial fraction).
- Q7–8 → §31.2 (Gustafson's Law and how it differs).
- Q9–11 → §31.3 (shared / distributed / GPU taxonomy; coarrays).
- Q12 → §31.4 (data vs task parallelism).
- Q13–15, Q19 → §31.4 (strong vs weak scaling; efficiency; overhead).
- Q16 → §31.2/31.4 (honest reporting: speedup needs its core count).
- Q17–18 → §31.5 (dependencies, and the order of operations before parallelizing).
Scored below 16? The two ideas most worth rereading are Amdahl's ceiling $1/(1-p)$ (Q3–6, 20) and the strong-vs-weak / Amdahl-vs-Gustafson pairing (Q7–8, 13) — they recur in every chapter of this part.