dragonfly_sim.utils.checkpoint
Partition-independent checkpoints for time-dependent runs.
A checkpoint is one .npz written on rank 0. Every DG field is stored per cell, keyed by the cell’s index in the INPUT mesh (topology.original_cell_index) and the cell-local dof order, so a run may be restarted on any number of ranks. The dof coordinates are stored as well and checked on load.
Functions
(owned cells' input-mesh indices, their dof blocks, the dof coordinates). |
|
|
Fill functions from a save_checkpoint file, on any rank count, and |
|
Write functions (DG Functions on one mesh, distinct names) and the JSON |
Module Contents
- dragonfly_sim.utils.checkpoint._owned_cell_dofs(V)
(owned cells’ input-mesh indices, their dof blocks, the dof coordinates).
- dragonfly_sim.utils.checkpoint.load_checkpoint(path, functions, coord_tol=1e-10, optional=False)
Fill functions from a save_checkpoint file, on any rank count, and return its meta dict. With optional=True a field missing from the file is left untouched instead of raising (e.g. far-field history when restarting a riemann2 run from a plain riemann checkpoint).
- dragonfly_sim.utils.checkpoint.save_checkpoint(path, functions, meta)
Write functions (DG Functions on one mesh, distinct names) and the JSON serializable dict meta to path. The dof coordinates are stored as “coords” for the first function’s space and “<name>__coords” for any function on another space. Collective.