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

|
|
Definition at line 99 of file Node.C. References atomMap, computeMap, computeMgr, configList, DebugM, eventEndOfTimeStep, GroupInitMsg::group, imd, ComputeMap::Instance(), AtomMap::Instance(), PatchMap::Instance(), ldbCoordinator, molecule, NAMD_bug(), output, parameters, patchMap, pdb, simParameters, state, and workDistrib. 00100 {
00101 DebugM(4,"Creating Node\n");
00102 #if(CMK_CCS_AVAILABLE && CMK_WEB_MODE)
00103 CApplicationInit();
00104 #endif
00105 if (CkpvAccess(Node_instance) == 0) {
00106 CkpvAccess(Node_instance) = this;
00107 eventEndOfTimeStep = traceRegisterUserEvent("EndOfTimeStep");
00108 } else {
00109 NAMD_bug("Node::Node() - another instance of Node exists!");
00110 }
00111
00112 CkpvAccess(BOCclass_group) = msg->group;
00113 delete msg;
00114
00115 CkpvAccess(BOCclass_group).node = thisgroup;
00116
00117 startupPhase = 0;
00118
00119 molecule = NULL;
00120 parameters = NULL;
00121 simParameters = NULL;
00122 configList = NULL;
00123 pdb = NULL;
00124 state = NULL;
00125 output = NULL;
00126 imd = new IMDOutput;
00127
00128 #if USE_HPM
00129 // assumes that this will be done only on BG/P
00130 TopoManager *tmgr = new TopoManager();
00131 int x, y, z;
00132 tmgr->rankToCoordinates(CkMyPe(), x, y, z, localRankOnNode);
00133 delete tmgr;
00134 #endif
00135
00136 DebugM(4,"Creating PatchMap, AtomMap, ComputeMap\n");
00137 patchMap = PatchMap::Instance();
00138 atomMap = AtomMap::Instance();
00139 computeMap = ComputeMap::Instance();
00140
00141 DebugM(4,"Binding to BOC's\n");
00142 CProxy_PatchMgr pm(CkpvAccess(BOCclass_group).patchMgr);
00143 patchMgr = pm.ckLocalBranch();
00144 CProxy_ProxyMgr prm(CkpvAccess(BOCclass_group).proxyMgr);
00145 proxyMgr = prm.ckLocalBranch();
00146 CProxy_WorkDistrib wd(CkpvAccess(BOCclass_group).workDistrib);
00147 workDistrib = wd.ckLocalBranch();
00148 CProxy_ComputeMgr cm(CkpvAccess(BOCclass_group).computeMgr);
00149 computeMgr = cm.ckLocalBranch();
00150 CProxy_LdbCoordinator lc(CkpvAccess(BOCclass_group).ldbCoordinator);
00151 ldbCoordinator = lc.ckLocalBranch();
00152
00153 }
|
|
|
Definition at line 158 of file Node.C. 00159 {
00160 delete output;
00161 delete computeMap;
00162 delete atomMap;
00163 delete patchMap;
00164 delete CkpvAccess(comm);
00165 }
|
|
|
|
|
|
|
|
|
Definition at line 695 of file Node.C. References BackEnd::exit(), iERROR(), and iout. 00695 {
00696 iout << iERROR << "Exiting prematurely; see error messages above.\n" << endi;
00697 BackEnd::exit();
00698 delete msg;
00699 }
|
|
|
Definition at line 687 of file Node.C. References sendEnableEarlyExit(). Referenced by Sequencer::maximumMove(), Sequencer::rattle1(), and recvEnableEarlyExit(). 00687 {
00688 if ( CkMyPe() ) {
00689 sendEnableEarlyExit();
00690 } else {
00691 CkStartQD(CkIndex_Node::earlyExit((CkQdMsg*)0),&thishandle);
00692 }
00693 }
|
|
|
Definition at line 662 of file Node.C. References sendEnableExitScheduler(). Referenced by BackEnd::awaken(), and recvEnableExitScheduler(). 00662 {
00663 if ( CkMyPe() ) {
00664 sendEnableExitScheduler();
00665 } else {
00666 CkStartQD(CkIndex_Node::exitScheduler((CkQdMsg*)0),&thishandle);
00667 }
00668 }
|
|
|
Definition at line 613 of file Node.C. 00613 {
00614 CkStartQD(CkIndex_Node::scriptBarrier((CkQdMsg*)0),&thishandle);
00615 }
|
|
|
Definition at line 670 of file Node.C. 00670 {
00671 //CmiPrintf("exitScheduler %d\n",CkMyPe());
00672 CsdExitScheduler();
00673 delete msg;
00674 }
|
|
|
Definition at line 157 of file Node.h. Referenced by Output::coordinate(), and Controller::printEnergies(). 00157 { return script; }
|
|
|
|
|
|
Definition at line 571 of file Node.C. Referenced by startup(). 00571 {
00572 (CProxy_Node(CkpvAccess(BOCclass_group).node)).run();
00573 }
|
|
|
Definition at line 170 of file Node.C. 00170 {
00171 (CProxy_Node(CkpvAccess(BOCclass_group).node)).startup();
00172 }
|
|
|
Definition at line 153 of file Node.h. Referenced by ComputeMgr::createComputes(), WorkDistrib::distributeHomePatches(), WorkDistrib::initAndSendHomePatch(), and LdbCoordinator::initialize(). 00153 { return CkMyPe(); }
|
|
|
Definition at line 154 of file Node.h. Referenced by WorkDistrib::assignNodeToPatch(), LdbCoordinator::initialize(), and LdbCoordinator::nodeDone(). 00154 { return CkNumPes(); }
|
|
|
|
Definition at line 682 of file Node.C. References enableEarlyExit(). 00682 {
00683 delete msg;
00684 enableEarlyExit();
00685 }
|
|
|
Definition at line 656 of file Node.C. References enableExitScheduler(). 00656 {
00657 //CmiPrintf("recvEnableExitScheduler\n");
00658 delete msg;
00659 enableExitScheduler();
00660 }
|
|
||||||||||||
|
Definition at line 644 of file Node.C. References molecule, and Molecule::reloadCharges(). 00644 {
00645 molecule->reloadCharges(charge,n);
00646 }
|
|
|
Definition at line 627 of file Node.C. References molecule, NAMD_die(), Molecule::numAtoms, and Molecule::reloadCharges(). 00627 {
00628 FILE *file = fopen(filename,"r");
00629 if ( ! file ) NAMD_die("node::reloadCharges():Error opening charge file.");
00630
00631 int n = molecule->numAtoms;
00632 float *charge = new float[n];
00633
00634 for ( int i = 0; i < n; ++i ) {
00635 if ( ! fscanf(file,"%f",&charge[i]) )
00636 NAMD_die("Node::reloadCharges():Not enough numbers in charge file.");
00637 }
00638
00639 fclose(file);
00640 CProxy_Node(thisgroup).reloadCharges(charge,n);
00641 delete [] charge;
00642 }
|
|
|
Definition at line 580 of file Node.C. References ResizeArrayIter< T >::begin(), DebugM, ResizeArrayIter< T >::end(), PatchMap::homePatchList(), HomePatchList, iINFO(), iout, memusage_MB(), PatchMap::Object(), NamdState::runController(), HomePatch::runSequencer(), startupTime, and state. 00581 {
00582 // Start Controller (aka scalar Sequencer) on Pe(0)
00583 if ( ! CkMyPe() ) {
00584 state->runController();
00585 }
00586
00587 DebugM(4, "Starting Sequencers\n");
00588 // Run Sequencer on each HomePatch - i.e. start simulation
00589 HomePatchList *hpl = PatchMap::Object()->homePatchList();
00590 ResizeArrayIter<HomePatchElem> ai(*hpl);
00591 for (ai=ai.begin(); ai != ai.end(); ai++) {
00592 HomePatch *patch = (*ai).patch;
00593 patch->runSequencer();
00594 }
00595
00596 if (!CkMyPe()) {
00597 double newTime = CmiWallTimer();
00598 iout << iINFO << "Startup phase " << startupPhase-1 << " took "
00599 << newTime - startupTime << " s, "
00600 << memusage_MB() << " MB of memory in use\n";
00601 iout << iINFO << "Finished startup at " << newTime << " s, "
00602 << memusage_MB() << " MB of memory in use\n\n" << endi;
00603 fflush(stdout);
00604 }
00605
00606 }
|
|
|
Definition at line 705 of file Node.C. References NamdState::configList, configList, NamdState::molecule, molecule, NamdState::parameters, parameters, NamdState::pdb, pdb, NamdState::simParameters, and simParameters. 00706 {
00707 this->molecule = state->molecule;
00708 this->parameters = state->parameters;
00709 this->simParameters = state->simParameters;
00710 this->configList = state->configList;
00711 this->pdb = state->pdb;
00712 this->state = state;
00713 }
|
|
|
Definition at line 617 of file Node.C. 00617 {
00618 delete qmsg;
00619 //script->awaken();
00620 }
|
|
|
Definition at line 622 of file Node.C. References ScriptParamMsg::param, SimParameters::scriptSet(), simParameters, and ScriptParamMsg::value. 00622 {
00623 simParameters->scriptSet(msg->param,msg->value);
00624 delete msg;
00625 }
|
|
|
Definition at line 525 of file Node.C. References NAMD_die(). 00525 {
00526 #ifdef CHARMIZE_NAMD
00527 if(CkMyPe()){
00528 atomDisArr = msg->atomsDis;
00529 }
00530 delete msg;
00531 #else
00532 NAMD_die("sendCharmArrProxies should not be called in this case!");
00533 #endif
00534 }
|
|
|
Definition at line 676 of file Node.C. Referenced by enableEarlyExit(). 00676 {
00677 CkQdMsg *msg = new CkQdMsg;
00678 CProxy_Node nodeProxy(thisgroup);
00679 nodeProxy[0].recvEnableEarlyExit(msg);
00680 }
|
|
|
Definition at line 649 of file Node.C. Referenced by enableExitScheduler(). 00649 {
00650 //CmiPrintf("sendEnableExitScheduler\n");
00651 CkQdMsg *msg = new CkQdMsg;
00652 CProxy_Node nodeProxy(thisgroup);
00653 nodeProxy[0].recvEnableExitScheduler(msg);
00654 }
|
|
|
Definition at line 156 of file Node.h. Referenced by after_backend_init(). 00156 { script = s; }
|
|
|
Definition at line 716 of file Node.C. 00716 {
00717 #if USE_HPM
00718 HPM_Start("500 steps", localRankOnNode);
00719 #endif
00720 }
|
|
|
Definition at line 174 of file Node.C. 00174 {
00175 delete qmsg;
00176 (CProxy_Node(CkpvAccess(BOCclass_group).node)).startup();
00177 }
|
|
|
Definition at line 185 of file Node.C. References AtomMap::allocateMap(), WorkDistrib::assignNodeToPatch(), ProxyMgr::buildProxySpanningTree(), computeMap, computeMgr, ComputeMgr::createComputes(), WorkDistrib::createHomePatches(), LdbCoordinator::createLoadBalancer(), ProxyMgr::createProxies(), DebugM, WorkDistrib::distributeHomePatches(), SimParameters::freeEnergyOn, iINFO(), WorkDistrib::initAndSendHomePatch(), LdbCoordinator::initialize(), iout, SimParameters::isRecvSpanningTreeOn(), SimParameters::isSendSpanningTreeOn(), WorkDistrib::mapComputes(), SlaveInitMsg::master, memusage_MB(), messageRun(), molecule, NAMD_bug(), Molecule::numAtoms, Sync::Object(), LdbCoordinator::Object(), ComputeMap::Object(), ProxyMgr::Object(), AtomMap::Object(), CollectionMasterHandler::Object(), Sync::openSync(), output, parameters, patchMap, WorkDistrib::patchMapInit(), pdb, SimParameters::PMEOn, WorkDistrib::preCreateHomePatches(), ComputeMap::printComputeMap(), proxySendSpanning, registerUserEventsForAllComputeObjs(), WorkDistrib::sendMaps(), CollectionMasterHandler::setRealMaster(), ProxyMgr::setRecvSpanning(), ProxyMgr::setSendSpanning(), SimParameters::shiftIOToOne, simParameters, startupTime, SimParameters::useOptPME, workDistrib, SimParameters::wrapAll, and SimParameters::wrapWater. 00185 {
00186 int gotoRun = false;
00187 double newTime;
00188
00189 if (!CkMyPe()) {
00190 if (!startupPhase) {
00191 iout << iINFO << "\n";
00192 startupTime = CmiWallTimer();
00193 iout << iINFO << "Entering startup at " << startupTime << " s, ";
00194 } else {
00195 newTime = CmiWallTimer();
00196 iout << iINFO << "Startup phase " << startupPhase-1 << " took "
00197 << newTime - startupTime << " s, ";
00198 startupTime = newTime;
00199 }
00200 iout << memusage_MB() << " MB of memory in use\n" << endi;
00201 fflush(stdout);
00202 }
00203
00204 switch (startupPhase) {
00205
00206 case 0:
00207 #ifdef CHARMIZE_NAMD
00208 populateAtomDisArrs(startupPhase);
00209 #endif
00210
00211 namdOneCommInit(); // Namd1.X style
00212 break;
00213
00214 case 1:
00215 // send & receive molecule, simparameters... (Namd1.X style)
00216 if (CkMyPe()) {
00217 namdOneRecv();
00218 } else {
00219 namdOneSend();
00220 }
00221
00222 #ifdef CHARMIZE_NAMD
00223 //send charm array proxies
00224 if(!CkMyPe()){
00225 AllCharmArrsMsg *arrsMsg = new AllCharmArrsMsg;
00226 arrsMsg->atomsDis = atomDisArr;
00227 ((CProxy_Node)thisgroup).sendCharmArrProxies(arrsMsg);
00228 }
00229 #endif
00230 break;
00231
00232 case 2:
00233 // fix up one-per-node objects
00234 simParameters = node_simParameters;
00235 parameters = node_parameters;
00236 molecule = node_molecule;
00237
00238 #if USE_HPM
00239 HPM_Init(localRankOnNode);
00240 #endif
00241
00242 #ifdef MEM_OPT_VERSION
00243 //Allocate CollectionMaster which handles I/O depending on the shiftIOToOne parameter
00244 if(!CkMyPe()){
00245 CkChareID collectionMaster;
00246 if(CkNumPes()>1 && simParameters->shiftIOToOne)
00247 collectionMaster = CProxy_CollectionMaster::ckNew(1);
00248 else
00249 collectionMaster = CProxy_CollectionMaster::ckNew(0);
00250
00251 //set CollectionMgr and CollectionMasterHandler's field for CollectionMaster
00252 CollectionMasterHandler::Object()->setRealMaster(collectionMaster);
00253 CProxy_CollectionMgr cmgr(CkpvAccess(BOCclass_group).collectionMgr);
00254 SlaveInitMsg *bcmaster = new SlaveInitMsg;
00255 bcmaster->master = collectionMaster;
00256 cmgr.setCollectionMaster(bcmaster);
00257 }
00258 #endif
00259
00260 // take care of inital thread setting
00261 threadInit();
00262
00263 // create blank AtomMap
00264 AtomMap::Object()->allocateMap(molecule->numAtoms);
00265
00266 if (!CkMyPe()) {
00267 if (simParameters->useOptPME)
00268 CkpvAccess(BOCclass_group).computePmeMgr = CProxy_OptPmeMgr::ckNew();
00269 else
00270 CkpvAccess(BOCclass_group).computePmeMgr = CProxy_ComputePmeMgr::ckNew();
00271 }
00272
00273 break;
00274
00275 case 3:
00276 if(simParameters->isSendSpanningTreeOn()) {
00277 ProxyMgr::Object()->setSendSpanning();
00278 }
00279 if(simParameters->isRecvSpanningTreeOn()) {
00280 ProxyMgr::Object()->setRecvSpanning();
00281 }
00282 #ifdef PROCTRACE_DEBUG
00283 DebugFileTrace::Instance("procTrace");
00284 #endif
00285
00286 if (!CkMyPe()) {
00287 output = new Output; // create output object just on PE(0)
00288 workDistrib->patchMapInit(); // create space division
00289
00290 #ifdef MEM_OPT_VERSION
00291 //create patches without populating them with atoms
00292 workDistrib->preCreateHomePatches();
00293 #else
00294 workDistrib->createHomePatches(); // load atoms into HomePatch(es)
00295 #endif
00296
00297 workDistrib->assignNodeToPatch();
00298 workDistrib->mapComputes();
00299 ComputeMap::Object()->printComputeMap();
00300
00301 registerUserEventsForAllComputeObjs();
00302
00303 workDistrib->sendMaps();
00304 #ifdef USE_NODEPATCHMGR
00305 CProxy_NodeProxyMgr npm(CkpvAccess(BOCclass_group).nodeProxyMgr);
00306 //a node broadcast
00307 npm.createProxyInfo(PatchMap::Object()->numPatches());
00308 #endif
00309 }
00310 {
00311 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00312 CProxy_NodeProxyMgr npm(CkpvAccess(BOCclass_group).nodeProxyMgr);
00313 if(CkMyRank()==0) {
00314 //just need to register once
00315 npm[CkMyNode()].ckLocalBranch()->registerLocalProxyMgr(CkpvAccess(BOCclass_group).proxyMgr);
00316 }
00317 npm[CkMyNode()].ckLocalBranch()->registerLocalPatchMap(CkMyRank(), PatchMap::Object());
00318 #endif
00319 }
00320 break;
00321
00322 case 4:
00323 if ( simParameters->PMEOn ) {
00324 if ( simParameters->useOptPME ) {
00325 CProxy_OptPmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
00326 pme[CkMyPe()].initialize(new CkQdMsg);
00327 }
00328 else {
00329 CProxy_ComputePmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
00330 pme[CkMyPe()].initialize(new CkQdMsg);
00331 }
00332 }
00333 break;
00334
00335 case 5:
00336 if ( simParameters->PMEOn ) {
00337 if ( simParameters->useOptPME ) {
00338 CProxy_OptPmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
00339 pme[CkMyPe()].initialize_pencils(new CkQdMsg);
00340 }
00341 else {
00342 CProxy_ComputePmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
00343 pme[CkMyPe()].initialize_pencils(new CkQdMsg);
00344 }
00345 }
00346 if (!CkMyPe()) {
00347 #ifdef MEM_OPT_VERSION
00348 workDistrib->initAndSendHomePatch();
00349 #else
00350 workDistrib->distributeHomePatches();
00351 #endif
00352 }
00353 break;
00354
00355 case 6:
00356 if ( simParameters->PMEOn ) {
00357 if ( simParameters->useOptPME ) {
00358 CProxy_OptPmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
00359 pme[CkMyPe()].activate_pencils(new CkQdMsg);
00360 }
00361 else {
00362 CProxy_ComputePmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
00363 pme[CkMyPe()].activate_pencils(new CkQdMsg);
00364 }
00365 }
00366 proxyMgr->createProxies(); // need Home patches before this
00367 if (!CkMyPe()) LdbCoordinator::Object()->createLoadBalancer();
00368 break;
00369
00370 case 7:
00371 if (!CkMyPe()) {
00372 ComputeMap::Object()->printComputeMap();
00373 }
00374 Sync::Object()->openSync(); // decide if to open local Sync
00375 if (proxySendSpanning || proxyRecvSpanning )
00376 proxyMgr->buildProxySpanningTree();
00377 DebugM(4,"Creating Computes\n");
00378 computeMgr->createComputes(ComputeMap::Object());
00379 DebugM(4,"Building Sequencers\n");
00380 buildSequencers();
00381 DebugM(4,"Initializing LDB\n");
00382 LdbCoordinator::Object()->initialize(patchMap,computeMap);
00383 break;
00384
00385 case 8:
00386 {
00387 //For debugging
00388 /*if(!CkMyPe()){
00389 FILE *dumpFile = fopen("/tmp/NAMD_Bench.dump", "w");
00390 dumpbench(dumpFile);
00391 NAMD_die("Normal execution\n");
00392 }*/
00393 }
00394 #ifdef MEM_OPT_VERSION
00395 if(!CkMyPe()){
00396 molecule->delEachAtomSigs();
00397 molecule->delChargeSpace();
00398 if(!simParameters->freeEnergyOn)
00399 molecule->delMassSpace();
00400 molecule->delOtherEachAtomStructs();
00401 //we can free the pdb data here to save memory because output
00402 //is always in the binary format thus saving 3 doubles * numAtoms bytes.
00403 pdb->delPDBCoreData();
00404 }
00405 //decide whether to free memory space for cluster information
00406 //the condition could be referred to comment for function
00407 //wrap_coor_int in Output.C
00408 if(simParameters->wrapAll || simParameters->wrapWater){
00409 int peOfCollectionMaster = 0;
00410 if(CkNumPes()>1 && simParameters->shiftIOToOne) peOfCollectionMaster = 1;
00411 if(CkNumPes()>1 && CkMyPe()!=peOfCollectionMaster)
00412 molecule->delClusterSigs();
00413 }else{
00414 molecule->delClusterSigs();
00415 }
00416 #endif
00417 gotoRun = true;
00418 break;
00419
00420 default:
00421 NAMD_bug("Startup Phase has a bug - check case statement");
00422 break;
00423
00424 }
00425
00426 startupPhase++;
00427 if (!CkMyPe()) {
00428 if (!gotoRun) {
00429 CkStartQD(CkIndex_Node::startUp((CkQdMsg*)0),&thishandle);
00430 } else {
00431 Node::messageRun();
00432 }
00433 }
00434 }
|
|
|
Definition at line 722 of file Node.C. 00722 {
00723 #if USE_HPM
00724 HPM_Stop("500 steps", localRankOnNode);
00725 HPM_Print(CkMyPe(), localRankOnNode);
00726 #endif
00727 }
|
|
|
Definition at line 161 of file Node.h. Referenced by Node(). |
|
|
|
|
|
Definition at line 134 of file Node.h. Referenced by Sequencer::integrate(), Node(), and startup(). |
|
|
Definition at line 140 of file Node.h. Referenced by colvarproxy_namd::colvarproxy_namd(), WorkDistrib::createAtomLists(), WorkDistrib::initAndSendHomePatch(), Node(), and saveMolDataPointers(). |
|
|
Definition at line 145 of file Node.h. Referenced by ScriptTcl::measure(), Tcl_centerOfMass(), Tcl_centerOfNumber(), Tcl_loadCoords(), and Tcl_radiusOfGyration(). |
|
|
Definition at line 144 of file Node.h. Referenced by Output::coordinate(), GlobalMasterIMD::get_vmd_forces(), GlobalMasterIMD::GlobalMasterIMD(), Node(), and Controller::printEnergies(). |
|
|
Definition at line 164 of file Node.h. Referenced by Node(). |
|
|
|
Definition at line 143 of file Node.h. Referenced by CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), Node(), and startup(). |
|
|
Definition at line 138 of file Node.h. Referenced by ComputeNonbondedCUDA::doWork(), LJTable::LJTable(), ComputeHomeTuples< ExclElem, Exclusion, int >::loadTuples(), Node(), saveMolDataPointers(), ComputeNonbondedUtil::select(), and startup(). |
|
|
|
|
|
Definition at line 141 of file Node.h. Referenced by WorkDistrib::caclNumAtomsInEachPatch(), WorkDistrib::createAtomLists(), WorkDistrib::fillOnePatchAtoms(), WorkDistrib::initAndSendHomePatch(), Node(), WorkDistrib::patchMapInit(), saveMolDataPointers(), and startup(). |
|
|
|
|
|
|
|
1.3.9.1