for restart capabilities.
simulation state to a file. This allows a simulation to be stopped and resumed from the exact state it was in.
Key features include: - Reading all checkpoint settings from a configuration file - Periodically writing the full-resolution simulation state - Handling the full logic for restarting a simulation from a specified checkpoint file. - A safe-write strategy that writes to a temporary file first, then atomically renames it to the final filename to prevent corrupted checkpoints. - Optional cleanup of old checkpoint files to conserve disk space.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(checkpoint_config_t), | public | :: | config | ||||
| integer, | public | :: | last_checkpoint_step | = | -1 | ||
| integer, | public, | dimension(3) | :: | full_resolution | = | [1, 1, 1] | |
| type(field_buffer_map_t), | public, | allocatable | :: | field_buffers(:) | |||
| integer(kind=i8), | public, | dimension(3) | :: | last_shape_dims | = | 0 | |
| integer, | public, | dimension(3) | :: | last_stride_factors | = | 0 | |
| integer(kind=i8), | public, | dimension(3) | :: | last_output_shape | = | 0 |
| procedure, public :: init | |
| procedure, public :: handle_restart | |
| procedure, public :: handle_checkpoint_step | |
| procedure, public :: is_restart | |
| procedure, public :: finalise |