Computational Cost and Numerical Accuracy
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal additional columns.
Scrollable figure. Use Left and Right arrow keys to inspect hidden content.
Performance matters scientifically when it changes which validated calculations can be completed, repeated, refined, or independently reproduced. Raw floating-point rate, device occupancy, or one fast step does not establish that improvement. The comparison unit should be resources required to reach the same declared physical error for the same problem, including setup, communication, adaptation, I/O, failed steps, and verification. This page distinguishes diagnostic performance measures from evidence that an algorithm expands reliable scientific reach.
Helpful background. Formulations of General Relativity supplies the evolved physical systems, Ordinary Differential Equations supplies tolerance and stability concepts, Computational Relativity supplies evidence standards, and Probability and Statistical Inference supplies uncertainty summaries for timings and observables.
Define time to a validated result
Section titled “Define time to a validated result”Choose an observable , target uncertainty , physical duration, and benchmark input. For each admissible configuration of implementation , define a resource vector rather than one number,
and collect the nondominated resource vectors at the requested accuracy,
Report which components were measured and how. There is no universal scalar conversion between wall time, allocation, energy, and memory, so “least expensive” is undefined until a scalar objective or explicit resource constraints are chosen. If one is chosen, state it and select from rather than concealing tradeoffs in an implicit ordering.
The target error includes spatial and temporal truncation, iterative tolerance, boundary and extraction errors, and any stochastic or precision component relevant to . Two codes at the same grid spacing need not have the same error. Conversely, a costlier step may win if its convergence order reaches the target with far fewer degrees of freedom.
Build a fair comparison
Section titled “Build a fair comparison”Pin physical equations, initial and boundary data, units, requested output, evolution interval, and failure criteria. Allow each method to choose a documented resolution sequence, then estimate its continuum error using the same observable norm. Include compilation or initialization only if it matters at the intended production cadence; always state the choice. Include I/O when production requires it.
Use a real baseline that runs efficiently and fits memory. Strong-scaling efficiency relative to one underfilled node can exaggerate gains. Report problem size, machine, compiler, software stack, process and device layout, repetitions, median and variation, and profiling categories. Kidder et al. 2017, §§5.1–5.3 and Figures 4–6 ties task-based performance tests to explicit numerical workloads.
Compare not only elapsed time but compute, communication, idle, load imbalance, adaptation, solver iterations, and output. These components explain why scaling saturates and whether a proposed improvement transfers to a production regime.
A useful first estimate follows from . In dimensions, a fixed-duration explicit hyperbolic calculation has cells and time steps, giving work . Eliminating gives
In three dimensions, reducing error by a factor sixteen multiplies idealized work by for a second-order method and by for a fourth-order method. The constants, communication, shocks, and memory can reverse a comparison at practical resolution, so this is an explanatory scaling estimate rather than a performance prediction. It shows why equal cell counts are an incomplete comparison.
Specified validated-performance record
Section titled “Specified validated-performance record”Use the analytic wave
on with periodic boundaries and . Use fourth-order centered differences, RK4, CFL , and grids with to . The analytic solution is the reference. Compare using the volume-weighted relative error and the phase error of an independently computed fundamental Fourier coefficient. A configuration is scientifically admissible only if the run has and and if the final two refinement ratios approach fourth order to within .
For strong scaling set node and hold the problem, diagnostics, and output cadence fixed for nodes. For weak scaling tile unit cubes along , retain the same exact wave with cells per node, and keep ranks, threads, and devices per node fixed. Perform one warm-up and seven measured repetitions, reporting median and interquartile range for wall time and every available component of . Include a run in the Pareto set only when its own and pass the same limits; report solution differences between layouts in relative norm and require them to be at most on corresponding cubes.
The discrete Fourier calculation explains the per-tile resolution: cells already exceed the phase target before parallel overhead is considered.
Observed discrepancy: not available—specification only.
Scientific checks accompany timings
Section titled “Scientific checks accompany timings”For an analytic wave, require convergence to the exact phase and amplitude. For a black hole, require constraints and horizon invariants. For GRMHD, include conserved quantities, primitive-recovery failures, and shock benchmarks. Performance runs that omit expensive verification or use fewer outputs are a different workflow unless the production claim also omits them.
Cross architecture and decomposition changes can alter floating-point order. Demonstrate that those changes remain within the physical error budget. Zhu et al. 2024, §§3–5 combines standard relativity tests with large accelerator scaling; its device-specific efficiencies illustrate why workload and baseline must remain attached to every number.
The strongest evidence is a Pareto curve of resources versus validated error. A method dominates only where it reaches equal or smaller error with no greater resource on every chosen axis. Otherwise report the tradeoff. One can legitimately conclude that a method is faster on a named machine while consuming more energy or memory.
Environment and failure criteria
Section titled “Environment and failure criteria”Pin hardware, allocation, compiler and flags, libraries, code revision, workload checksum, numerical tolerances, resolution and refinement policy, output cadence, profiling tools, warm-up, repetition protocol, and queue or filesystem conditions. A clean interface could be validated-performance --config wave-target.yaml --output run/, emitting observables, error estimates, constraint checks, timings, resources, profiles, and environment metadata. It specifies a reproducible experiment and does not imply portability beyond the tested system.
Reject comparisons with different target errors, missing failures, cherry-picked fastest trials, synthetic baselines, changed physics, or excluded production costs. Other failure modes include measuring only kernel time while communication dominates, counting nominal rather than occupied resources, and extrapolating weak scaling to a different AMR pattern. A speedup whose uncertainty overlaps one, or whose observable exceeds tolerance, is not supporting evidence.
Diagnostic
Section titled “Diagnostic”Method A takes half the wall time of method B at the same cell count. A is second order and misses the waveform-phase tolerance; B is fourth order and meets it. At the resolution where A meets the tolerance, it costs twice as many node-hours as B. Which is faster scientifically?
Solution
For the declared phase target and allocation measure, B reaches the validated result with fewer node-hours. A’s same-cell-count wall-time advantage answers a different question. Report both performance curves, the common error estimator, wall time, node-hours, and memory; do not compress them into a context-free speedup.
References
Section titled “References”- Kidder, L. E., Field, S. E., Foucart, F., et al. (2017). “SpECTRE: A task-based discontinuous Galerkin code for relativistic astrophysics.” Journal of Computational Physics 335, 84–114. arXiv.
- Zhu, H., Fields, J., Zappa, F., et al. (2024). “Performance-portable numerical relativity with AthenaK.” arXiv:2409.10383. arXiv.