|
SpECTRE
2021.08.02
|
Phase control object for temporarily visiting TargetPhase, until the algorithm halts again, then returning to the original phase.
More...
#include <VisitAndReturn.hpp>
Public Types | |
| using | options = tmpl::list<> |
| using | argument_tags = tmpl::list<> |
| using | return_tags = tmpl::list<> |
| using | phase_change_tags_and_combines = tmpl::list< Tags::ReturnPhase< TargetPhase >, Tags::TemporaryPhaseRequested< TargetPhase > > |
| template<typename LocalMetavariables > | |
| using | participating_components = typename LocalMetavariables::component_list |
Public Member Functions | |
| template<typename... DecisionTags> | |
| void | initialize_phase_data_impl (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data) const noexcept |
| template<typename ParallelComponent , typename ArrayIndex , typename LocalMetavariables > | |
| void | contribute_phase_data_impl (Parallel::GlobalCache< LocalMetavariables > &cache, const ArrayIndex &array_index) const noexcept |
| template<typename... DecisionTags, typename LocalMetavariables > | |
| std::optional< std::pair< typename Metavariables::Phase, ArbitrationStrategy > > | arbitrate_phase_change_impl (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data, const typename LocalMetavariables::Phase current_phase, const Parallel::GlobalCache< LocalMetavariables > &) const noexcept |
| void | pup (PUP::er &) noexcept override |
Static Public Member Functions | |
| static std::string | name () noexcept |
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.
To determine which specialization of this template is requested from the input file, the Metavariables must define a phase_name(Phase) static member function that returns a string for each phase that will be used in VisitAndReturns.
TargetPhases), then the order of phase jumps depends on their order in the list.VisitAndReturns 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 |