NAMD
ComputeMgr.h
Go to the documentation of this file.
1 
7 #ifndef COMPUTEMGR_H
8 #define COMPUTEMGR_H
9 
10 #include "charm++.h"
11 #include "main.h"
12 #include <new>
13 
14 #include "NamdTypes.h"
15 #include "BOCgroup.h"
16 
17 #include "ResizeArray.h"
18 
19 #include "GlobalMaster.h"
20 #include "GlobalMasterServer.h"
21 #include "ComputeMgr.decl.h"
22 
23 class Compute;
24 class ComputeMap;
25 class CkQdMsg;
26 
27 class ComputeGlobal;
28 class ComputeGlobalConfigMsg;
31 
32 class ComputeDPME;
33 class ComputeDPMEDataMsg;
36 
37 class ComputeEwald;
38 class ComputeEwaldMsg;
39 
43 class FinishWorkMsg;
44 
48 
50 #ifdef NAMD_CUDA
52 #ifdef BONDED_CUDA
53 class ComputeBondedCUDA;
54 #endif
55 #endif
56 
57 class ComputeMgr : public CBase_ComputeMgr
58 {
59 public:
60 
61  ComputeMgr();
62  ~ComputeMgr();
63  void createComputes(ComputeMap *map);
64  void updateComputes(int,CkGroupID);
65  void updateComputes2(CkQdMsg *);
66  void updateComputes3();
67  void splitComputes();
68  void splitComputes2(CkQdMsg *);
69  void updateLocalComputes();
70  void updateLocalComputes2(CkQdMsg *);
71  void updateLocalComputes3();
72  void updateLocalComputes4(CkQdMsg *);
73  void updateLocalComputes5();
75 
76  void sendComputeGlobalConfig(ComputeGlobalConfigMsg *);
77  void recvComputeGlobalConfig(ComputeGlobalConfigMsg *);
83 
88 
93 
95 
96  // Made public in order to access the ComputeGlobal on the node
97  ComputeGlobal *computeGlobalObject; /* node part of global computes */
101 
102  void sendYieldDevice(int pe);
103  void recvYieldDevice(int pe);
108 
109  // DMK
110  void sendBuildMICForceTable();
111  void recvBuildMICForceTable();
112 
113  void sendCreateNonbondedCUDASlave(int,int);
115  void sendNonbondedCUDASlaveReady(int,int,int,int);
116  void recvNonbondedCUDASlaveReady(int,int,int);
119  void sendNonbondedCUDASlaveEnqueue(ComputeNonbondedCUDA *c, int,int,int,int);
121 #ifdef NAMD_CUDA
122  void sendAssignPatchesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
124  void sendSkipPatchesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
126  void sendFinishPatchesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
128  void sendFinishPatchOnPe(int pe, CudaComputeNonbonded* c, int i, PatchID patchID);
130  void sendOpenBoxesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
136  void sendLaunchWork(int pe, CudaComputeNonbonded* c);
138  void sendUnregisterBoxesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
140 #ifdef BONDED_CUDA
141  void sendAssignPatchesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
142  void recvAssignPatchesOnPe(ComputeBondedCUDAMsg *msg);
143  void sendMessageEnqueueWork(int pe, ComputeBondedCUDA* c);
144  void recvMessageEnqueueWork(ComputeBondedCUDAMsg *msg);
145  void sendOpenBoxesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
146  void recvOpenBoxesOnPe(ComputeBondedCUDAMsg *msg);
147  void sendLoadTuplesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
148  void recvLoadTuplesOnPe(ComputeBondedCUDAMsg *msg);
149  void sendLaunchWork(int pe, ComputeBondedCUDA* c);
150  void recvLaunchWork(ComputeBondedCUDAMsg *msg);
151  void sendFinishPatchesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
152  void recvFinishPatchesOnPe(ComputeBondedCUDAMsg *msg);
153  void sendFinishReductions(int pe, ComputeBondedCUDA* c);
154  void recvFinishReductions(ComputeBondedCUDAMsg *msg);
155  void sendUnregisterBoxesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
156  void recvUnregisterBoxesOnPe(ComputeBondedCUDAMsg *msg);
157 #endif
158 #endif
159  void sendCreateNonbondedMICSlave(int,int);
161  void sendNonbondedMICSlaveReady(int,int,int,int);
162  void recvNonbondedMICSlaveReady(int,int,int);
165  void sendNonbondedMICSlaveEnqueue(ComputeNonbondedMIC *c, int,int,int,int);
166  void sendMICPEData(int,int);
167  void recvMICPEData(int,int);
168  int isMICProcessor(int);
169 
170 private:
171  void createCompute(ComputeID, ComputeMap *);
172 
173  GlobalMasterServer *masterServerObject; /* master part of global computes */
174  ComputeDPME *computeDPMEObject;
175 
176  ComputeEwald *computeEwaldObject;
177 
178  ComputeNonbondedCUDA *computeNonbondedCUDAObject;
179 
180  ComputeNonbondedMIC *computeNonbondedMICObject;
181 
182  ComputeNonbondedWorkArrays *computeNonbondedWorkArrays;
183 
184  int skipSplitting;
185  int updateComputesCount;
186  int updateComputesReturnEP;
187  CkGroupID updateComputesReturnChareID;
188 
189  ResizeArray<int> computeFlag;
190 
191  int* micPEData; // DMK : An array (1 bit per PE) which will hold a flag indicating if a given PE is driving a MIC card or not
192 };
193 
194 
195 #endif /* COMPUTEMGR_H */
196 
void sendNonbondedCUDASlaveEnqueuePatch(ComputeNonbondedCUDA *c, int, int, int, int, FinishWorkMsg *)
Definition: ComputeMgr.C:1565
void recvNonbondedMICSlaveReady(int, int, int)
Definition: ComputeMgr.C:1830
void recvComputeEwaldData(ComputeEwaldMsg *)
Definition: ComputeMgr.C:1341
void updateLocalComputes()
Definition: ComputeMgr.C:215
void sendNonbondedCUDASlaveSkip(ComputeNonbondedCUDA *c, int)
Definition: ComputeMgr.C:1541
void sendBuildCudaForceTable()
Definition: ComputeMgr.C:1467
void sendYieldDevice(int pe)
Definition: ComputeMgr.C:1434
void recvCreateNonbondedCUDASlave(NonbondedCUDASlaveMsg *)
Definition: ComputeMgr.C:1519
void recvComputeDPMEResults(ComputeDPMEResultsMsg *)
Definition: ComputeMgr.C:1396
int ComputeID
Definition: NamdTypes.h:183
void updateLocalComputes5()
Definition: ComputeMgr.C:316
void recvFinishPatchOnPe(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1634
void sendMessageEnqueueWork(int pe, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1664
void sendFinishReductions(int pe, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1653
void recvComputeConsForceMsg(ComputeConsForceMsg *)
Definition: ComputeMgr.C:1408
void updateLocalComputes3()
Definition: ComputeMgr.C:266
void recvMessageEnqueueWork(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1670
void sendNonbondedCUDASlaveReady(int, int, int, int)
Definition: ComputeMgr.C:1525
void recvMICPEData(int, int)
Definition: ComputeMgr.C:1870
void createComputes(ComputeMap *map)
Definition: ComputeMgr.C:1009
void recvLaunchWork(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1681
int computeGlobalResultsMsgSeq
Definition: ComputeMgr.h:99
void updateLocalComputes2(CkQdMsg *)
Definition: ComputeMgr.C:259
void recvAssignPatchesOnPe(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1594
void doneUpdateLocalComputes()
Definition: ComputeMgr.C:348
void recvComputeGlobalConfig(ComputeGlobalConfigMsg *)
void sendMICPEData(int, int)
Definition: ComputeMgr.C:1865
int computeGlobalResultsMsgMasterSeq
Definition: ComputeMgr.h:100
void sendComputeEwaldData(ComputeEwaldMsg *)
Definition: ComputeMgr.C:1325
void recvCreateNonbondedMICSlave(NonbondedMICSlaveMsg *)
Definition: ComputeMgr.C:1819
void sendBuildCudaExclusions()
Definition: ComputeMgr.C:1448
void sendLaunchWork(int pe, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1675
void recvYieldDevice(int pe)
Definition: ComputeMgr.C:1439
void sendCreateNonbondedCUDASlave(int, int)
Definition: ComputeMgr.C:1511
void sendComputeGlobalResults(ComputeGlobalResultsMsg *)
Definition: ComputeMgr.C:1287
void sendUnregisterBoxesOnPe(std::vector< int > &pes, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1686
int PatchID
Definition: NamdTypes.h:182
void sendFinishPatchesOnPe(std::vector< int > &pes, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1612
void recvFinishReductions(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1659
void updateLocalComputes4(CkQdMsg *)
Definition: ComputeMgr.C:298
void recvNonbondedMICSlaveSkip(NonbondedMICSkipMsg *)
Definition: ComputeMgr.C:1847
void recvFinishPatchesOnPe(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1621
void enableComputeGlobalResults()
Definition: ComputeMgr.C:1293
void recvComputeGlobalResults(ComputeGlobalResultsMsg *)
Definition: ComputeMgr.C:1306
ResizeArray< ComputeGlobalResultsMsg * > computeGlobalResultsMsgs
Definition: ComputeMgr.h:98
void recvComputeDPMEData(ComputeDPMEDataMsg *)
Definition: ComputeMgr.C:1378
void splitComputes()
Definition: ComputeMgr.C:175
ComputeGlobal * computeGlobalObject
Definition: ComputeMgr.h:97
void recvComputeEwaldResults(ComputeEwaldMsg *)
Definition: ComputeMgr.C:1353
void sendComputeDPMEData(ComputeDPMEDataMsg *)
Definition: ComputeMgr.C:1364
void recvComputeGlobalData(ComputeGlobalDataMsg *)
Definition: ComputeMgr.C:1278
void sendComputeDPMEResults(ComputeDPMEResultsMsg *, int)
Definition: ComputeMgr.C:1390
void sendNonbondedMICSlaveEnqueue(ComputeNonbondedMIC *c, int, int, int, int)
Definition: ComputeMgr.C:1854
void sendNonbondedMICSlaveReady(int, int, int, int)
Definition: ComputeMgr.C:1825
void updateComputes2(CkQdMsg *)
Definition: ComputeMgr.C:156
void sendNonbondedCUDASlaveEnqueue(ComputeNonbondedCUDA *c, int, int, int, int)
Definition: ComputeMgr.C:1554
void recvOpenBoxesOnPe(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1648
void recvUnregisterBoxesOnPe(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1694
void sendComputeGlobalConfig(ComputeGlobalConfigMsg *)
void recvNonbondedCUDASlaveReady(int, int, int)
Definition: ComputeMgr.C:1530
void recvSkipPatchesOnPe(CudaComputeNonbondedMsg *msg)
Definition: ComputeMgr.C:1607
void recvNonbondedCUDASlaveSkip(NonbondedCUDASkipMsg *)
Definition: ComputeMgr.C:1547
void sendComputeGlobalData(ComputeGlobalDataMsg *)
Definition: ComputeMgr.C:1272
void recvBuildMICForceTable()
Definition: ComputeMgr.C:1499
void sendOpenBoxesOnPe(std::vector< int > &pes, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1639
void updateComputes3()
Definition: ComputeMgr.C:165
void sendFinishPatchOnPe(int pe, CudaComputeNonbonded *c, int i, PatchID patchID)
Definition: ComputeMgr.C:1626
void sendNonbondedMICSlaveSkip(ComputeNonbondedMIC *c, int)
Definition: ComputeMgr.C:1841
int isMICProcessor(int)
Definition: ComputeMgr.C:1885
void sendBuildMICForceTable()
Definition: ComputeMgr.C:1486
void updateComputes(int, CkGroupID)
Definition: ComputeMgr.C:142
void recvBuildCudaForceTable()
Definition: ComputeMgr.C:1480
void sendComputeEwaldResults(ComputeEwaldMsg *)
Definition: ComputeMgr.C:1348
void sendAssignPatchesOnPe(std::vector< int > &pes, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1586
void sendCreateNonbondedMICSlave(int, int)
Definition: ComputeMgr.C:1811
void recvBuildCudaExclusions()
Definition: ComputeMgr.C:1461
void splitComputes2(CkQdMsg *)
Definition: ComputeMgr.C:209
void sendSkipPatchesOnPe(std::vector< int > &pes, CudaComputeNonbonded *c)
Definition: ComputeMgr.C:1599