ComputeMgr.h

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTEMGR_H
00008 #define COMPUTEMGR_H
00009 
00010 #include "charm++.h"
00011 #include "main.h"
00012 #include <new>
00013 
00014 #include "NamdTypes.h"
00015 #include "BOCgroup.h"
00016 
00017 #include "ResizeArray.h"
00018 
00019 #include "GlobalMaster.h"
00020 #include "GlobalMasterServer.h"
00021 #include "ComputeMgr.decl.h"
00022 
00023 class Compute;
00024 class ComputeMap;
00025 class CkQdMsg;
00026 
00027 class ComputeGlobal;
00028 class ComputeGlobalConfigMsg;
00029 class ComputeGlobalDataMsg;
00030 class ComputeGlobalResultsMsg;
00031 
00032 class ComputeDPME;
00033 class ComputeDPMEDataMsg;
00034 class ComputeDPMEResultsMsg;
00035 class ComputeConsForceMsg;
00036 
00037 class ComputeEwald;
00038 class ComputeEwaldMsg;
00039 
00040 class ComputeNonbondedCUDA;
00041 class NonbondedCUDASlaveMsg;
00042 class NonbondedCUDASkipMsg;
00043 class FinishWorkMsg;
00044 
00045 class ComputeNonbondedMIC;
00046 class NonbondedMICSlaveMsg;
00047 class NonbondedMICSkipMsg;
00048 
00049 class ComputeNonbondedWorkArrays;
00050 #ifdef NAMD_CUDA
00051 class CudaComputeNonbonded;
00052 #ifdef BONDED_CUDA
00053 class ComputeBondedCUDA;
00054 #endif
00055 #endif
00056 
00057 class ComputeMgr : public CBase_ComputeMgr
00058 {
00059 public:
00060 
00061   ComputeMgr();
00062   ~ComputeMgr();
00063   void createComputes(ComputeMap *map);
00064   void updateComputes(int,CkGroupID);
00065   void updateComputes2(CkQdMsg *);
00066   void updateComputes3();
00067   void splitComputes();
00068   void splitComputes2(CkQdMsg *);
00069   void updateLocalComputes();
00070   void updateLocalComputes2(CkQdMsg *);
00071   void updateLocalComputes3();
00072   void updateLocalComputes4(CkQdMsg *);
00073   void updateLocalComputes5();
00074   void doneUpdateLocalComputes();
00075 
00076   void sendComputeGlobalConfig(ComputeGlobalConfigMsg *);
00077   void recvComputeGlobalConfig(ComputeGlobalConfigMsg *);
00078   void sendComputeGlobalData(ComputeGlobalDataMsg *);
00079   void recvComputeGlobalData(ComputeGlobalDataMsg *);
00080   void sendComputeGlobalResults(ComputeGlobalResultsMsg *);
00081   void recvComputeGlobalResults(ComputeGlobalResultsMsg *);
00082   void enableComputeGlobalResults();
00083 
00084   void sendComputeDPMEData(ComputeDPMEDataMsg *);
00085   void recvComputeDPMEData(ComputeDPMEDataMsg *);
00086   void sendComputeDPMEResults(ComputeDPMEResultsMsg *, int);
00087   void recvComputeDPMEResults(ComputeDPMEResultsMsg *);
00088 
00089   void sendComputeEwaldData(ComputeEwaldMsg *);
00090   void recvComputeEwaldData(ComputeEwaldMsg *);
00091   void sendComputeEwaldResults(ComputeEwaldMsg *);
00092   void recvComputeEwaldResults(ComputeEwaldMsg *);
00093 
00094   void recvComputeConsForceMsg(ComputeConsForceMsg *);
00095 
00096   // Made public in order to access the ComputeGlobal on the node
00097   ComputeGlobal *computeGlobalObject; /* node part of global computes */
00098   ResizeArray<ComputeGlobalResultsMsg*> computeGlobalResultsMsgs;
00099   int computeGlobalResultsMsgSeq;
00100   int computeGlobalResultsMsgMasterSeq;
00101 
00102   void sendYieldDevice(int pe);
00103   void recvYieldDevice(int pe);
00104   void sendBuildCudaExclusions();
00105   void recvBuildCudaExclusions();
00106   void sendBuildCudaForceTable();
00107   void recvBuildCudaForceTable();
00108 
00109   // DMK
00110   void sendBuildMICForceTable();
00111   void recvBuildMICForceTable();
00112 
00113   void sendCreateNonbondedCUDASlave(int,int);
00114   void recvCreateNonbondedCUDASlave(NonbondedCUDASlaveMsg *);
00115   void sendNonbondedCUDASlaveReady(int,int,int,int);
00116   void recvNonbondedCUDASlaveReady(int,int,int);
00117   void sendNonbondedCUDASlaveSkip(ComputeNonbondedCUDA *c, int);
00118   void recvNonbondedCUDASlaveSkip(NonbondedCUDASkipMsg *);
00119   void sendNonbondedCUDASlaveEnqueue(ComputeNonbondedCUDA *c, int,int,int,int);
00120   void sendNonbondedCUDASlaveEnqueuePatch(ComputeNonbondedCUDA *c, int,int,int,int, FinishWorkMsg*);
00121 #ifdef NAMD_CUDA
00122   void sendAssignPatchesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
00123   void recvAssignPatchesOnPe(CudaComputeNonbondedMsg *msg);
00124   void sendSkipPatchesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
00125   void recvSkipPatchesOnPe(CudaComputeNonbondedMsg *msg);
00126   void sendFinishPatchesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
00127   void recvFinishPatchesOnPe(CudaComputeNonbondedMsg *msg);
00128   void sendFinishPatchOnPe(int pe, CudaComputeNonbonded* c, int i);
00129   void recvFinishPatchOnPe(CudaComputeNonbondedMsg *msg);
00130   void sendOpenBoxesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
00131   void recvOpenBoxesOnPe(CudaComputeNonbondedMsg *msg);
00132   void sendFinishReductions(int pe, CudaComputeNonbonded* c);
00133   void recvFinishReductions(CudaComputeNonbondedMsg *msg);
00134   void sendMessageEnqueueWork(int pe, CudaComputeNonbonded* c);
00135   void recvMessageEnqueueWork(CudaComputeNonbondedMsg *msg);
00136   void sendLaunchWork(int pe, CudaComputeNonbonded* c);
00137   void recvLaunchWork(CudaComputeNonbondedMsg *msg);
00138   void sendUnregisterBoxesOnPe(std::vector<int>& pes, CudaComputeNonbonded* c);
00139   void recvUnregisterBoxesOnPe(CudaComputeNonbondedMsg *msg);
00140 #ifdef BONDED_CUDA
00141   void sendAssignPatchesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
00142   void recvAssignPatchesOnPe(ComputeBondedCUDAMsg *msg);
00143   void sendMessageEnqueueWork(int pe, ComputeBondedCUDA* c);
00144   void recvMessageEnqueueWork(ComputeBondedCUDAMsg *msg);
00145   void sendOpenBoxesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
00146   void recvOpenBoxesOnPe(ComputeBondedCUDAMsg *msg);
00147   void sendLoadTuplesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
00148   void recvLoadTuplesOnPe(ComputeBondedCUDAMsg *msg);
00149   void sendLaunchWork(int pe, ComputeBondedCUDA* c);
00150   void recvLaunchWork(ComputeBondedCUDAMsg *msg);
00151   void sendFinishPatchesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
00152   void recvFinishPatchesOnPe(ComputeBondedCUDAMsg *msg);
00153   void sendFinishReductions(int pe, ComputeBondedCUDA* c);
00154   void recvFinishReductions(ComputeBondedCUDAMsg *msg);
00155   void sendUnregisterBoxesOnPe(std::vector<int>& pes, ComputeBondedCUDA* c);
00156   void recvUnregisterBoxesOnPe(ComputeBondedCUDAMsg *msg);
00157 #endif
00158 #endif
00159   void sendCreateNonbondedMICSlave(int,int);
00160   void recvCreateNonbondedMICSlave(NonbondedMICSlaveMsg *);
00161   void sendNonbondedMICSlaveReady(int,int,int,int);
00162   void recvNonbondedMICSlaveReady(int,int,int);
00163   void sendNonbondedMICSlaveSkip(ComputeNonbondedMIC *c, int);
00164   void recvNonbondedMICSlaveSkip(NonbondedMICSkipMsg *);
00165   void sendNonbondedMICSlaveEnqueue(ComputeNonbondedMIC *c, int,int,int,int);
00166   void sendMICPEData(int,int);
00167   void recvMICPEData(int,int);
00168   int isMICProcessor(int);
00169   
00170 private:
00171   void createCompute(ComputeID, ComputeMap *);
00172 
00173   GlobalMasterServer *masterServerObject; /* master part of global computes */
00174   ComputeDPME *computeDPMEObject;
00175 
00176   ComputeEwald *computeEwaldObject;
00177 
00178   ComputeNonbondedCUDA *computeNonbondedCUDAObject;
00179 
00180   ComputeNonbondedMIC *computeNonbondedMICObject;
00181 
00182   ComputeNonbondedWorkArrays *computeNonbondedWorkArrays;
00183 
00184   int skipSplitting;
00185   int updateComputesCount;
00186   int updateComputesReturnEP;
00187   CkGroupID updateComputesReturnChareID;
00188 
00189   ResizeArray<int> computeFlag;
00190 
00191   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
00192 };
00193 
00194 
00195 #endif /* COMPUTEMGR_H */
00196 

Generated on Mon Nov 20 01:17:11 2017 for NAMD by  doxygen 1.4.7