Short MPI benchmark phases in an unpinned container jump between two speeds, so medians fake a regression
PitfallVerified 12 Oct 2026Holds tool: docker
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
An A/B run of IO500 (4 MPI ranks in Docker, 10 runs per build) showed the new build 20% and 36% slower on the mdtest stat phases. Both builds made exactly the same calls. The machine was quiet (load average about 0.4).
Cause#
Each phase lasts about 1 s, and the scheduler places the ranks differently from run to run. Every build, also the run with no tracer, jumps between two speeds, for example about 640 or about 1060 kIOPS. The medians differ only because one build landed on the slow speed more often (6 of 10 against 3 of 10). This is not the load noise of a busy machine: the values form two clusters, not a spread.
Fix#
- Print the value of each run, not only the median, and look for two clusters.
- Pin the container to a CPU set the size of the rank count:
docker run --cpuset-cpus=0-3 ...formpirun -np 4. - Interleave the builds in each round and run 20 rounds.
Evidence#
- Unpinned, 10 runs, mdtest-hard-stat kIOPS: base 638 1016 1078 1075 651 1093 661 1050 1009 1068; new 1087 649 1099 636 634 665 1116 614 1108 658. The no-tracer runs were also bimodal (about 1880 or 3150).
- Pinned with
--cpuset-cpus=0-3, 20 runs: one cluster per build (base 673 to 745, new 612 to 741 apart from rare outliers), and every phase was within 3% between the builds.
Also found by searching
- mdtest-easy-stat 1008 kIOPS base vs 807 kIOPS new build, same event counts
- IO500 phase results jump between two values from run to run
- benchmark looks 20 to 36 percent slower but the trace shows the same calls
- how do I get stable IO500 or mdtest numbers in docker
- bimodal benchmark results on a quiet machine with low load
- mpirun -np 4 in docker gives two clusters of results