Conforming types register and deregister array elements with other parallel components.
For example, array elements may have to register and deregister with interpolators or observers when the elements get created and destroyed during AMR or migrated during load balancing. They may do so by sending messages to the parallel components that notify of the creation and destruction of the array elements.
static void perform_registration<ParallelComponent>(const
const ArrayIndex& array_index)
static void perform_deregistration<ParallelComponent>(const
const ArrayIndex& array_index)
A Charm++ chare that caches global data once per Charm++ node.
Definition: GlobalCache.hpp:222
struct RegisterElement :
tt::ConformsTo<Parallel::protocols::ElementRegistrar> {
private:
template <typename ParallelComponent, typename RegisterOrDeregisterAction,
typename DbTagList, typename Metavariables, typename ArrayIndex>
static void register_or_deregister_impl(
db::DataBox<DbTagList>& ,
const ArrayIndex& array_index) {
Parallel::simple_action<RegisterOrDeregisterAction>(registrar, array_index);
}
public:
template <typename ParallelComponent, typename DbTagList,
typename Metavariables, typename ArrayIndex>
static void perform_registration(db::DataBox<DbTagList>& box,
const ArrayIndex& array_index) {
register_or_deregister_impl<ParallelComponent, RegisterWithRegistrant>(
box, cache, array_index);
}
template <typename ParallelComponent, typename DbTagList,
typename Metavariables, typename ArrayIndex>
static void perform_deregistration(
const ArrayIndex& array_index) {
register_or_deregister_impl<ParallelComponent, DeregisterWithRegistrant>(
box, cache, array_index);
}
};
auto get_parallel_component(GlobalCache< Metavariables > &cache) -> 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:750
auto * local_branch(Proxy &&proxy)
Wrapper for calling Charm++'s .ckLocalBranch() on a proxy.
Definition: Local.hpp:48