#include <ComputeMgr.h>
Inheritance diagram for ComputeMgr:

|
|
Definition at line 79 of file ComputeMgr.C. References computeGlobalObject. 00080 {
00081 CkpvAccess(BOCclass_group).computeMgr = thisgroup;
00082 computeGlobalObject = 0;
00083 computeDPMEObject = 0;
00084 computeEwaldObject = 0;
00085 computeNonbondedCUDAObject = 0;
00086 computeNonbondedWorkArrays = new ComputeNonbondedWorkArrays;
00087 }
|
|
|
Definition at line 89 of file ComputeMgr.C. 00090 {
00091 delete computeNonbondedWorkArrays;
00092 }
|
|
|
Definition at line 595 of file ComputeMgr.C. References GlobalMasterServer::addClient(), SimParameters::colvarsOn, ComputeMap::computeData, DebugM, SimParameters::firstTimestep, SimParameters::freeEnergyOn, SimParameters::globalForcesOn, GlobalMasterColvars, SimParameters::IMDon, j, SimParameters::miscForcesOn, Node::molecule, Node::myid(), ComputeMap::nComputes, Molecule::numAtoms, Node::Object(), ComputeNonbondedUtil::select(), Node::simParameters, simParams, SimParameters::SMDDir, SimParameters::SMDFile, SimParameters::SMDk, SimParameters::SMDk2, SimParameters::SMDOn, SimParameters::SMDOutputFreq, SimParameters::SMDVel, SimParameters::tclForcesOn, and SimParameters::TMDOn. Referenced by Node::startup(). 00596 {
00597 Node *node = Node::Object();
00598 SimParameters *simParams = node->simParameters;
00599 int myNode = node->myid();
00600
00601 numNonbondedSelf = 0;
00602 numNonbondedPair = 0;
00603 ComputeNonbondedUtil::select();
00604
00605 if ( simParams->globalForcesOn && !myNode )
00606 {
00607 DebugM(4,"Mgr running on Node "<<CkMyPe()<<"\n");
00608 /* create a master server to allow multiple masters */
00609 masterServerObject = new GlobalMasterServer(this,
00610 PatchMap::Object()->numNodesWithPatches());
00611
00612 /* create the individual global masters */
00613 // masterServerObject->addClient(new GlobalMasterTest());
00614 if (simParams->tclForcesOn)
00615 masterServerObject->addClient(new GlobalMasterTcl());
00616 if (simParams->IMDon)
00617 masterServerObject->addClient(new GlobalMasterIMD());
00618
00619 if (simParams->SMDOn)
00620 masterServerObject->addClient(
00621 new GlobalMasterSMD(simParams->SMDk, simParams->SMDk2,
00622 simParams->SMDVel,
00623 simParams->SMDDir, simParams->SMDOutputFreq,
00624 simParams->firstTimestep, simParams->SMDFile,
00625 node->molecule->numAtoms)
00626 );
00627 if (simParams->TMDOn)
00628 masterServerObject->addClient(new GlobalMasterTMD());
00629 if (simParams->miscForcesOn)
00630 masterServerObject->addClient(new GlobalMasterMisc());
00631 if ( simParams->freeEnergyOn )
00632 masterServerObject->addClient(new GlobalMasterFreeEnergy());
00633 if ( simParams->colvarsOn )
00634 masterServerObject->addClient(new GlobalMasterColvars());
00635
00636 }
00637
00638 for (int i=0; i < map->nComputes; i++)
00639 {
00640 if ( ! ( i % 100 ) )
00641 {
00642 }
00643 if ( map->computeData[i].node != myNode ) continue;
00644 DebugM(1,"Compute " << i << '\n');
00645 DebugM(1," node = " << map->computeData[i].node << '\n');
00646 DebugM(1," type = " << map->computeData[i].type << '\n');
00647 DebugM(1," patchBased = " << map->computeData[i].patchBased << '\n');
00648 DebugM(1," numPids = " << map->computeData[i].numPids << '\n');
00649 DebugM(1," numPidsAllocated = " << map->computeData[i].numPidsAllocated << '\n');
00650 for (int j=0; j < map->computeData[i].numPids; j++)
00651 {
00652 // DebugM(1," pid " << map->computeData[i].pids[j] << '\n');
00653 if (!((j+1) % 6))
00654 DebugM(1,'\n');
00655 }
00656 DebugM(1,"\n---------------------------------------");
00657 DebugM(1,"---------------------------------------\n");
00658
00659 createCompute(i, map);
00660
00661 }
00662
00663 }
|
|
|
Definition at line 254 of file ComputeMgr.C. References DebugM. 00255 {
00256
00257 // if (!--updateComputesCount) {
00258 DebugM(4, "doneUpdateLocalComputes on Pe("<<CkMyPe()<<")\n");
00259 void *msg = CkAllocMsg(0,0,0);
00260 CkSendMsgBranch(updateComputesReturnEP,msg,0,updateComputesReturnChareID);
00261 // }
00262 }
|
|
|
Definition at line 794 of file ComputeMgr.C. References ComputeConsForceMsg::aid, Molecule::consForce, Molecule::consForceIndexes, ComputeConsForceMsg::f, int32, Node::molecule, Molecule::numAtoms, Node::Object(), and ResizeArray< Elem >::size(). 00795 {
00796 Molecule *m = Node::Object()->molecule;
00797 delete [] m->consForceIndexes;
00798 delete [] m->consForce;
00799 int n = msg->aid.size();
00800 if (n > 0)
00801 {
00802 m->consForceIndexes = new int32[m->numAtoms];
00803 m->consForce = new Vector[n];
00804 int i;
00805 for (i=0; i<m->numAtoms; i++) m->consForceIndexes[i] = -1;
00806 for (i=0; i<msg->aid.size(); i++)
00807 {
00808 m->consForceIndexes[msg->aid[i]] = i;
00809 m->consForce[i] = msg->f[i];
00810 }
00811 }
00812 else
00813 {
00814 m->consForceIndexes = NULL;
00815 m->consForce = NULL;
00816 }
00817 delete msg;
00818 }
|
|
|
Definition at line 764 of file ComputeMgr.C. References NAMD_die(), and PatchMap::Object(). 00765 {
00766 if ( computeDPMEObject )
00767 {
00768 #ifdef DPME
00769 computeDPMEObject->recvData(msg);
00770 #endif
00771 }
00772 else if ( ! (PatchMap::Object())->numHomePatches() ) delete msg;
00773 else NAMD_die("ComputeMgr::computeDPMEObject is NULL!");
00774 }
|
|
|
Definition at line 782 of file ComputeMgr.C. References NAMD_die(), and PatchMap::Object(). 00783 {
00784 if ( computeDPMEObject )
00785 {
00786 #ifdef DPME
00787 computeDPMEObject->recvResults(msg);
00788 #endif
00789 }
00790 else if ( ! (PatchMap::Object())->numHomePatches() ) delete msg;
00791 else NAMD_die("ComputeMgr::computeDPMEObject is NULL!");
00792 }
|
|
|
Definition at line 730 of file ComputeMgr.C. References NAMD_die(), and ComputeEwald::recvData(). 00731 {
00732 if (computeEwaldObject)
00733 computeEwaldObject->recvData(msg);
00734 else NAMD_die("ComputeMgr::computeEwaldObject in recvData is NULL!");
00735 }
|
|
|
Definition at line 742 of file ComputeMgr.C. References NAMD_die(), PatchMap::Object(), and ComputeEwald::recvResults(). 00743 {
00744 if (computeEwaldObject)
00745 computeEwaldObject->recvResults(msg);
00746 else if ( ! (PatchMap::Object())->numHomePatches() ) delete msg;
00747 else NAMD_die("ComputeMgr::computeEwaldObject in recvResults is NULL!");
00748 }
|
|
|
Definition at line 671 of file ComputeMgr.C. References computeGlobalObject, NAMD_die(), PatchMap::Object(), and ComputeGlobal::recvConfig(). 00672 {
00673 if ( computeGlobalObject )
00674 {
00675 computeGlobalObject->recvConfig(msg);
00676 }
00677 else if ( ! (PatchMap::Object())->numHomePatches() ) delete msg;
00678 else NAMD_die("ComputeMgr::computeGlobalObject is NULL!");
00679 }
|
|
|
Definition at line 687 of file ComputeMgr.C. References NAMD_die(), and GlobalMasterServer::recvData(). 00688 {
00689 if (masterServerObject) // make sure it has been initialized
00690 {
00691 masterServerObject->recvData(msg);
00692 }
00693 else NAMD_die("ComputeMgr::masterServerObject is NULL!");
00694 }
|
|
|
Definition at line 701 of file ComputeMgr.C. References computeGlobalObject, NAMD_die(), PatchMap::Object(), and ComputeGlobal::recvResults(). 00702 {
00703 if ( computeGlobalObject )
00704 {
00705 computeGlobalObject->recvResults(msg);
00706 }
00707 else if ( ! (PatchMap::Object())->numHomePatches() ) delete msg;
00708 else NAMD_die("ComputeMgr::computeGlobalObject is NULL!");
00709 }
|
|
|
Definition at line 825 of file ComputeMgr.C. References ComputeNonbondedCUDA::recvYieldDevice(). 00825 {
00826 #ifdef NAMD_CUDA
00827 computeNonbondedCUDAObject->recvYieldDevice(pe);
00828 #endif
00829 }
|
|
|
Definition at line 750 of file ComputeMgr.C. References NAMD_die(), and PatchMap::Object(). 00751 {
00752 if ( computeDPMEObject )
00753 {
00754 #ifdef DPME
00755 int node = computeDPMEObject->getMasterNode();
00756 CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
00757 cm.recvComputeDPMEData(msg,node);
00758 #endif
00759 }
00760 else if ( ! (PatchMap::Object())->numHomePatches() ) delete msg;
00761 else NAMD_die("ComputeMgr::computeDPMEObject is NULL!");
00762 }
|
|
||||||||||||
|
Definition at line 776 of file ComputeMgr.C. 00777 {
00778 CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
00779 cm[node].recvComputeDPMEResults(msg);
00780 }
|
|
|
Definition at line 714 of file ComputeMgr.C. References ComputeEwald::getMasterNode(), NAMD_die(), PatchMap::numHomePatches(), and PatchMap::Object(). Referenced by ComputeEwald::doWork(). 00715 {
00716 if (computeEwaldObject)
00717 {
00718 int node = computeEwaldObject->getMasterNode();
00719 CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
00720 cm[node].recvComputeEwaldData(msg);
00721 }
00722 else if (!PatchMap::Object()->numHomePatches())
00723 {
00724 CkPrintf("skipping message on Pe(%d)\n", CkMyPe());
00725 delete msg;
00726 }
00727 else NAMD_die("ComputeMgr::computeEwaldObject is NULL!");
00728 }
|
|
|
Definition at line 737 of file ComputeMgr.C. Referenced by ComputeEwald::recvData(). 00738 {
00739 (CProxy_ComputeMgr(CkpvAccess(BOCclass_group).computeMgr)).recvComputeEwaldResults(msg);
00740 }
|
|
|
Definition at line 666 of file ComputeMgr.C. 00667 {
00668 (CProxy_ComputeMgr(CkpvAccess(BOCclass_group).computeMgr)).recvComputeGlobalConfig(msg);
00669 }
|
|
|
Definition at line 681 of file ComputeMgr.C. Referenced by ComputeGlobal::doWork(). 00682 {
00683 CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
00684 cm[0].recvComputeGlobalData(msg);
00685 }
|
|
|
Definition at line 696 of file ComputeMgr.C. 00697 {
00698 (CProxy_ComputeMgr(CkpvAccess(BOCclass_group).computeMgr)).recvComputeGlobalResults(msg);
00699 }
|
|
|
Definition at line 820 of file ComputeMgr.C. Referenced by cuda_check_local_calc(), and cuda_check_remote_calc(). 00820 {
00821 CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
00822 cm[pe].recvYieldDevice(CkMyPe());
00823 }
|
|
||||||||||||
|
Definition at line 94 of file ComputeMgr.C. References iERRORF, iout, and iPE(). Referenced by LdbCoordinator::ExecuteMigrations(). 00095 {
00096 updateComputesReturnEP = ep;
00097 updateComputesReturnChareID = chareID;
00098 updateComputesCount = CkNumPes();
00099
00100 if (CkMyPe())
00101 {
00102 iout << iPE << iERRORF << "updateComputes signaled on wrong Pe!\n" << endi;
00103 CkExit();
00104 return;
00105 }
00106
00107 CkStartQD(CkIndex_ComputeMgr::updateComputes2((CkQdMsg*)0),&thishandle);
00108 }
|
|
|
Definition at line 110 of file ComputeMgr.C. References WorkDistrib::saveComputeMapChanges(). 00111 {
00112 delete msg;
00113
00114 CProxy_WorkDistrib wd(CkpvAccess(BOCclass_group).workDistrib);
00115 WorkDistrib *workDistrib = wd.ckLocalBranch();
00116 workDistrib->saveComputeMapChanges(CkIndex_ComputeMgr::updateComputes3(),thisgroup);
00117 }
|
|
|
Definition at line 119 of file ComputeMgr.C. 00120 {
00121 CProxy_ComputeMgr(thisgroup).updateLocalComputes();
00122 }
|
|
|
Definition at line 124 of file ComputeMgr.C. References ProxyMgr::createProxy(), DebugM, ComputeMap::newNode(), ComputeMap::node(), ComputeMap::numComputes(), ComputeMap::numPids(), ComputeMap::Object(), ComputeMap::pid(), ComputeMap::setNewNode(), and ComputeMap::setNode(). 00125 {
00126 ComputeMap *computeMap = ComputeMap::Object();
00127 CProxy_ProxyMgr pm(CkpvAccess(BOCclass_group).proxyMgr);
00128 ProxyMgr *proxyMgr = pm.ckLocalBranch();
00129
00130 computeFlag = new int[computeMap->numComputes()];
00131
00132 for (int i=0; i<computeMap->numComputes(); i++)
00133 {
00134 DebugM(3, "updateLocalComputes("<<i<<") curnode="<<computeMap->node(i)
00135 <<" newnode="<<computeMap->newNode(i)<<"\n");
00136 computeFlag[i] = 0;
00137
00138 if (computeMap->newNode(i) == CkMyPe() && computeMap->node(i) != CkMyPe())
00139 {
00140 DebugM(4, "updateLocal - creating new computeID("<<i<<")\n");
00141 computeFlag[i] = 1;
00142 computeMap->setNode(i,computeMap->newNode(i));
00143 for (int n=0; n < computeMap->numPids(i); n++)
00144 {
00145 proxyMgr->createProxy(computeMap->pid(i,n));
00146 }
00147 }
00148 else if (computeMap->node(i) == CkMyPe() &&
00149 (computeMap->newNode(i) != -1 && computeMap->newNode(i) != CkMyPe() ))
00150 {
00151 DebugM(4, "updateLocal - deleting computeID("<<i<<")\n");
00152 computeFlag[i] = -1;
00153 computeMap->setNode(i,computeMap->newNode(i));
00154 }
00155 else if (computeMap->newNode(i) != -1)
00156 {
00157 computeMap->setNode(i,computeMap->newNode(i));
00158 }
00159 computeMap->setNewNode(i,-1);
00160 }
00161
00162 if (!CkMyPe())
00163 {
00164 CkStartQD(CkIndex_ComputeMgr::updateLocalComputes2((CkQdMsg*)0), &thishandle);
00165 }
00166 }
|
|
|
Definition at line 169 of file ComputeMgr.C. 00170 {
00171 delete msg;
00172 CProxy_ComputeMgr(thisgroup).updateLocalComputes3();
00173 }
|
|
|
Definition at line 176 of file ComputeMgr.C. References PatchMap::checkMap(), ComputeMap::checkMap(), ComputeMap::compute(), DebugM, ComputeMap::numComputes(), PatchMap::Object(), ComputeMap::Object(), ComputeMap::registerCompute(), and ProxyMgr::removeUnusedProxies(). 00177 {
00178 ComputeMap *computeMap = ComputeMap::Object();
00179 CProxy_ProxyMgr pm(CkpvAccess(BOCclass_group).proxyMgr);
00180 ProxyMgr *proxyMgr = pm.ckLocalBranch();
00181
00182 ProxyMgr::nodecount = 0;
00183
00184 for (int i=0; i<computeMap->numComputes(); i++)
00185 {
00186 if (1 == computeFlag[i])
00187 {
00188 DebugM(4, "updateLocalCompute3() - create computeID(" << i << ")\n");
00189 createCompute(i, computeMap);
00190 }
00191 else if (-1 == computeFlag[i])
00192 {
00193 // remove this compute
00194 DebugM(4, "updateLocalCompute3() - delete computeID(" << i << ")\n");
00195 delete computeMap->compute(i);
00196 computeMap->registerCompute(i,NULL);
00197 }
00198 }
00199 delete[] computeFlag;
00200
00201 proxyMgr->removeUnusedProxies();
00202
00203 DebugM(4, "msg to doneUpdateLocalComputes on Pe("<<CkMyPe()<<")\n");
00204 ComputeMap::Object()->checkMap();
00205 PatchMap::Object()->checkMap();
00206
00207 if (!CkMyPe())
00208 {
00209 CkStartQD(CkIndex_ComputeMgr::updateLocalComputes4((CkQdMsg*)0), &thishandle);
00210 // added a new phase to build spanning tree after load balance
00211 // was
00212 // CkStartQD(CProxy_ComputeMgr::ckIdx_doneUpdateLocalComputes(), &thishandle);
00213 }
00214 //CSendMsgBranch(ComputeMgr, doneUpdateLocalComputes, thisgroup, 0);
00215 }
|
|
|
Definition at line 218 of file ComputeMgr.C. 00219 {
00220 delete msg;
00221 CProxy_ComputeMgr(thisgroup).updateLocalComputes5();
00222 }
|
|
|
Definition at line 227 of file ComputeMgr.C. References ProxyMgr::buildProxySpanningTree2(), firstphase, ProxyMgr::Object(), proxySendSpanning, and ProxyMgr::sendSpanningTrees(). 00228 {
00229 // we always use the centralized building of spanning tree
00230 // distributed building of ST called in Node.C only
00231 if (proxySendSpanning || proxyRecvSpanning)
00232 ProxyMgr::Object()->buildProxySpanningTree2();
00233
00234 // this code needs to be turned on if we want to
00235 // shift the creation of ST to the load balancer
00236
00237 #if 0
00238 if (proxySendSpanning || proxyRecvSpanning)
00239 {
00240 if (firstphase)
00241 ProxyMgr::Object()->buildProxySpanningTree2();
00242 else
00243 if (CkMyPe() == 0)
00244 ProxyMgr::Object()->sendSpanningTrees();
00245
00246 firstphase = 0;
00247 }
00248 #endif
00249
00250 if (!CkMyPe())
00251 CkStartQD(CkIndex_ComputeMgr::doneUpdateLocalComputes(), &thishandle);
00252 }
|
|
|
Definition at line 80 of file ComputeMgr.h. Referenced by ComputeMgr(), Sequencer::integrate(), recvComputeGlobalConfig(), and recvComputeGlobalResults(). |
1.3.9.1