12 #include "IO/Observer/Actions/ObserverRegistration.hpp"
13 #include "IO/Observer/ObserverComponent.hpp"
14 #include "IO/Observer/TypeOfObservation.hpp"
17 #include "Parallel/Invoke.hpp"
18 #include "Parallel/ParallelComponentHelpers.hpp"
20 #include "Utilities/TaggedTuple.hpp"
29 template <
typename RegisterHelper>
31 template <
typename DbTagList,
typename... InboxTags,
typename Metavariables,
32 typename ArrayIndex,
typename ActionList,
33 typename ParallelComponent>
35 db::DataBox<DbTagList>& box,
38 const ArrayIndex& array_index,
const ActionList ,
39 const ParallelComponent*
const ) noexcept {
40 const auto [type_of_observation, observation_key] =
41 RegisterHelper::template register_info<ParallelComponent>(box,
44 switch (type_of_observation) {
49 "Registering volume observations is not supported for singletons. "
50 "The TypeOfObservation should be 'Reduction'.");
53 "Registering an unknown TypeOfObservation. It should be "
54 "'Reduction' for singleton.");
59 auto& my_proxy = Parallel::get_parallel_component<ParallelComponent>(
cache);
60 Parallel::simple_action<Actions::RegisterReductionNodeWithWritingNode>(
65 return {std::move(box),
true};
Definition: ElementReceiveInterpPoints.hpp:15
auto get_parallel_component(GlobalCache< Metavariables > &cache) noexcept -> Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag >> &
Access the Charm++ proxy associated with a ParallelComponent.
Definition: GlobalCache.hpp:535
#define ERROR(m)
prints an error message to the standard error stream and aborts the program.
Definition: Error.hpp:36
The nodegroup parallel component that is responsible for writing data to disk.
Definition: ObserverComponent.hpp:51
int my_node(const DistribObject &distributed_object) noexcept
Index of my node.
Definition: Info.hpp:51
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
Registers a singleton with the ObserverWriter.
Definition: RegisterSingleton.hpp:30
Parallel::GlobalCache< Metavariables > & cache(MockRuntimeSystem< Metavariables > &runner, const ArrayIndex &array_index) noexcept
Returns the GlobalCache of Component with index array_index.
Definition: MockRuntimeSystemFreeFunctions.hpp:362
@ Volume
The sender will only perform volume observations.
@ Reduction
The sender will only perform reduction observations.
Actions used by the observer parallel component
Definition: GetLockPointer.hpp:13