SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
Parallel::protocols::ElementRegistrar Struct Reference

Conforming types register and deregister array elements with other parallel components. More...

#include <ElementRegistrar.hpp>

Classes

struct  test

Detailed Description

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.

Conforming classes have the following static member functions:

static void perform_registration<ParallelComponent>(const
db::DataBox<DbTagList>& box, Parallel::GlobalCache<Metavariables>& cache,
const ArrayIndex& array_index)
static void perform_deregistration<ParallelComponent>(const
db::DataBox<DbTagList>& box, Parallel::GlobalCache<Metavariables>& cache,
const ArrayIndex& array_index)
A Charm++ chare that caches global data once per Charm++ node.
Definition GlobalCache.hpp:223
The array index used for indexing Chare Arrays, mostly an implementation detail.
Definition ArrayIndex.hpp:28

Here is an example implementation of this protocol:

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>& /*box*/,
Parallel::GlobalCache<Metavariables>& cache,
const ArrayIndex& array_index) {
auto& registrar = *Parallel::local_branch(
Parallel::get_parallel_component<Registrar<Metavariables>>(cache));
}
public:
template <typename ParallelComponent, typename DbTagList,
typename Metavariables, typename ArrayIndex>
static void perform_registration(db::DataBox<DbTagList>& box,
Parallel::GlobalCache<Metavariables>& cache,
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(
db::DataBox<DbTagList>& box, Parallel::GlobalCache<Metavariables>& cache,
const ArrayIndex& array_index) {
register_or_deregister_impl<ParallelComponent, DeregisterWithRegistrant>(
box, cache, array_index);
}
};

The documentation for this struct was generated from the following file:
  • src/Parallel/Protocols/ElementRegistrar.hpp