Skip to content
Omnikalc

Gustafson’s law calculator: speedup when the problem grows with the number of processors

Enter the serial fraction and the number of processors to get the scaled speedup of Gustafson’s law, the efficiency, and the speedup of Amdahl’s law for a fixed problem.

Updated on
Your inputs
%

Value out of range

Value out of range

Results

Scaled speedup (Gustafson)

60.85

Parallel efficiency
95.1 %
Excellent: the program scales almost linearly
Speedup for a fixed problem (Amdahl)
15.42
Maximum speedup for a fixed problem
20.0

Does adding processors help? It depends on whether the problem is fixed or grows with the machine. The Gustafson law calculator gives the scaled speedup S = N − s(N − 1) from the serial fraction and the number of processors, and compares it with the Amdahl speedup of a fixed problem.

How the calculation works

  • Enter the serial fraction s: the share of the run time, measured on the parallel machine, that cannot be parallelized.
  • Enter the number of processors N (cores, nodes or GPUs).
  • The calculator applies Gustafson’s law: S = N − s × (N − 1), which lets the problem grow with the machine.
  • For comparison, it gives Amdahl’s speedup for a fixed-size problem with the same serial share, and the limit 1 / s.

Example

A program spends 5 % of its time in serial code on 64 processors. With the problem scaled to the machine, the speedup is 64 − 0.05 × 63 = 60.85, an efficiency of 95.1 %. The same serial share on a fixed problem gives only 15.42 (Amdahl), and the limit for any number of processors is 20.

Why it matters

The calculator helps students and engineers in high-performance computing to understand scaling, to plan a cluster or a GPU run and to explain why weak scaling can be good when strong scaling is poor. It helps to set realistic goals for a parallel program.

Good to know

Gustafson’s law is an idealization: the serial part is taken as constant in time and the parallel part as perfectly scalable. Real programs have overhead of communication and synchronization that grows with the number of processors. The serial fraction must be measured on the parallel run. The result is an upper bound on what is possible, and it is not a prediction of the speedup of your code.

The Amdahl’s law calculator gives the limit for a fixed problem, the server capacity calculator sizes the machines for a load, the CPU dynamic power calculator estimates the power of a processor, and the queue wait time calculator covers waiting lines for jobs.

Frequently asked questions

What is Gustafson’s law?

John Gustafson published it in 1988 as an answer to Amdahl’s law. It observes that people do not run a fixed problem on a bigger machine: they run a bigger problem. If the serial part stays the same in time while the parallel part grows with the number of processors, the speedup is N − s(N − 1), a straight line with a slope of 1 − s. It explained why supercomputers reach very high speedups.

What is the difference with Amdahl’s law?

Amdahl’s law asks how much faster a fixed job can run, and the answer is limited by 1/s, whatever the number of processors. Gustafson’s law asks how much more work can be done in the same time, and the answer grows nearly with N. The two laws describe the same program under two goals, strong scaling for Amdahl and weak scaling for Gustafson, and they do not contradict each other.

How do I measure the serial fraction?

Run the program on the parallel machine and measure the time of the serial part and of the parallel part. The serial fraction s in Gustafson’s law is the serial share of the time on the parallel machine, and not of the time on one processor. If you know the serial share s₁ on one processor, it is different, and Amdahl’s law uses it. Profilers and timers in the code give the numbers.

When does the law fail?

It assumes that the problem can grow and that the parallel part scales perfectly. In practice, communication, load imbalance, memory limits and the serial part that also grows (for example the reduction of results) lower the speedup. Some problems have a fixed size (a real-time task or a database query), and then Amdahl’s law applies. Use the efficiency as a check.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.