SpECTRE
v2025.03.17
|
Phase control object that runs the WriteCheckpoint and Exit phases after a specified amount of wallclock time has elapsed. More...
#include <CheckpointAndExitAfterWallclock.hpp>
Classes | |
struct | WallclockHours |
Public Member Functions | |
CheckpointAndExitAfterWallclock (const std::optional< double > wallclock_hours, const Options::Context &context={}) | |
CheckpointAndExitAfterWallclock (CkMigrateMessage *msg) | |
template<typename... DecisionTags> | |
void | initialize_phase_data_impl (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data) const |
template<typename ParallelComponent , typename ArrayIndex , typename Metavariables > | |
void | contribute_phase_data_impl (Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index) const |
template<typename... DecisionTags, typename Metavariables > | |
std::optional< std::pair< Parallel::Phase, ArbitrationStrategy > > | arbitrate_phase_change_impl (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data, const Parallel::Phase current_phase, const Parallel::GlobalCache< Metavariables > &) const |
void | pup (PUP::er &p) override |
![]() | |
PhaseChange (CkMigrateMessage *msg) | |
WRAPPED_PUPable_abstract (PhaseChange) | |
template<typename ParallelComponent , typename DbTags , typename Metavariables , typename ArrayIndex > | |
void | contribute_phase_data (const gsl::not_null< db::DataBox< DbTags > * > box, Parallel::GlobalCache< Metavariables > &cache, const ArrayIndex &array_index) const |
Send data from all participating_components to the Main chare for determining the next phase. | |
template<typename... DecisionTags, typename Metavariables > | |
std::optional< std::pair< Parallel::Phase, PhaseControl::ArbitrationStrategy > > | arbitrate_phase_change (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data, const Parallel::Phase current_phase, const Parallel::GlobalCache< Metavariables > &cache) const |
Determine a phase request and PhaseControl::ArbitrationStrategy based on aggregated phase_change_decision_data on the Main Chare. | |
template<typename Metavariables , typename... Tags> | |
void | initialize_phase_data (const gsl::not_null< tuples::TaggedTuple< Tags... > * > phase_change_decision_data) const |
Initialize the phase_change_decision_data on the main chare to starting values. | |
Static Public Attributes | |
static constexpr Options::String | help |
Phase control object that runs the WriteCheckpoint and Exit phases after a specified amount of wallclock time has elapsed.
When the executable exits from here, it does so with Parallel::ExitCode::ContinueFromCheckpoint
.
This phase control is useful for running SpECTRE executables performing lengthy computations that may exceed a supercomputer's wallclock limits. Writing a single checkpoint at the end of the job's allocated time allows the computation to be continued, while minimizing the disc space taken up by checkpoint files.
When restarting from the checkpoint, this phase control sends the control flow to a UpdateOptionsAtRestartFromCheckpoint phase, allowing the user to update (some) simulation parameters for the continuation of the run.
Note that this phase control is not a trigger on wallclock time. Rather, it checks the elapsed wallclock time when called, likely from a global sync point triggered by some other mechanism, e.g., at some slab boundary. Therefore, the WriteCheckpoint and Exit phases will run the first time this phase control is called after the specified wallclock time has been reached.
|
staticconstexpr |