Introduction
Adjoint-based sensitivity analysis is a cornerstone of modern computational fluid dynamics (CFD), enabling critical tasks such as goal-oriented error estimation and gradient-based shape optimization. However, solving adjoint equations requires a backward-in-time integration that depends on the forward solution at every step. For high-fidelity 3D simulations, storing the entire forward trajectory is often computationally infeasible due to memory constraints.
The Challenge of Adaptive Time-Stepping
Traditional "offline" checkpointing strategies, such as the revolve algorithm, mitigate memory bottlenecks by storing a subset of snapshots and recomputing intermediate states. However, these methods require prior knowledge of the total number of time steps. In modern simulations utilizing adaptive time-stepping, the total step count is unknown until the simulation concludes. This typically necessitates a "two-pass" approach—running the simulation once to count steps and a second time for the adjoint calculation—which significantly increases computational overhead.
Methodology: Optimal Online Checkpointing
This work introduces a provably optimal "online" checkpointing algorithm that determines checkpoint placement dynamically. Unlike offline methods, this approach analyzes the distribution of checkpoints during the forward pass to decide when to discard old states in favor of the current one.
The algorithm is proven to be "time-minimal," meaning it achieves the absolute minimum number of recomputations for a given number of checkpoints $c$, provided the total steps $l$ do not exceed a bound $b_c$.
As shown in the table above, the "safe zone" $b_c$ grows quadratically with the number of checkpoints. For instance, with 80 checkpoints, the algorithm maintains optimality for over 3,300 time steps, covering the requirements of most practical engineering applications.
Experimental Results
The method was implemented within the HiFlow parallel finite-element package and evaluated using a 3D benchmark channel flow around a square cylinder. The test cases involved up to 10 million unknowns, where full storage of the forward pass is impossible.
The online method was compared against the traditional two-pass approach across various mesh refinements:
| Setup | Unknowns | Time Steps ($l$) | Checkpoints ($c$) | Extra Steps (Online) | Extra Steps (Two-Pass) |
|---|---|---|---|---|---|
| Global Refinement | $1.2 \times 10^6$ | 912 | 600 | 310 | 1222 |
| Global Refinement | $1.0 \times 10^7$ | 702 | 36 | 664 | 1366 |
| Local Refinement | $8.2 \times 10^5$ | 854 | 715 | 137 | 991 |
In every scenario, the online method eliminated the need for the initial counting pass, saving exactly $l$ forward evaluations. In the most memory-constrained case (10 million unknowns with only 36 checkpoints), the efficiency gains were most pronounced, demonstrating the viability of the approach for large-scale parallel simulations.
Conclusion
The proposed online checkpointing algorithm effectively solves the memory bottleneck for adjoint-based PDE simulations with adaptive time-stepping. By providing a time-minimal strategy that operates on the fly, it eliminates the inefficiencies of multi-pass methods and scales effectively to high-fidelity 3D flows on parallel architectures.
Summary updated