STORMM Source Documentation
Loading...
Searching...
No Matches
synthesis_cache_map.h
1// -*-c++-*-
2#ifndef STORMM_SYNTHESIS_SYSTEM_CACHE_MAP
3#define STORMM_SYNTHESIS_SYSTEM_CACHE_MAP
4
5#include <string>
6#include <vector>
7#include "copyright.h"
8#include "Accelerator/hybrid.h"
9#include "phasespace_synthesis.h"
10#include "atomgraph_synthesis.h"
11#include "synthesis_enumerators.h"
12#include "systemcache.h"
13
14namespace stormm {
15namespace synthesis {
16
17using card::Hybrid;
18using card::HybridTargetLevel;
19using card::GpuDetails;
20
23
26 SynthesisMapReader(int ncache_in, int nsynth_in, int nlabel_in, int ntopol_in,
27 const int* cache_origins_in, const int* topology_origins_in,
28 const int* label_origins_in, const int* csystem_proj_in,
29 const int* csystem_bounds_in, const int* clabel_proj_in,
30 const int* clabel_bounds_in, const int* ctopol_proj_in,
31 const int* ctopol_bounds_in);
32
36 SynthesisMapReader(const SynthesisMapReader &original) = default;
37 SynthesisMapReader(SynthesisMapReader &&original) = default;
39
40 const int ncache;
42 const int nsynth;
44 const int nlabel;
46 const int ntopol;
48 const int* cache_origins;
49 const int* topology_origins;
52 const int* label_origins;
53 const int* csystem_proj;
55 const int* csystem_bounds;
57 const int* clabel_proj;
59 const int* clabel_bounds;
61 const int* ctopol_proj;
63 const int* ctopol_bounds;
65};
66
71public:
72
78
79 SynthesisCacheMap(const std::vector<int> &cache_origins_in, const SystemCache *sc_in,
80 const AtomGraphSynthesis *poly_ag_in = nullptr,
81 const PhaseSpaceSynthesis *poly_ps_in = nullptr);
82
83 SynthesisCacheMap(const std::vector<int> &cache_origins_in, const SystemCache &sc_in,
84 const AtomGraphSynthesis &poly_ag_in, const PhaseSpaceSynthesis &poly_ps_in);
85
86 SynthesisCacheMap(const std::vector<int> &cache_origins_in, const SystemCache &sc_in,
87 const AtomGraphSynthesis &poly_ag_in);
88
89 SynthesisCacheMap(const std::vector<int> &cache_origins_in, const SystemCache &sc_in,
90 const PhaseSpaceSynthesis &poly_ps_in);
92
99 SynthesisCacheMap(const SynthesisCacheMap &original);
101 SynthesisCacheMap& operator=(const SynthesisCacheMap &original);
102 SynthesisCacheMap& operator=(SynthesisCacheMap &&original);
104
106 int getCacheSystemCount() const;
107
109 int getSynthesisSystemCount() const;
110
112 int getCacheLabelCount() const;
113
115 int getCacheTopologyCount() const;
116
120 int getSynthesisTopologyCount() const;
121
126 std::vector<int> getSourceGroup(int query_index) const;
127
132 std::vector<int> getLabelGroup(const std::string &query_label) const;
133
143 std::vector<int> getTopologyGroup(const AtomGraph *query_ag) const;
144 std::vector<int> getTopologyGroup(const AtomGraph &query_ag) const;
146
150 int getSystemCacheIndex(int synthesis_index) const;
151
157 int getTopologyCacheIndex(int synthesis_index) const;
158
162 int getLabelCacheIndex(int synthesis_index) const;
163
168 int getPartitionCount(SystemGrouping organization) const;
169
189 int getTotalProjection(int query_index, SystemGrouping organization) const;
190 int getTotalProjection(const AtomGraph *query_ag) const;
191 int getTotalProjection(const AtomGraph &query_ag) const;
192 int getTotalProjection(const std::string &query_label) const;
194
196 const SystemCache* getCachePointer() const;
197
200
203
206 const SynthesisCacheMap* getSelfPointer() const;
207
209 const SynthesisMapReader data(HybridTargetLevel tier = HybridTargetLevel::HOST) const;
210
211#ifdef STORMM_USE_HPC
213 void upload();
214
216 void download();
217#endif
218
228 void setCache(const std::vector<int> &cache_origins_in, const SystemCache *sc_in);
229 void setCache(const std::vector<int> &cache_origins_in, const SystemCache &sc_in);
231
243 void setSynthesis(const AtomGraphSynthesis *poly_ag_in);
244 void setSynthesis(const AtomGraphSynthesis &poly_ag_in);
245 void setSynthesis(const PhaseSpaceSynthesis *poly_ps_in);
246 void setSynthesis(const PhaseSpaceSynthesis &poly_ps_in);
248
249private:
250 int cache_system_count;
251 int synthesis_system_count;
253 int cache_label_count;
254 int cache_topology_count;
255 Hybrid<int> cache_origins;
257 Hybrid<int> topology_origins;
263 Hybrid<int> label_origins;
265 Hybrid<int> sys_projections;
267 Hybrid<int> sys_projection_bounds;
268 Hybrid<int> label_projections;
270 Hybrid<int> label_projection_bounds;
271 Hybrid<int> topology_projections;
277 Hybrid<int> topology_projection_bounds;
278 Hybrid<int> int_data;
280
281 // Pointers to the objects being linked
282 SystemCache *sc_ptr;
283 AtomGraphSynthesis *poly_ag_ptr;
284 PhaseSpaceSynthesis *poly_ps_ptr;
285
287 void rebasePointers();
288
290 void validateCorrespondence() const;
291};
292
293} // namespace synthesis
294} // namespace stormm
295
296#endif
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
SynthesisCacheMap()
The constructor can work with a coordinate or topology synthesis, but in either case requires a pairw...
Definition synthesis_cache_map.cpp:28
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
A fixed-precision representation of coordinates, velocities, and forces to manage a set of simulation...
Definition phasespace_synthesis.h:325
const SynthesisMapReader data(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get an abstract of this map.
Definition synthesis_cache_map.cpp:394
void setCache(const std::vector< int > &cache_origins_in, const SystemCache *sc_in)
Set the systems cache along with a list of correspondences.
Definition synthesis_cache_map.cpp:417
int getLabelCacheIndex(int synthesis_index) const
Get the system label index of a system from the synthesis.
Definition synthesis_cache_map.cpp:292
void setSynthesis(const AtomGraphSynthesis *poly_ag_in)
Set the PhaseSpaceSynthesis or AtomGraphSynthesis pointers. This will be useful if the map is used to...
Definition synthesis_cache_map.cpp:480
int getSynthesisTopologyCount() const
Get the number of (unique) topologies in the associated synthesis. This will check the coordinate syn...
Definition synthesis_cache_map.cpp:212
std::vector< int > getLabelGroup(const std::string &query_label) const
Get a list of all system indices in the synthesis derived from systems in the cache matching a partic...
Definition synthesis_cache_map.cpp:241
int getCacheLabelCount() const
Get the number of labels in the associated cache.
Definition synthesis_cache_map.cpp:202
int getTopologyCacheIndex(int synthesis_index) const
Get the index of a topology in the cache guiding a system in the synthesis. This might not be the sam...
Definition synthesis_cache_map.cpp:287
const SynthesisCacheMap * getSelfPointer() const
Get a const pointer to the object itself (useful when the object has been passed by const reference).
Definition synthesis_cache_map.cpp:389
int getPartitionCount(SystemGrouping organization) const
Get the number of partitions that the synthesis should be divided into under any of the methods for g...
Definition synthesis_cache_map.cpp:297
int getTotalProjection(int query_index, SystemGrouping organization) const
Get the number of systems in the synthesis associated with a particular system, label,...
Definition synthesis_cache_map.cpp:316
int getSynthesisSystemCount() const
Get the number of systems in the associated synthesis.
Definition synthesis_cache_map.cpp:197
int getSystemCacheIndex(int synthesis_index) const
Get the system cache index of a system from the synthesis.
Definition synthesis_cache_map.cpp:282
int getCacheTopologyCount() const
Get the number of unique topologies in the associated cache.
Definition synthesis_cache_map.cpp:207
const PhaseSpaceSynthesis * getCoordinateSynthesisPointer() const
Get a const pointer to the coordinate synthesis referenced by this map.
Definition synthesis_cache_map.cpp:384
SynthesisCacheMap()
The constructor can work with a coordinate or topology synthesis, but in either case requires a pairw...
Definition synthesis_cache_map.cpp:28
std::vector< int > getSourceGroup(int query_index) const
Get a list of all system indices in the synthesis derived from a particular -sys keyword entry (a sin...
Definition synthesis_cache_map.cpp:227
const SystemCache * getCachePointer() const
Get a const pointer to the system cache referenced by this map.
Definition synthesis_cache_map.cpp:374
const AtomGraphSynthesis * getTopologySynthesisPointer() const
Get a const pointer to the coordinate synthesis referenced by this map.
Definition synthesis_cache_map.cpp:379
int getCacheSystemCount() const
Get the number of systems in the associated cache.
Definition synthesis_cache_map.cpp:192
std::vector< int > getTopologyGroup(const AtomGraph *query_ag) const
Get a list of all system indices in the synthesis derived from systems in the cache matching a partic...
Definition synthesis_cache_map.cpp:259
Simple but central struct to store the primitive form of the collection of systems that most STORMM a...
Definition systemcache.h:63
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
SynthesisMapReader(int ncache_in, int nsynth_in, int nlabel_in, int ntopol_in, const int *cache_origins_in, const int *topology_origins_in, const int *label_origins_in, const int *csystem_proj_in, const int *csystem_bounds_in, const int *clabel_proj_in, const int *clabel_bounds_in, const int *ctopol_proj_in, const int *ctopol_bounds_in)
As with other abstracts, the constructor takes a list of input arguments for all member variables.
Definition synthesis_cache_map.cpp:13
A set of pointers to critical arrays in the map below.
Definition synthesis_cache_map.h:22
const int nsynth
Definition synthesis_cache_map.h:42
const int * topology_origins
Definition synthesis_cache_map.h:49
SynthesisMapReader(int ncache_in, int nsynth_in, int nlabel_in, int ntopol_in, const int *cache_origins_in, const int *topology_origins_in, const int *label_origins_in, const int *csystem_proj_in, const int *csystem_bounds_in, const int *clabel_proj_in, const int *clabel_bounds_in, const int *ctopol_proj_in, const int *ctopol_bounds_in)
As with other abstracts, the constructor takes a list of input arguments for all member variables.
Definition synthesis_cache_map.cpp:13
const int * ctopol_bounds
Definition synthesis_cache_map.h:63
SynthesisMapReader(const SynthesisMapReader &original)=default
The copy and move constructors take their default forms, but copy and move assignment operators are i...
const int * cache_origins
Cache system origin of each system in the synthesis.
Definition synthesis_cache_map.h:48
const int ncache
Definition synthesis_cache_map.h:40
const int * csystem_proj
Definition synthesis_cache_map.h:53
const int * clabel_bounds
Definition synthesis_cache_map.h:59
const int * csystem_bounds
Definition synthesis_cache_map.h:55
const int * clabel_proj
Definition synthesis_cache_map.h:57
const int ntopol
Definition synthesis_cache_map.h:46
const int * ctopol_proj
Definition synthesis_cache_map.h:61
const int nlabel
Definition synthesis_cache_map.h:44
const int * label_origins
Cache label origin of each system in the synthesis.
Definition synthesis_cache_map.h:52