8 #include "AlgorithmSingleton.hpp" 14 #include "Parallel/InitializationFunctions.hpp" 15 #include "Parallel/Invoke.hpp" 31 template <
typename DbTags,
typename... InboxTags,
typename Metavariables,
32 typename ArrayIndex,
typename ActionList,
33 typename ParallelComponent>
39 const ParallelComponent*
const ) {
41 Parallel::get<OptionTags::Name>(cache),
49 template <
class Metavariables>
51 using const_global_cache_tag_list = tmpl::list<OptionTags::Name>;
52 using chare_type = Parallel::Algorithms::Singleton;
53 using metavariables = Metavariables;
54 using action_list = tmpl::list<>;
56 using options = tmpl::list<>;
57 static void initialize(Parallel::CProxy_ConstGlobalCache<
58 Metavariables>& ) noexcept {}
59 static void execute_next_phase(
60 const typename Metavariables::Phase next_phase,
61 Parallel::CProxy_ConstGlobalCache<Metavariables>& global_cache) noexcept;
64 template <
class Metavariables>
65 void HelloWorld<Metavariables>::execute_next_phase(
66 const typename Metavariables::Phase ,
67 Parallel::CProxy_ConstGlobalCache<Metavariables>& global_cache) noexcept {
68 Parallel::simple_action<Actions::PrintMessage>(
69 Parallel::get_parallel_component<HelloWorld>(
70 *(global_cache.ckLocalBranch())));
76 using const_global_cache_tag_list = tmpl::list<>;
78 using component_list = tmpl::list<HelloWorld<Metavars>>;
81 "Say hello from a singleton parallel component."};
85 static Phase determine_next_phase(
const Phase& current_phase,
86 const Parallel::CProxy_ConstGlobalCache<
87 Metavars>& ) noexcept {
88 return current_phase == Phase::Initialization ? Phase::Execute
96 &setup_error_handling};
Defines functions for interfacing with the parallelization framework.
Items for initializing the DataBoxes of parallel components.
Definition: ConservativeSystem.hpp:21
Defines classes and functions for making classes creatable from input files.
int my_proc()
Index of my processing element.
Definition: Info.hpp:22
constexpr auto apply(F &&f, const DataBox< BoxTags > &box, Args &&... args)
Apply the function f with argument Tags TagsList from DataBox box
Definition: DataBox.hpp:1595
int my_node()
Index of my node.
Definition: Info.hpp:34
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:27
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Defines classes and functions used for manipulating DataBox's.
void enable_floating_point_exceptions()
After a call to this function, the code will terminate with a floating point exception on overflow...
Definition: FloatingPointExceptions.cpp:27
Defines Parallel::printf for writing to stdout.
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
A Charm++ chare that caches constant data once per Charm++ node.
Definition: ConstGlobalCache.hpp:76
Functions to enable/disable termination on floating point exceptions.
Defines class template ConstGlobalCache.
void printf(const std::string &format, Args &&... args)
Print an atomic message to stdout with C printf usage.
Definition: Printf.hpp:100
Definition: ComputeTimeDerivative.hpp:28