#include <ComputeMap.h>
Public Member Functions | |
| void | checkMap () |
| ~ComputeMap (void) | |
| void | registerCompute (ComputeID cid, Compute *c) |
| int | numComputes (void) |
| int | numPatchBased (void) |
| int | numAtomBased (void) |
| int | isPatchBased (ComputeID cid) |
| int | isAtomBased (ComputeID cid) |
| int | node (ComputeID cid) |
| void | setNode (ComputeID cid, NodeID node) |
| NodeID | newNode (ComputeID cid) |
| void | setNewNode (ComputeID cid, NodeID node) |
| int | numPids (ComputeID cid) |
| int | pid (ComputeID cid, int i) |
| int | trans (ComputeID cid, int i) |
| ComputeType | type (ComputeID cid) |
| int | partition (ComputeID cid) |
| int | numPartitions (ComputeID cid) |
| int | allocateCids () |
| ComputeID | storeCompute (int node, int maxPids, ComputeType type, int partition=0, int numPartitions=1) |
| void | newPid (ComputeID cid, int pid, int trans=13) |
| void | printComputeMap (void) |
| Compute * | compute (ComputeID cid) |
Static Public Member Functions | |
| ComputeMap * | Instance () |
| ComputeMap * | Object () |
Protected Member Functions | |
| int | packSize (void) |
| void | pack (char *buf) |
| void | unpack (char *buf) |
| ComputeMap (void) | |
Friends | |
| class | ComputeMgr |
| class | WorkDistrib |
|
|
Definition at line 40 of file ComputeMap.C. 00041 {
00042 delete patchArena;
00043 }
|
|
|
Definition at line 31 of file ComputeMap.C. 00032 {
00033 nComputes=0;
00034 nPatchBased=0;
00035 nAtomBased=0;
00036 patchArena=0;
00037 }
|
|
|
Definition at line 207 of file ComputeMap.C. References ResizeArray< Elem >::resize(), and ObjectArena< Type >::setBlockSize(). Referenced by WorkDistrib::mapComputes(). 00208 {
00209 delete patchArena; // oldComputeData[i].pids now invalid!
00210 patchArena = new ObjectArena<PatchRec>; // use for computeData[i].pids
00211 patchArena->setBlockSize(256);
00212 nComputes = nPatchBased = nAtomBased = 0;
00213 computeData.resize(500);
00214 computeData.resize(0);
00215
00216 return 0;
00217 }
|
|
|
Definition at line 46 of file ComputeMap.C. References Compute::cid, compute(), and DebugM. Referenced by ComputeMgr::updateLocalComputes3(). 00047 {
00048 int computeCount = nComputes;
00049 for (int i=0; i<nComputes; i++) {
00050 if (computeData[i].compute) {
00051 computeCount++;
00052 if (! (computeData[i].compute->cid == i)) {
00053 DebugM(4, "ComputeID("<<computeData[i].compute->cid<<") != ComputeID("
00054 << i <<")\n");
00055 }
00056 }
00057 }
00058 DebugM(4, "Compute Count = " << computeCount << "\n");
00059 }
|
|
|
Definition at line 141 of file ComputeMap.h. Referenced by checkMap(), Patch::positionsReady(), and ComputeMgr::updateLocalComputes3(). 00141 { return (computeData[cid].compute); };
|
|
|
Definition at line 22 of file ComputeMap.C. Referenced by Node::Node(). 00022 {
00023 if (CkpvAccess(ComputeMap_instance) == 0) {
00024 CkpvAccess(ComputeMap_instance) = new ComputeMap; // this is never deleted
00025 }
00026 return CkpvAccess(ComputeMap_instance);
00027 }
|
|
|
Definition at line 161 of file ComputeMap.C. 00162 {
00163 return !computeData[cid].patchBased;
00164 }
|
|
|
Definition at line 155 of file ComputeMap.C. Referenced by ProxyMgr::createProxies(). 00156 {
00157 return computeData[cid].patchBased;
00158 }
|
|
|
Definition at line 105 of file ComputeMap.h. References NodeID. Referenced by WorkDistrib::recvComputeMapChanges(), WorkDistrib::saveComputeMapChanges(), and ComputeMgr::updateLocalComputes(). 00105 {
00106 return (computeData[cid].moveToNode);
00107 }
|
|
||||||||||||||||
|
|
|
|
Definition at line 95 of file ComputeMap.h. Referenced by ProxyMgr::createProxies(), LdbCoordinator::initialize(), printComputeMap(), WorkDistrib::recvComputeMapChanges(), WorkDistrib::saveComputeMapChanges(), and ComputeMgr::updateLocalComputes(). 00095 {
00096 return computeData[cid].node;
00097 }
|
|
|
Definition at line 149 of file ComputeMap.C. 00150 {
00151 return nAtomBased;
00152 }
|
|
|
Definition at line 74 of file ComputeMap.h. Referenced by ProxyMgr::createProxies(), dumpbench(), LdbCoordinator::initialize(), WorkDistrib::recvComputeMapChanges(), registerUserEventsForAllComputeObjs(), WorkDistrib::saveComputeMapChanges(), ComputeMgr::updateLocalComputes(), and ComputeMgr::updateLocalComputes3(). 00074 {
00075 return nComputes;
00076 }
|
|
|
Definition at line 199 of file ComputeMap.C. 00200 {
00201 if (nComputes)
00202 return computeData[cid].numPartitions;
00203 else return computeErrorType;
00204 }
|
|
|
Definition at line 143 of file ComputeMap.C. 00144 {
00145 return nPatchBased;
00146 }
|
|
|
Definition at line 167 of file ComputeMap.C. Referenced by ProxyMgr::createProxies(), LdbCoordinator::initialize(), printComputeMap(), and ComputeMgr::updateLocalComputes(). 00168 {
00169 return computeData[cid].numPids;
00170 }
|
|
|
Definition at line 61 of file ComputeMap.h. Referenced by Compute::Compute(), ProxyMgr::createProxies(), dumpbench(), WorkDistrib::mapComputes(), Patch::positionsReady(), WorkDistrib::recvComputeMapChanges(), registerUserEventsForAllComputeObjs(), WorkDistrib::saveComputeMapChanges(), WorkDistrib::saveMaps(), WorkDistrib::sendMaps(), Node::startup(), ComputeMgr::updateLocalComputes(), and ComputeMgr::updateLocalComputes3(). 00061 { return CkpvAccess(ComputeMap_instance); }
|
|
|
Definition at line 77 of file ComputeMap.C. Referenced by WorkDistrib::sendMaps(). 00078 {
00079 DebugM(4,"Packing ComputeMap\n");
00080 int i,j;
00081
00082 // fill in the data
00083 char *b = buffer;
00084 PACK(int,nPatchBased);
00085 PACK(int,nAtomBased);
00086 PACK(int,nComputes);
00087 for(i=0;i<nComputes;++i)
00088 {
00089 PACK(ComputeData,computeData[i]);
00090 for(j=0;j<computeData[i].numPidsAllocated;++j)
00091 PACK(PatchRec,computeData[i].pids[j]);
00092 }
00093 }
|
|
|
Definition at line 64 of file ComputeMap.C. Referenced by WorkDistrib::sendMaps(). 00065 {
00066 int i;
00067 int size = 0;
00068 size += 4 * sizeof(int);
00069 for(i=0;i<nComputes;++i)
00070 {
00071 size += sizeof(ComputeData);
00072 size += computeData[i].numPidsAllocated * sizeof(PatchRec);
00073 }
00074 return size;
00075 }
|
|
|
Definition at line 192 of file ComputeMap.C. Referenced by dumpbench(). 00193 {
00194 if (nComputes)
00195 return computeData[cid].partition;
00196 else return computeErrorType;
00197 }
|
|
||||||||||||
|
Definition at line 173 of file ComputeMap.C. Referenced by ProxyMgr::createProxies(), dumpbench(), LdbCoordinator::initialize(), printComputeMap(), and ComputeMgr::updateLocalComputes(). 00174 {
00175 return computeData[cid].pids[i].pid;
00176 }
|
|
|
Definition at line 259 of file ComputeMap.C. References DebugM, iINFO(), iout, node(), numPids(), and pid(). Referenced by Node::startup(). 00260 {
00261 iout << iINFO << "CREATING " << nComputes << " COMPUTE OBJECTS\n" << endi;
00262 DebugM(2,"---------------------------------------");
00263 DebugM(2,"---------------------------------------\n");
00264
00265 DebugM(2,"nComputes = " << nComputes << '\n');
00266 DebugM(2,"nPatchBased = " << nPatchBased << '\n');
00267 DebugM(2,"nAtomBased = " << nAtomBased << '\n');
00268 DebugM(2,"nAllocated = " << nComputes << '\n');
00269 for(int i=0; i < nComputes; i++)
00270 {
00271 DebugM(2,"Compute " << i << '\n');
00272 DebugM(2," node = " << computeData[i].node << '\n');
00273 DebugM(2," patchBased = " << computeData[i].patchBased << '\n');
00274 DebugM(2," numPids = " << computeData[i].numPids << '\n');
00275 DebugM(2," numPidsAllocated = " << computeData[i].numPidsAllocated << '\n');
00276 for(int j=0; j < computeData[i].numPids; j++)
00277 {
00278 DebugM(2,computeData[i].pids[j].pid);
00279 if (!((j+1) % 6))
00280 DebugM(2,'\n');
00281 }
00282 DebugM(2,"\n---------------------------------------");
00283 DebugM(2,"---------------------------------------\n");
00284
00285 }
00286 }
|
|
||||||||||||
|
Definition at line 67 of file ComputeMap.h. Referenced by ComputeMgr::updateLocalComputes3(). 00067 {
00068 computeData[cid].compute = c;
00069 computeData[cid].moveToNode = -1;
00070 }
|
|
||||||||||||
|
Definition at line 109 of file ComputeMap.h. Referenced by WorkDistrib::recvComputeMapChanges(), and ComputeMgr::updateLocalComputes(). 00109 {
00110 computeData[cid].moveToNode = node;
00111 }
|
|
||||||||||||
|
Definition at line 99 of file ComputeMap.h. Referenced by ComputeMgr::updateLocalComputes(). 00099 {
00100 computeData[cid].node = node;
00101 }
|
|
||||||||||||||||||||||||
|
Definition at line 220 of file ComputeMap.C. References ComputeID, ObjectArena< Type >::getNewArray(), and ResizeArray< Elem >::resize(). 00223 {
00224 int cid;
00225
00226 cid = nComputes;
00227 nComputes++;
00228 computeData.resize(nComputes);
00229
00230 computeData[cid].node=inode;
00231
00232 computeData[cid].type = type;
00233 computeData[cid].partition = partition;
00234 computeData[cid].numPartitions = numPartitions;
00235
00236 computeData[cid].patchBased = true;
00237 nPatchBased++;
00238
00239 computeData[cid].numPids = 0;
00240 computeData[cid].pids = patchArena->getNewArray(maxPids);
00241
00242 computeData[cid].numPidsAllocated = maxPids;
00243
00244 return cid;
00245 }
|
|
||||||||||||
|
Definition at line 178 of file ComputeMap.C. Referenced by dumpbench(). 00179 {
00180 return computeData[cid].pids[i].trans;
00181 }
|
|
|
Definition at line 184 of file ComputeMap.C. References ComputeType. Referenced by Compute::Compute(), dumpbench(), LdbCoordinator::initialize(), WorkDistrib::recvComputeMapChanges(), and registerUserEventsForAllComputeObjs(). 00185 {
00186 if (nComputes)
00187 return computeData[cid].type;
00188 else return computeErrorType;
00189 }
|
|
|
Definition at line 98 of file ComputeMap.C. References DebugM, ObjectArena< Type >::getNewArray(), NAMD_die(), ObjectArena< Type >::setBlockSize(), and UNPACK. Referenced by WorkDistrib::saveMaps(). 00099 {
00100 // Must copy over the Compute * to new ComputeMap!
00101 ResizeArray<ComputeData> oldComputeData = computeData;
00102 delete patchArena; // oldComputeData[i].pids now invalid!
00103 patchArena = new ObjectArena<PatchRec>; // use for computeData[i].pids
00104 patchArena->setBlockSize(256);
00105 int oldNComputes = nComputes;
00106
00107 DebugM(4,"Unpacking ComputeMap\n");
00108 int i,j;
00109 char *b = (char*)ptr;
00110 UNPACK(int,nPatchBased);
00111 UNPACK(int,nAtomBased);
00112 {
00113 // defeat some over-zealous compilers
00114 int nComputes_tmp;
00115 UNPACK(int,nComputes_tmp);
00116 nComputes = nComputes_tmp;
00117 }
00118 ResizeArray<ComputeData> newComputeData(nComputes);
00119 computeData = newComputeData;
00120 for(i=0;i<nComputes;++i)
00121 {
00122 UNPACK(ComputeData,computeData[i]);
00123 computeData[i].pids =
00124 patchArena->getNewArray(computeData[i].numPidsAllocated);
00125 for(j=0;j<computeData[i].numPidsAllocated;++j)
00126 UNPACK(PatchRec,computeData[i].pids[j]);
00127 }
00128
00129 if (oldNComputes) {
00130 if (nComputes != oldNComputes) {
00131 NAMD_die("number of computes in new patchmap has changed!\n");
00132 return;
00133 }
00134
00135 for (int i=0; i<nComputes; i++) {
00136 computeData[i].compute = oldComputeData[i].compute;
00137 }
00138 }
00139 DebugM(4,"Done Unpacking ComputeMap\n");
00140 }
|
|
|
Definition at line 143 of file ComputeMap.h. |
|
|
Definition at line 172 of file ComputeMap.h. |
1.3.9.1