NAMD
ComputeNonbondedMIC.h
Go to the documentation of this file.
1 #include "ComputeNonbondedUtil.h"
2 #include "ComputeHomeTuples.h"
4 #include <set>
5 
6 class ComputeMgr;
7 
8 class ComputeNonbondedMICKernel;
9 
10 class float4;
11 class double4;
12 
13 int mic_device_pe();
14 
15 bool mic_device_shared_with_pe(int pe);
16 
18  public:
19 
20  struct compute_record {
24  int isSelf;
25  int part;
26  int numParts;
27  };
28 
29  struct patch_record {
32  int numAtoms;
34  int refCount;
35  int isLocal;
36  int hostPe;
38  Patch *p;
41  Box<Patch,Real> *intRadBox; //5 GBIS Boxes
49  Force *f;
50  Real *intRad; //5 GBIS arrays
55 
57  };
58 
59 
61  ComputeNonbondedMIC *m = 0, int idx = -1);
63 
64  void atomUpdate();
65  void doWork();
66  int noWork();
67  void skip();
68 
69  void recvYieldDevice(int pe);
71 
75  int step;
76  int finishWork(); // returns true when finished, false to continue
77 
78  static void bind_lj_table(int deviceNum);
79  static void bind_force_table(int deviceNum);
80  static void bind_constants(int deviceNum);
81  static void bind_exclusions(int deviceNum);
82 
83  void build_exclusions();
84 
85  void requirePatch(int pid);
86  void assignPatches();
87  void registerPatches();
93 
98 
103 
104  double4 *forces;
105  double4 *slow_forces;
108 
112 
113  ComputeNonbondedMICKernel *kernel;
114 
116  int masterPe;
119  int *slavePes;
121 
124 
129  float plcutoff2;
130 
131  #if MIC_SUBMIT_ATOMS_ON_ARRIVAL != 0
132  int micDevice;
133  int2 *exclusionsByAtom_ptr;
134  std::set<void*> *atomSubmitSignals;
135  virtual void patchReady(PatchID patchID, int doneMigration, int seq);
136  #endif
137 
138  // DMK - NOTE : Moved some variables from global scope in ComputeNonbondedMIC to here
139  // DMK - NOTE : For the following members, non-MIC builds will not have the types defined, but
140  // this class should also go unused. So leave these members out of non-MIC builds. May
141  // need to move them back to "__thread" variables or find a cleaner solution.
142  #if defined(NAMD_MIC)
144  ResizeArray<force_list> force_lists;
145  atom * atoms;
146  atom_param * atom_params;
147  #endif
148 
150 
151  // DMK - DEBUG
152  int timestep;
153 };
154 
155 
static void bind_force_table(int deviceNum)
ResizeArray< compute_record > computeRecords
ResizeArray< int > localActivePatches
void recvYieldDevice(int pe)
Box< Patch, CompAtom > * positionBox
int ComputeID
Definition: NamdTypes.h:183
ComputeNonbondedMIC ** slaves
void requirePatch(int pid)
Definition: Vector.h:64
static __thread atom * atoms
static void bind_lj_table(int deviceNum)
float Real
Definition: common.h:109
LocalWorkMsg * localWorkMsg2
Definition: Patch.h:35
static __thread patch_pair * patch_pairs
bool mic_device_shared_with_pe(int pe)
ResizeArray< int > activePatches
ComputeNonbondedMIC(ComputeID c, ComputeMgr *mgr, ComputeNonbondedMIC *m=0, int idx=-1)
static void bind_exclusions(int deviceNum)
static void bind_constants(int deviceNum)
ResizeArray< compute_record > remoteComputeRecords
int PatchID
Definition: NamdTypes.h:182
SubmitReduction * reduction
ComputeNonbondedMICKernel * kernel
ResizeArray< int > remoteHostedPatches
ResizeArray< int > hostedPatches
ResizeArray< compute_record > localComputeRecords
ComputeNonbondedMIC * master
static __thread atom_param * atom_params
ResizeArray< patch_record > patchRecords
virtual void patchReady(PatchID, int doneMigration, int seq)
Definition: Compute.C:63
ResizeArray< int > remoteActivePatches
int mic_device_pe()
ResizeArray< int > localHostedPatches
float GBReal
Definition: ComputeGBIS.inl:17