Tags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <lrtslock.h>
8 #include <string>
9 #include <unordered_map>
10 #include <unordered_set>
11 #include <vector>
12 
14 #include "DataStructures/DataVector.hpp"
15 #include "DataStructures/Tensor/TensorData.hpp"
16 #include "IO/Observer/ArrayComponentId.hpp"
17 #include "IO/Observer/ObservationId.hpp"
18 #include "Options/Options.hpp"
19 #include "Parallel/Reduction.hpp"
20 
21 namespace observers {
22 /// \ingroup ObserversGroup
23 /// %Tags used on the observer parallel component
24 namespace Tags {
25 /// The number of events registered with the observer.
27  using type =
29  static std::string name() noexcept { return "NumberOfEvents"; }
30 };
31 
32 /// All the ids of all the components registered to an observer for doing
33 /// reduction observations.
36  static std::string name() noexcept { return "ReductionArrayComponentIds"; }
37 };
38 
39 /// All the ids of all the components registered to an observer for doing
40 /// volume observations.
43  static std::string name() noexcept { return "VolumeArrayComponentIds"; }
44 };
45 
46 /// Volume tensor data to be written to disk.
48  static std::string name() noexcept { return "TensorData"; }
49  using type =
53 };
54 
55 /// \cond
56 template <class... ReductionDatums>
57 struct ReductionDataNames;
58 /// \endcond
59 
60 /// Reduction data to be written to disk.
61 template <class... ReductionDatums>
63  static std::string name() noexcept { return "ReductionData"; }
65  Parallel::ReductionData<ReductionDatums...>>;
66  using names_tag = ReductionDataNames<ReductionDatums...>;
67 };
68 
69 /// Names of the reduction data to be written to disk.
70 template <class... ReductionDatums>
72  static std::string name() noexcept { return "ReductionDataNames"; }
73  using type =
75  using data_tag = ReductionData<ReductionDatums...>;
76 };
77 
78 /// The number of nodes that have contributed to the reduction data so far.
80  static std::string name() noexcept {
81  return "NumberOfNodesContributedToReduction";
82  }
84 };
85 
86 /// The number of observer components that have contributed data at the
87 /// observation ids.
89  static std::string name() noexcept { return "VolumeObserversContributed"; }
91 };
92 
93 /// The number of observer components that have contributed data at the
94 /// observation ids.
96  static std::string name() noexcept { return "ReductionObserversContributed"; }
98 };
99 
100 /// Node lock used when needing to read/write to H5 files on disk.
101 ///
102 /// The reason for only having one lock for all files is that we currently don't
103 /// require a thread-safe HDF5 installation. In the future we will need to
104 /// experiment with different HDF5 configurations.
106  static std::string name() noexcept { return "H5FileLock"; }
107  using type = CmiNodeLock;
108 };
109 } // namespace Tags
110 
111 namespace OptionTags {
112 /// \ingroup ObserversGroup
113 /// The name of the H5 file on disk to which all volume data is written.
115  using type = std::string;
116  static constexpr OptionString help = {
117  "Name of the volume data file without extension"};
118 };
119 
120 /// \ingroup ObserversGroup
121 /// The name of the H5 file on disk to which all reduction data is written.
123  using type = std::string;
124  static constexpr OptionString help = {
125  "Name of the reduction data file without extension"};
126 };
127 } // namespace OptionTags
128 } // namespace observers
Definition: Actions.hpp:20
The number of observer components that have contributed data at the observation ids.
Definition: Tags.hpp:95
All the ids of all the components registered to an observer for doing reduction observations.
Definition: Tags.hpp:34
The number of events registered with the observer.
Definition: Tags.hpp:26
Defines classes and functions for making classes creatable from input files.
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:65
An ID type that identifies both the parallel component and the index in the parallel component...
Definition: ArrayComponentId.hpp:27
The name of the H5 file on disk to which all reduction data is written.
Definition: Tags.hpp:122
Names of the reduction data to be written to disk.
Definition: Tags.hpp:71
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:26
The number of nodes that have contributed to the reduction data so far.
Definition: Tags.hpp:79
Definition: Strahlkorper.hpp:167
Definition: DataBoxTag.hpp:29
All the ids of all the components registered to an observer for doing volume observations.
Definition: Tags.hpp:41
The name of the H5 file on disk to which all volume data is written.
Definition: Tags.hpp:114
Volume tensor data to be written to disk.
Definition: Tags.hpp:47
Reduction data to be written to disk.
Definition: Tags.hpp:62
Holds the extents of the mesh and the tensor components on the mesh.
Definition: TensorData.hpp:55
The number of observer components that have contributed data at the observation ids.
Definition: Tags.hpp:88
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
A type-erased identifier that combines the identifier&#39;s type and hash used to uniquely identify an ob...
Definition: ObservationId.hpp:43
Node lock used when needing to read/write to H5 files on disk.
Definition: Tags.hpp:105