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 00022 class Compute; 00023 class ComputeMap; 00024 class CkQdMsg; 00025 00026 class ComputeGlobal; 00027 class ComputeGlobalConfigMsg; 00028 class ComputeGlobalDataMsg; 00029 class ComputeGlobalResultsMsg; 00030 00031 class ComputeDPME; 00032 class ComputeDPMEDataMsg; 00033 class ComputeDPMEResultsMsg; 00034 class ComputeConsForceMsg; 00035 00036 class ComputeEwald; 00037 class ComputeEwaldMsg; 00038 00039 class ComputeNonbondedCUDA; 00040 00041 class ComputeNonbondedWorkArrays; 00042 00043 class ComputeMgr : public BOCclass 00044 { 00045 public: 00046 00047 ComputeMgr(); 00048 ~ComputeMgr(); 00049 void createComputes(ComputeMap *map); 00050 void updateComputes(int,CkGroupID); 00051 void updateComputes2(CkQdMsg *); 00052 void updateComputes3(); 00053 void updateLocalComputes(); 00054 void updateLocalComputes2(CkQdMsg *); 00055 void updateLocalComputes3(); 00056 void updateLocalComputes4(CkQdMsg *); 00057 void updateLocalComputes5(); 00058 void doneUpdateLocalComputes(); 00059 00060 void sendComputeGlobalConfig(ComputeGlobalConfigMsg *); 00061 void recvComputeGlobalConfig(ComputeGlobalConfigMsg *); 00062 void sendComputeGlobalData(ComputeGlobalDataMsg *); 00063 void recvComputeGlobalData(ComputeGlobalDataMsg *); 00064 void sendComputeGlobalResults(ComputeGlobalResultsMsg *); 00065 void recvComputeGlobalResults(ComputeGlobalResultsMsg *); 00066 00067 void sendComputeDPMEData(ComputeDPMEDataMsg *); 00068 void recvComputeDPMEData(ComputeDPMEDataMsg *); 00069 void sendComputeDPMEResults(ComputeDPMEResultsMsg *, int); 00070 void recvComputeDPMEResults(ComputeDPMEResultsMsg *); 00071 00072 void sendComputeEwaldData(ComputeEwaldMsg *); 00073 void recvComputeEwaldData(ComputeEwaldMsg *); 00074 void sendComputeEwaldResults(ComputeEwaldMsg *); 00075 void recvComputeEwaldResults(ComputeEwaldMsg *); 00076 00077 void recvComputeConsForceMsg(ComputeConsForceMsg *); 00078 00079 // Made public in order to access the ComputeGlobal on the node 00080 ComputeGlobal *computeGlobalObject; /* node part of global computes */ 00081 00082 void sendYieldDevice(int pe); 00083 void recvYieldDevice(int pe); 00084 00085 private: 00086 void createCompute(ComputeID, ComputeMap *); 00087 int numNonbondedSelf; 00088 int numNonbondedPair; 00089 00090 GlobalMasterServer *masterServerObject; /* master part of global computes */ 00091 ComputeDPME *computeDPMEObject; 00092 00093 ComputeEwald *computeEwaldObject; 00094 00095 ComputeNonbondedCUDA *computeNonbondedCUDAObject; 00096 00097 ComputeNonbondedWorkArrays *computeNonbondedWorkArrays; 00098 00099 int updateComputesCount; 00100 int updateComputesReturnEP; 00101 CkGroupID updateComputesReturnChareID; 00102 00103 int *computeFlag; 00104 00105 class ComputeElem { 00106 public: 00107 ComputeID cid; 00108 Compute *c; 00109 00110 int operator<(ComputeElem e) { return (cid < e.cid); } 00111 int operator==(ComputeElem e) { return (cid == e.cid); } 00112 00113 ComputeElem(ComputeID id=-1, Compute *compute=NULL) : 00114 cid(id), c(compute) {}; 00115 ~ComputeElem() { }; 00116 ComputeElem& operator=(const ComputeElem &e) { 00117 cid = e.cid; c = e.c; // Do not delete c! This op only used to shuffle 00118 // we delete the c here only when the Compute is 00119 // moved off! 00120 return(*this); 00121 }; 00122 }; 00123 00124 int numComputes; 00125 00126 typedef ResizeArray<ComputeElem> ComputeList; 00127 typedef ResizeArray<int> ComputeIndex; 00128 00129 // global patch number to local patch table conversion table 00130 ComputeIndex computeIndex; 00131 00132 // an array of compute pointers residing on this node 00133 ComputeList computeList; 00134 00135 int workDistribGroup; 00136 }; 00137 00138 #endif /* COMPUTEMGR_H */ 00139
1.3.9.1