ComputeNonbondedCUDA.h

Go to the documentation of this file.
00001 #ifndef COMPUTENONBONDEDCUDA_H
00002 #define COMPUTENONBONDEDCUDA_H
00003 #include "ComputeNonbondedUtil.h"
00004 #include "ComputeHomeTuples.h"
00005 
00006 class ComputeMgr;
00007 
00008 //class ComputeNonbondedCUDAKernel;
00009 
00010 class FinishWorkMsg;
00011 
00012 class float4;
00013 
00014 int cuda_device_pe();
00015 
00016 bool cuda_device_shared_with_pe(int pe);
00017 
00018 bool one_cuda_device_per_node();
00019 
00020 class ComputeNonbondedCUDA : public Compute, private ComputeNonbondedUtil {
00021 
00022   public:
00023 
00024   struct compute_record {
00025     ComputeID c;
00026     PatchID pid[2];
00027     Vector offset;
00028   };
00029 
00030   struct patch_record {
00031     int localIndex;
00032     int localStart;
00033     int numAtoms;
00034     int numFreeAtoms;
00035     int refCount;
00036     int isLocal;
00037     int isSameNode;
00038     int isSamePhysicalNode;
00039     int reversePriorityRankInPe;
00040     int hostPe;
00041     PatchID patchID;
00042     ComputeNonbondedCUDA *slave;
00043     FinishWorkMsg *msg;
00044     Patch *p;
00045     Box<Patch,CompAtom> *positionBox;
00046     Box<Patch,Results> *forceBox;
00047     Box<Patch,Real>   *intRadBox; //5 GBIS Boxes
00048     Box<Patch,GBReal> *psiSumBox;
00049     Box<Patch,Real>   *bornRadBox;
00050     Box<Patch,GBReal> *dEdaSumBox;
00051     Box<Patch,Real>   *dHdrPrefixBox;
00052     CompAtom *x;
00053     CompAtomExt *xExt;
00054     Results *r;
00055     Force *f;
00056     Real   *intRad; //5 GBIS arrays
00057     GBReal *psiSum;
00058     Real   *bornRad;
00059     GBReal *dEdaSum;
00060     Real   *dHdrPrefix;
00061 
00062     patch_record() { refCount = 0; }
00063   };
00064 
00065 
00066   ComputeNonbondedCUDA(ComputeID c, ComputeMgr *mgr,
00067                        ComputeNonbondedCUDA *m = 0, int idx = -1);
00068   ~ComputeNonbondedCUDA();
00069 
00070   void atomUpdate();
00071   void doWork();
00072   int noWork();
00073   void skip();
00074 
00075   void recvYieldDevice(int pe);
00076   LocalWorkMsg *localWorkMsg2;
00077 
00078   int workStarted;
00079   Lattice lattice;
00080   int doSlow, doEnergy;
00081   int step;
00082   int finishWork();  // returns true when finished, false to continue
00083   void finishReductions();
00084   void finishPatch(int);
00085   void messageFinishPatch(int);
00086 
00087   static void build_lj_table();
00088   static void build_force_table();
00089 
00090   static void build_exclusions();
00091 
00092   void requirePatch(int pid);
00093   void assignPatches();
00094   void registerPatches();
00095   ResizeArray<int> activePatches, localActivePatches, remoteActivePatches;
00096   ResizeArray<int> hostedPatches, localHostedPatches, remoteHostedPatches;
00097   ResizeArray<patch_record> patchRecords;
00098   ResizeArray<compute_record> computeRecords;
00099   ResizeArray<compute_record> localComputeRecords, remoteComputeRecords;
00100 
00101   int forces_size;
00102   float4* forces;
00103 
00104   int slow_forces_size;
00105   float4* slow_forces;
00106 
00107   int psiSumH_size;
00108   GBReal *psiSumH;
00109 
00110   int dEdaSumH_size;
00111   GBReal *dEdaSumH;
00112 
00113   //int gpu_is_mine;
00114 
00115   // GPU device ID that this non-bonded computation uses
00116   int deviceID;
00117 
00118   PatchMap *patchMap;
00119   AtomMap *atomMap;
00120   SubmitReduction *reduction;
00121 
00122   //ComputeNonbondedCUDAKernel *kernel;
00123 
00124   ComputeNonbondedCUDA *master;
00125   int masterPe;
00126   int slaveIndex;
00127   ComputeNonbondedCUDA **slaves;
00128   int *slavePes;
00129   int numSlaves;
00130 
00131   int atomsChanged;
00132   int computesChanged;
00133   int patchPairsReordered;
00134 
00135   int pairlistsValid;
00136   float pairlistTolerance;
00137   int usePairlists;
00138   int savePairlists;
00139   float plcutoff2;
00140 
00141   int atoms_size;
00142   CudaAtom* atoms;
00143 
00144   private:
00145   void finishPatch(patch_record&);
00146 
00147 };
00148 
00149 #endif //COMPUTENONBONDEDCUDA_H

Generated on Thu Sep 21 01:17:11 2017 for NAMD by  doxygen 1.4.7