WARPXM v1.10.0
Loading...
Searching...
No Matches
wmdomain.h
Go to the documentation of this file.
1/*
2 * wmdomain.h
3 *
4 * Created on: Feb 23, 2012
5 * Author: smiller
6 */
7
8#ifndef WMDOMAIN_H_
9#define WMDOMAIN_H_
10
11// External Libraries
12//#include <hdf5.h>
13
14// WarpX includes
15#include "wxlogger.h"
16#include "wxlogstream.h"
17#include "wmunstructuredpatch.h"
19#include "solver/wmsolverbase.h"
20#include "lib/wxany.h"
21
22// std includes
23#include <cassert>
24#include <iostream>
25#include <map>
26#include <vector>
27#include <utility>
28#include <typeinfo>
29
31
32// WmDomain will have to control how the domain is split up among the processors
33
35{
36public:
37 typedef std::vector<WmUnstructuredPatch*> patchList_t;
38
39 typedef std::map<int, WmUnstructuredPatch*> patchMap_t;
40 typedef std::pair<int, WmUnstructuredPatch*> patchPair_t;
41
43
45
46 void setup(const WxCryptSet& wxc);
47
48 void setParentSolver(WmSolverBase* parentSolver)
49 {
50 _parentSolver = parentSolver;
51 }
52
54 {
55 return _parentSolver;
56 }
57
58 int getNumPatches() const;
59
60 // These are used to generate the global array
61 std::vector<int> getAllPartitionPIDs() const;
62 std::map<int, std::pair<int, int>>
63 getSubdomainPartitionPIDsAndNumElements(const std::string& subdomainName) const;
64
65 std::vector<std::string> getSubdomainNames() const;
66
67 const WmUnstructuredPatch* hasPatch(int patchIndex) const;
68 const WmUnstructuredPatch* hasLocalPatch(int patchIndex) const;
69
70 // These should be part of a WmGeometryDomain class
72 {
73 return _localPatches;
74 }
75 patchMap_t getLocalPatches(const std::string& subdomainName) const;
77 {
78 return _patches;
79 }
80 patchMap_t getPatches(const std::string& subdomainName) const;
81 int primitive_id() const
82 {
83 return _primitive_id;
84 }
85
87
88 // This should be part of a WmComputeDomain class
89 int getLocalPID() const; // This returns the local processor ID number
90 const std::vector<int>& getClusterDeviceIndexes() const
91 {
93 }
94 const std::vector<int>& getClusterDeviceNodeRanks() const
95 {
97 }
98 const std::vector<float>& getClusterDeviceWeights() const
99 {
101 }
102 const std::map<std::pair<int, int>, int>& getClusterDeviceEdgeWeights() const
103 {
105 }
106
107protected:
110
112
114
115 // All patches, some local, some not *** This map owns the patches ***
117
118 // A subset of patches local to this MPI rank
120
121 // Partition structures defining cluster
122 // Used to partition the patches within the cluster
123 std::vector<int> _clusterDeviceIndex; // Compute device index local to cluster node
124 std::vector<int> _clusterDeviceNodeRank; // Rank of cluster node
125 std::vector<float> _clusterDeviceWeights; // Weight of compute device
126 std::map<std::pair<int, int>, int>
127 _clusterDeviceEdgeWeights; // Weight of link between compute devices
128};
129
130#endif /* WMDOMAIN_H_ */
Definition: wmdomain.h:35
std::vector< int > _clusterDeviceNodeRank
Definition: wmdomain.h:124
std::vector< WmUnstructuredPatch * > patchList_t
Definition: wmdomain.h:37
const std::vector< int > & getClusterDeviceIndexes() const
Definition: wmdomain.h:90
patchMap_t getLocalPatches(const std::string &subdomainName) const
std::vector< int > _clusterDeviceIndex
Definition: wmdomain.h:123
patchMap_t _localPatches
Definition: wmdomain.h:119
std::vector< int > getAllPartitionPIDs() const
std::pair< int, WmUnstructuredPatch * > patchPair_t
Definition: wmdomain.h:40
int _primitive_id
Definition: wmdomain.h:113
std::map< int, WmUnstructuredPatch * > patchMap_t
Definition: wmdomain.h:39
void setParentSolver(WmSolverBase *parentSolver)
Definition: wmdomain.h:48
int getLocalPID() const
void addPatch(WmUnstructuredPatch *pPatch)
patchMap_t getPatches(const std::string &subdomainName) const
const WmUnstructuredPatch * hasPatch(int patchIndex) const
patchMap_t _patches
Definition: wmdomain.h:116
const std::vector< int > & getClusterDeviceNodeRanks() const
Definition: wmdomain.h:94
std::map< std::pair< int, int >, int > _clusterDeviceEdgeWeights
Definition: wmdomain.h:127
void setup(const WxCryptSet &wxc)
void applyPatchOffsets()
patchMap_t getPatches() const
Definition: wmdomain.h:76
int primitive_id() const
Definition: wmdomain.h:81
WmSolverBase * _parentSolver
Definition: wmdomain.h:111
std::map< int, std::pair< int, int > > getSubdomainPartitionPIDsAndNumElements(const std::string &subdomainName) const
std::vector< float > _clusterDeviceWeights
Definition: wmdomain.h:125
std::vector< std::string > getSubdomainNames() const
void partitionDomain()
int getNumPatches() const
patchMap_t getLocalPatches() const
Definition: wmdomain.h:71
WmSolverBase const * getParentSolver() const
Definition: wmdomain.h:53
const std::vector< float > & getClusterDeviceWeights() const
Definition: wmdomain.h:98
const std::map< std::pair< int, int >, int > & getClusterDeviceEdgeWeights() const
Definition: wmdomain.h:102
const WmUnstructuredPatch * hasLocalPatch(int patchIndex) const
A base class for solvers in WARPM.
Definition: wmsolverbase.h:35
Definition: wmunstructuredpatch.h:22
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35