Line data Source code
1 0 : // 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 : * - component_type: this object. Serves to allow checking the component type in
29 : * both source code and the testing framework.
30 : */
31 1 : struct Singleton {
32 : template <typename ParallelComponent, typename SpectreArrayIndex>
33 0 : using cproxy =
34 : CProxy_AlgorithmSingleton<ParallelComponent, SpectreArrayIndex>;
35 :
36 : template <typename ParallelComponent, typename SpectreArrayIndex>
37 0 : using cbase = CBase_AlgorithmSingleton<ParallelComponent, SpectreArrayIndex>;
38 :
39 : template <typename ParallelComponent, typename SpectreArrayIndex>
40 0 : using algorithm_type =
41 : AlgorithmSingleton<ParallelComponent, SpectreArrayIndex>;
42 :
43 : template <typename ParallelComponent, typename SpectreArrayIndex>
44 0 : using ckindex =
45 : CkIndex_AlgorithmSingleton<ParallelComponent, SpectreArrayIndex>;
46 :
47 : template <typename ParallelComponent, typename SpectreArrayIndex>
48 0 : using cproxy_section = void;
49 :
50 0 : using component_type = Singleton;
51 : };
52 : } // namespace Algorithms
53 : } // namespace Parallel
|