NAMD
ComputePmeCUDA.h
Go to the documentation of this file.
1 #ifndef COMPUTEPMECUDA_H
2 #define COMPUTEPMECUDA_H
3 
4 #include <vector>
5 #include <list>
6 #include "PmeBase.h"
7 
8 #include "PatchTypes.h" // Results
9 #include "Compute.h"
10 #include "Box.h"
11 #include "OwnerBox.h"
12 #include "ComputePmeCUDAMgr.decl.h"
13 
14 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
15 class HomePatch;
16 
17 class ComputePmeCUDA : public Compute {
18 public:
21  virtual ~ComputePmeCUDA();
22  void initialize();
23  void atomUpdate();
24  int noWork();
25  void doWork();
26  bool storePmeForceMsg(PmeForceMsg *msg);
27 private:
28  struct PatchRecord {
29  PatchRecord() {
30  pmeForceMsg = NULL;
31  patch = NULL;
32  positionBox = NULL;
33  avgPositionBox = NULL;
34  forceBox = NULL;
35  }
36  // Message that contains the pointers to forces
37  PmeForceMsg* pmeForceMsg;
38  // Home pencil
39  int homePencilY;
40  int homePencilZ;
41  int homePencilNode;
42  // Pointer to patch
43  Patch *patch;
44  // Patch ID
45  PatchID patchID;
46  // Boxes
47  Box<Patch,CompAtom> *positionBox;
48  Box<Patch,CompAtom> *avgPositionBox;
49  Box<Patch,Results> *forceBox;
50  };
51 
52  double calcSelfEnergy(int numAtoms, CompAtom *x);
53  void sendAtoms();
54  void recvForces();
55  void setupActivePencils();
56 
57  CmiNodeLock lock;
58  int patchCounter;
59 
60  std::vector<PatchRecord> patches;
61 
62  SubmitReduction *reduction;
63 
64  bool sendAtomsDone;
65 
66  PmeGrid pmeGrid;
67 
68  ComputePmeCUDAMgr *mgr;
69 
70  CProxy_ComputePmeCUDAMgr computePmeCUDAMgrProxy;
71 
72  bool atomsChanged;
73 
74 };
75 #endif // NAMD_CUDA
76 
77 #endif // COMPUTEPMECUDA_H
int ComputeID
Definition: NamdTypes.h:183
ComputePmeCUDA(ComputeID c, PatchIDList &pids)
Definition: Patch.h:35
bool storePmeForceMsg(PmeForceMsg *msg)
int PatchID
Definition: NamdTypes.h:182
virtual ~ComputePmeCUDA()
gridSize x