|
SpECTRE
v2026.04.01
|
Contains utilities for determining control-flow among phases. More...
Classes | |
| struct | CheckpointAndExitAfterWallclock |
| Phase control object that runs the WriteCheckpoint and Exit phases after a specified amount of wallclock time has elapsed. More... | |
| struct | TagAndCombine |
| A type for denoting a piece of data for deciding a phase change. More... | |
| struct | TaggedTupleCombine |
| A flexible combine invokable that combines into a tuples::TaggedTuple a new tuples::TaggedTuple, and combines according to type aliases combination_methods that are required to be defined in each tag. More... | |
| struct | TaggedTupleMainCombine |
| A flexible combine invokable that combines into a tuples::TaggedTuple a new tuples::TaggedTuple with a subset of the original tags, and combines according to type aliases main_combine_methods that are required to be defined in each tag. More... | |
| struct | TriggerAndPhaseChanges |
| Option-creatable pair of a trigger and associated phase change objects. More... | |
| struct | VisitAndReturn |
| Phase control object for temporarily visiting TargetPhase, until the algorithm halts again, then returning to the original phase. More... | |
Typedefs | |
| using | factory_creatable_classes |
| template<typename Metavariables> | |
| using | get_phase_change_tags |
| Metafunction for determining the merged collection of tags in phase_change_tags_and_combiness from all PhaseChange derived classes in Metavariables::factory_creation | |
| template<typename TagsAndCombinesPresent, typename TagsAndCombines> | |
| using | reduction_data |
| A Parallel::ReductionData with a single Parallel::ReductionDatum for a given tagged tuple type determined by TagsPresent, and performs the combine according to TagsAndCombines, which must be a tmpl::list of PhaseControl::TagAndCombines. | |
Enumerations | |
| enum | ArbitrationStrategy { RunPhaseImmediately , PermitAdditionalJumps } |
| The possible options for instructing the Main chare in deciding the next phase to jump to. More... | |
Functions | |
| template<typename... DecisionTags, typename Metavariables> | |
| std::optional< Parallel::Phase > | arbitrate_phase_change (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data, Parallel::Phase current_phase, const Parallel::GlobalCache< Metavariables > &cache) |
| Use the runtime data aggregated in phase_change_decision_data to decide which phase to execute next. | |
| template<typename... DecisionTags, typename Metavariables> | |
| void | initialize_phase_change_decision_data (const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > phase_change_decision_data, const Parallel::GlobalCache< Metavariables > &cache) |
| Initialize the Main chare's phase_change_decision_data for the option-selected PhaseChanges. | |
Contains utilities for determining control-flow among phases.
| using PhaseControl::factory_creatable_classes |
| using PhaseControl::get_phase_change_tags |
Metafunction for determining the merged collection of tags in phase_change_tags_and_combiness from all PhaseChange derived classes in Metavariables::factory_creation
| using PhaseControl::reduction_data |
A Parallel::ReductionData with a single Parallel::ReductionDatum for a given tagged tuple type determined by TagsPresent, and performs the combine according to TagsAndCombines, which must be a tmpl::list of PhaseControl::TagAndCombines.
Each tag in the TagsAndCombinesPresent may either be a TagsAndCombines or otherise define all three type traits type, combine_method, and main_combine_method.
The possible options for instructing the Main chare in deciding the next phase to jump to.
An object of this enum type is packaged with a requested phase in the PhaseChange::arbitrate_phase_change function.
| std::optional< Parallel::Phase > PhaseControl::arbitrate_phase_change | ( | const gsl::not_null< tuples::TaggedTuple< DecisionTags... > * > | phase_change_decision_data, |
| Parallel::Phase | current_phase, | ||
| const Parallel::GlobalCache< Metavariables > & | cache ) |
Use the runtime data aggregated in phase_change_decision_data to decide which phase to execute next.
This function will iterate through each of the option-created pairs of PhaseChanges, and obtain from each a std::optional<std::pair<Parallel::Phase, PhaseControl::ArbitrationStrategy>. Any std::nullopt is skipped. If all PhaseChanges provide std::nullopt, the phase will either keep its current value (if the halt was caused by one of the triggers associated with an option-created PhaseChange), or this function will return a std::nullopt as well (otherwise), indicating that the phase should proceed according to other information, such as global ordering.
In the case of a PhaseControl::ArbitrationStrategy::RunPhaseImmediately, the first such return value is immediately run, and no further PhaseChanges are queried for their input.