Skip to content

Checkpointing using algorithm 799 - #19

Open
rvuchkov007 wants to merge 11 commits into
mainfrom
vuchkov-revolve-checkpointing
Open

Checkpointing using algorithm 799#19
rvuchkov007 wants to merge 11 commits into
mainfrom
vuchkov-revolve-checkpointing

Conversation

@rvuchkov007

Copy link
Copy Markdown
Collaborator

Implemented Algorithm 799, along with unit tests, and verifications

Algorithm 799 implementation
src/tools/revolve.hpp

Unite tests
unit_tests/checkpointing/revolve.cpp
unit_tests/checkpointing/CMakeLists.txt

Changes
SolverManager::takeForwardStep
SolverManager::checkpointedAdjointModel

regression/thermal/2D_transient_checkpointed_adjoint/ -- end-to-end test.

Radoslav vuchkov and others added 9 commits July 25, 2026 14:06
std::string::ends_with is C++20; the build uses -std=c++17, so replace
the two uses in importSensorsFromFiles with an equivalent compare().

Also refreshes 20 regression baselines that gained a mesh-construction
log line from the current Trilinos version.
- num_steps was rounded from (final_time-initial_time)/deltat instead of
  counted the way transientSolver's loop counts, so a delta t that does not
  divide the interval reversed the wrong number of steps
- guard on maxnumsteps/maxnumstages as well as numsteps/numstages: BDF2 with a
  BDF1 startup leaves numsteps at 1 while maxnumsteps stays 2, which sized the
  history handed to the adjoint solver out of bounds
- reset the cached Jacobian at each forward/adjoint transition: the sweep
  alternates operators, so with reuse Jacobian on the adjoint solve was
  reusing the forward matrix
- unit test returns 0 or 1 rather than the raw failure count, which POSIX
  truncates to 8 bits
- guard against int overflow in the schedule action limit
- simulate the driver's slot bookkeeping in the unit test, so a next() that
  keeps every count right but hands back the wrong slot is caught
- assert beta's zero and negative argument conventions, which the three-case
  placement rule depends on
- cover all three branches of placementOffset with literals; both existing
  ones landed in the same branch
- document beta's exact domain and correct the member doc for
  num_checkpoints_stored_, which described the 1-based MATLAB convention
- restore the banner comments and the original author's note dropped during
  the takeForwardStep extraction
@rvuchkov007
rvuchkov007 requested a review from TimWildey August 9, 2026 23:23
@Alexey-Voronin

Copy link
Copy Markdown
Contributor

Great to see check-pointing making it's way in.

One comment I wanted to make is that p=0 | CubeHexMesh: Building sub cells is a panzer stk print that doesn't exists in the new Trillions version, so these tests may fail once you update the trilinos.

@rvuchkov007
rvuchkov007 requested review from GrahamBenHarper and removed request for TimWildey August 24, 2026 18:54
Newer Trilinos versions no longer print 'CubeHexMesh: Building sub cells'
when the mesh is built, so gold files that carry the line start failing
as soon as Trilinos is updated.  Twenty gold files on this branch had
picked it up.  Filter the line in clean_log next to the existing IOSS
filter and drop it from the gold files, so the tests pass with either
Trilinos.  Checked against Trilinos 17.1.1, which does not print it:
maxwell/PlaneWave and thermal/2D_transient_checkpointed_adjoint both
pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants