AlgorithmSingletonDeclarations.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include "Parallel/ArrayIndex.hpp"
7 
8 #include "Parallel/Algorithms/AlgorithmSingleton.decl.h"
9 
10 namespace Parallel {
11 namespace Algorithms {
12 
13 /*!
14  * \ingroup ParallelGroup
15  * \brief A struct that stores the charm++ types relevant for a particular
16  * singleton component
17  *
18  * \details The type traits are:
19  * - `cproxy`: the charm++ proxy.
20  * See https://charm.readthedocs.io/en/latest/faq/manual.html#what-is-a-proxy
21  * - `cbase`: the charm++ base class. See
22  * https://charm.readthedocs.io/en/latest/charm++/manual.html#chare-objects
23  * - `algorithm_type`: the chare type (`AlgorithmSingleton`) for the singleton
24  * component.
25  * - `ckindex`: A charm++ chare index object. Useful for obtaining entry
26  * method indices that are needed for creating callbacks. See
27  * https://charm.readthedocs.io/en/latest/charm++/manual.html#creating-a-ckcallback-object
28  */
29 struct Singleton {
30  template <typename ParallelComponent,
31  typename SpectreArrayIndex>
32  using cproxy = CProxy_AlgorithmSingleton<ParallelComponent,
33  SpectreArrayIndex>;
34 
35  template <typename ParallelComponent,
36  typename SpectreArrayIndex>
37  using cbase = CBase_AlgorithmSingleton<ParallelComponent,
38  SpectreArrayIndex>;
39 
40  template <typename ParallelComponent,
41  typename SpectreArrayIndex>
42  using algorithm_type = AlgorithmSingleton<ParallelComponent,
43  SpectreArrayIndex>;
44 
45  template <typename ParallelComponent,
46  typename SpectreArrayIndex>
47  using ckindex = CkIndex_AlgorithmSingleton<ParallelComponent,
48  SpectreArrayIndex>;
49 };
50 } // namespace Algorithms
51 } // namespace Parallel
Parallel::Algorithms::Singleton
A struct that stores the charm++ types relevant for a particular singleton component.
Definition: AlgorithmSingletonDeclarations.hpp:29
AlgorithmSingleton
A Spectre algorithm object that wraps a charm++ singleton chare.
Definition: AlgorithmSingleton.hpp:43