12 #include "Parallel/PhaseControl/PhaseChange.hpp"
13 #include "Parallel/Reduction.hpp"
15 #include "ParallelAlgorithms/EventsAndTriggers/Trigger.hpp"
16 #include "Utilities/Registration.hpp"
18 #include "Utilities/TaggedTuple.hpp"
31 template <
typename Tag,
typename CombineMethod,
32 typename MainCombineMethod = CombineMethod>
35 using combine_method = CombineMethod;
36 using main_combine_method = MainCombineMethod;
43 template <
typename... Tags>
47 tmpl::for_each<tmpl::list<Tags...>>(
48 [¤t_state, &element](
auto tag_v) noexcept {
49 using tag =
typename decltype(tag_v)::type;
50 tuples::get<tag>(current_state) =
typename tag::combine_method{}(
51 tuples::get<tag>(current_state), tuples::get<tag>(element));
67 template <
typename... CurrentTags,
typename... CombineTags>
71 tmpl::for_each<tmpl::list<CombineTags...>>(
72 [¤t_state, &element](
auto tag_v) noexcept {
73 using tag =
typename decltype(tag_v)::type;
74 tuples::get<tag>(*current_state) =
75 typename tag::main_combine_method{}(
76 tuples::get<tag>(*current_state), tuples::get<tag>(element));
89 template <
typename TagsAndCombinesPresent,
typename TagsAndCombines>
91 tuples::tagged_tuple_from_typelist<TagsAndCombinesPresent>,
94 namespace OptionTags {
118 template <
typename PhaseChangeRegistrars,
typename TriggerRegistrars>
123 "A collection of pairs of triggers and collections of phase change "
124 "objects to determine runtime phase control-flow decisions. The order of "
125 "the phase change objects determines the order of the requests processed "
126 "by the Main chare during phase change arbitration."};
138 template <
typename PhaseChangeRegistrars,
typename TriggerRegistrars>
149 static constexpr
bool pass_metavariables =
false;
150 static type create_from_options(
151 const type& phase_control_and_triggers) noexcept {
152 return deserialize<type>(
153 serialize<type>(phase_control_and_triggers).data());
158 namespace TagsAndCombines {
175 template <
typename PhaseChangeDerived>
176 struct get_phase_change_tags_and_combines {
177 using type =
typename PhaseChangeDerived::phase_change_tags_and_combines;
184 template <
typename PhaseChangeRegistrars>
188 detail::get_phase_change_tags_and_combines<tmpl::_1>>>,
Contains utilities for determining control-flow among phases.
Definition: ExecutePhaseChange.hpp:17
The data to be reduced, and invokables to be called whenever two reduction messages are combined and ...
Definition: Reduction.hpp:63
A flexible combine invokable that combines into a tuples::TaggedTuple a new tuples::TaggedTuple,...
Definition: PhaseControlTags.hpp:42
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
A flexible combine invokable that combines into a tuples::TaggedTuple a new tuples::TaggedTuple with ...
Definition: PhaseControlTags.hpp:66
CoordinateMap< SourceFrame, TargetFrame, Maps..., NewMap > push_back(CoordinateMap< SourceFrame, TargetFrame, Maps... > old_map, NewMap new_map) noexcept
Creates a CoordinateMap by appending the new map to the end of the old maps.
tmpl::push_back< tmpl::flatten< tmpl::transform< Registration::registrants< PhaseChangeRegistrars >, detail::get_phase_change_tags_and_combines< tmpl::_1 > >>, TagsAndCombines::UsePhaseChangeArbitration > get_phase_change_tags
Metafunction for determining the merged collection of tags in phase_change_tags_and_combines_lists fr...
Definition: PhaseControlTags.hpp:189
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
Definition: Trigger.hpp:34
A type for denoting a piece of data for deciding a phase change.
Definition: PhaseControlTags.hpp:33
Parallel::ReductionData< Parallel::ReductionDatum< tuples::tagged_tuple_from_typelist< TagsAndCombinesPresent >, TaggedTupleCombine > > reduction_data
A Parallel::ReductionData with a single Parallel::ReductionDatum for a given tagged tuple type determ...
Definition: PhaseControlTags.hpp:92
PhaseChange objects determine the storage types and logic for moving between phases based on runtime ...
Definition: PhaseChange.hpp:140
const char *const String
The string used in option structs.
Definition: Options.hpp:32
tmpl::transform< tmpl::remove_duplicates< RegistrarList >, detail::registrant< tmpl::pin< tmpl::remove_duplicates< RegistrarList > >, tmpl::_1 > > registrants
Transform a list of registrars into the list of associated registrants. This is usually used to defin...
Definition: Registration.hpp:65
Functional for computing or of two objects.
Definition: Functional.hpp:240
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13