Skip to content
VLASIFY™
GuideHPC, GPU & Linux

Strong vs weak scaling in MPI and HPC: definitions, formulas and how to measure

Updated · Scientifically reviewed by Dinkar Mishra, PhD on

Short answer

Strong scaling measures how runtime falls when a fixed-size problem runs on more processes; ideal speedup equals the process count, and Amdahl's law limits it through the serial fraction. Weak scaling grows the problem with the process count so that work per process stays constant; ideally runtime stays flat, and Gustafson's law describes it. Report speedup and parallel efficiency, measured from at least four process counts.

Who this is for

Researchers writing allocation proposals, optimising parallel codes, or choosing how many nodes to request for a simulation.

Software

Python ≥ 3.9 (analysis snippet)

How it works

Strong scaling keeps the total problem fixed and adds processes. With runtime T1T_1 on one unit (or a baseline count p0p_0) and TpT_p on pp units:

S(p)=T1Tp,Estrong(p)=S(p)p=T1p Tp.S(p) = \frac{T_1}{T_p}, \qquad E_{strong}(p) = \frac{S(p)}{p} = \frac{T_1}{p\,T_p}.

Amdahl’s law: if a fraction ff of the work is serial, the speedup is bounded by

S(p)≤1f+(1−f)/p  →p→∞  1f.S(p) \le \frac{1}{f + (1-f)/p} \;\xrightarrow{p\to\infty}\; \frac{1}{f}.

Even 1% serial work caps the speedup at 100.

Weak scaling grows the problem in proportion to pp, keeping the work per unit fixed. Ideally the runtime stays constant:

Eweak(p)=T1Tp.E_{weak}(p) = \frac{T_1}{T_p}.

Gustafson’s law expresses the scaled speedup as S(p)=p−f(p−1)S(p) = p - f(p-1), which explains why large machines remain useful for proportionally larger problems.

Which one answers your question?

QuestionUse
How many nodes should I request to finish this run fastest without wasting allocation?Strong scaling
Can I run a 10× bigger simulation on 10× the nodes in the same time?Weak scaling
Does my code’s communication grow badly with scale?Both: weak scaling exposes communication growth; strong scaling exposes the serial fraction

Running a scaling study

  1. Pick a representative case: the production configuration, shortened to a fixed number of steps after initialisation.
  2. Choose at least four sizes, usually powers of two (for example 1, 2, 4, 8, 16 nodes).
  3. Time only the main loop. Exclude start-up and I/O, or report them separately.
  4. Repeat each point two or three times and use the median.
  5. Compute speedup and efficiency relative to the smallest run.
# Wall-clock seconds for a fixed number of steps (strong scaling); replace with your measurements
nodes = [1, 2, 4, 8, 16]
seconds = [1000.0, 520.0, 275.0, 150.0, 95.0]

base_n, base_t = nodes[0], seconds[0]
for n, t in zip(nodes, seconds):
    speedup = base_t / t
    efficiency = speedup / (n / base_n)
    print(f"{n:3d} nodes: speedup {speedup:5.2f}, efficiency {100 * efficiency:5.1f}%")

With these illustrative numbers, efficiency falls from 100% to about 66% at 16 nodes, so 8 nodes (about 83%) would be the economical choice.

Reading the results

  • Efficiency falls gradually in strong scaling: normal. Each process has less work while communication stays similar.
  • Efficiency falls sharply at a certain size: communication or load imbalance dominates. Profile at that size; see how to optimize HPC simulations.
  • Weak-scaling runtime grows steadily: global communication (all-reduce, FFTs, I/O) is growing with the process count.

Assumptions and limitations

  • The example timings are illustrative inputs, not measurements of any particular code.
  • Scaling depends on the problem size: a small problem stops scaling early. Always state the problem size alongside scaling results.
  • On GPUs, strong scaling usually ends earlier than on CPUs, because each GPU needs a lot of work to be efficient.

Frequently asked questions

Which scaling study do allocation proposals require?+

Many supercomputing centres ask for strong scaling of a representative production case around the job size you request, showing reasonable parallel efficiency. Some also ask for weak scaling. Check the call text; centres often specify the minimum efficiency they expect.

What parallel efficiency is acceptable?+

It depends on the centre and the code. Values above roughly 70–80% at the requested size are commonly treated as good. Beyond the point where efficiency drops sharply, extra nodes mostly waste allocation.

Why can speedup be superlinear?+

When the per-process data starts fitting into cache as you add processes, each process runs faster than before, so measured speedup can exceed the process count. It is real but specific to that size range.

Should I count nodes, GPUs or cores?+

Use the unit you request and pay for, and keep it consistent. For GPU codes this is usually GPUs (one MPI rank per GPU); for CPU codes, cores or nodes.

References

  1. Amdahl, Validity of the single processor approach to achieving large scale computing capabilities, AFIPS Conf. Proc. 30, 483 (1967) · Conference paper
  2. Gustafson, Reevaluating Amdahl's law, Commun. ACM 31(5), 532 (1988) · Peer-reviewed article
  3. Hoefler & Belli, Scientific benchmarking of parallel computing systems (SC15) · Conference paper

Need help applying this?

Our physicists turn concepts into working, verified simulations for research groups and companies.

Services listed on this page are available today. Products marked “early access” or “in development” on our platform page are not yet generally available.

Spotted an error or an outdated command? Tell us. We correct verified issues promptly.

Related guides

How Vlasify can help

Get a Quote