SpECTRE
v2025.03.17
|
Phase control object for temporarily visiting TargetPhase
, until the algorithm halts again, then returning to the original phase.
More...
#include <VisitAndReturn.hpp>
Public Member Functions | |
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 &) 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 Member Functions | |
static std::string | name () |
Static Public Attributes | |
static constexpr Options::String | help |
Phase control object for temporarily visiting TargetPhase
, until the algorithm halts again, then returning to the original phase.
The motivation for this type of procedure is e.g. load balancing, checkpointing, and other maintenance tasks that should be performed periodically during a lengthy evolution. Once triggered, this will cause a change to TargetPhase
, but store the current phase to resume execution when the tasks in TargetPhase
are completed.
Any parallel component can participate in the associated phase change reduction data contribution, and if any component requests the temporary phase, it will execute.
TargetPhase
s), then the order of phase jumps depends on their order in the list.VisitAndReturn
s trigger simultaneously, then they will visit in sequence specified by the input file: first going to the first TargetPhase
until that phase resolves, then immediately entering the second TargetPhase
(without yet returning to the original phase), then finally returning to the original phase.VisitAndReturn
is triggered in a phase that is already a TargetPhase
of another VisitAndReturn
, it will be executed, and following completion, control will return to the original phase from before the first VisitAndReturn
.
|
staticconstexpr |