Repository navigation
Feature/flow snapshots - #51
Merged
Merged
Conversation
A run can now write its complete state at chosen RG scales (/timestepping/snapshots/k or /t, --snapshots-k/-t) to <run>_snapshot_<nnn>.h5, and a later run can continue from such a snapshot (/restart/file, --restart) instead of starting at Lambda, possibly with a changed configuration whose differences are logged. Intended for parameter scans such as phase diagrams, IR debugging and continuing runs cut off by wall-time limits. - AbstractTimestepper::run is now a non-virtual driver that splits the flow into segments at snapshot times; steppers implement run_segment. Only at segment ends does every stepper (incl. the IDA + explicit hybrids) hold its exact accepted state. - The spatial state is stored cell by cell (CellId + local dof values), independent of dof numbering and MPI rank count; adapted meshes are rebuilt from the cell ids. - Optional model hooks save_state/load_state carry history-dependent model state (used by the QuarkMesonLPAprime example). - Python helpers (file_io.snapshots, phasediagram.make_seed, run_point(restart=)) and Mathematica SnapshotInfo/ListSnapshots. Fixes found on the way: t_start > 0 handling in the IDA-family, TRBDF2 and TC_Default steppers; explicit Euler, Boost ABM and BoostRK (variables) now end exactly at t_stop; HAdaptivity's uninitialised last_adapt; phasediagram.get_command without folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The snapshot's configuration is serialized by Boost.JSON as 2E-2 etc., which Mathematica's RawJSON import reads as exact rationals (1/50). Convert them to reals. Verified SnapshotInfo/ListSnapshots against a real QuarkMesonLPAprime snapshot, including a NaN k (no Lambda), which Import returns as $Failed and SnapshotInfo maps to Indeterminate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinearCoordinates1D, LogarithmicCoordinates1D and FocusedLogCoordinates1D gain prefix(n): the first n points of the grid as a grid of the same type, with forward(i) bit-identical to the parent's for i < n and backward() unchanged. Mapping a kernel over prefix(n) fills exactly the first n entries it would fill over the full grid, so the upper end of a grid (e.g. momenta p >> k whose loops have decoupled) can be skipped without a different coordinate type -- SubCoordinates is the general window, but kernels generated against a concrete coordinate type cannot take it without being regenerated. The spacing is copied, not re-derived: LogarithmicCoordinates1D's forward() divides the index by the point count, so a grid rebuilt from n points would be a different grid, and the other two would move by an ulp. A prefix therefore keeps its parent's parameters and point count (parent_size()) and renders as "<parent>.prefix(n)" in to_string(), which operator== follows, so position caches and HDF5 datasets keyed on it never confuse it with its parent or with a genuine n-point grid. Grids that are not prefixes render and compare exactly as before. Conversions between number types keep the prefix. Not added to LinearPeriodicCoordinates1D (a prefix of a periodic axis is not periodic, but would still fold in backward() and wrap in the interpolators) or CoordinatePackND (no single axis to cut; SubCoordinates covers windows). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r TRBDF2 on failure. other minor fixes
…o-continue if timeouts occured, etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New feature: Snapshot a run at fixed t/k and continue future runs from that scale. Useful for debugging, phase diagrams, etc.