Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Node Class Reference

#include <Node.h>

Inheritance diagram for Node:

BOCclass List of all members.

Public Member Functions

 Node (GroupInitMsg *msg)
 ~Node (void)
void run ()
void enableScriptBarrier ()
void scriptBarrier (CkQdMsg *)
void scriptParam (ScriptParamMsg *)
void reloadCharges (const char *filename)
void reloadCharges (float charge[], int n)
void sendEnableExitScheduler (void)
void recvEnableExitScheduler (CkQdMsg *)
void enableExitScheduler (void)
void exitScheduler (CkQdMsg *)
void sendEnableEarlyExit (void)
void recvEnableEarlyExit (CkQdMsg *)
void enableEarlyExit (void)
void earlyExit (CkQdMsg *)
void startup ()
void startUp (CkQdMsg *)
void BOCCheckIn ()
void awaitBOCCheckIn ()
void saveMolDataPointers (NamdState *)
void sendCharmArrProxies (AllCharmArrsMsg *msg)
void startHPM ()
void stopHPM ()
int myid ()
int numNodes ()
void setScript (ScriptTcl *s)
ScriptTclgetScript (void)

Static Public Member Functions

NodeObject ()
void messageRun ()
void messageStartUp ()
void messageBOCCheckIn ()

Public Attributes

WorkDistribworkDistrib
ComputeMgrcomputeMgr
Moleculemolecule
Parametersparameters
SimParameterssimParameters
ConfigListconfigList
PDBpdb
NamdStatestate
Outputoutput
IMDOutputimd
Vectorcoords

Protected Attributes

AtomMapatomMap
PatchMappatchMap
ComputeMapcomputeMap
LdbCoordinatorldbCoordinator

Constructor & Destructor Documentation

Node::Node GroupInitMsg msg  ) 
 

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 }

Node::~Node void   ) 
 

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 }


Member Function Documentation

void Node::awaitBOCCheckIn  ) 
 

void Node::BOCCheckIn  ) 
 

void Node::earlyExit CkQdMsg *   ) 
 

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 }

void Node::enableEarlyExit void   ) 
 

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 }

void Node::enableExitScheduler void   ) 
 

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 }

void Node::enableScriptBarrier  ) 
 

Definition at line 613 of file Node.C.

00613                                {
00614   CkStartQD(CkIndex_Node::scriptBarrier((CkQdMsg*)0),&thishandle);
00615 }

void Node::exitScheduler CkQdMsg *   ) 
 

Definition at line 670 of file Node.C.

00670                                      {
00671   //CmiPrintf("exitScheduler %d\n",CkMyPe());
00672   CsdExitScheduler();
00673   delete msg;
00674 }

ScriptTcl* Node::getScript void   )  [inline]
 

Definition at line 157 of file Node.h.

Referenced by Output::coordinate(), and Controller::printEnergies().

00157 { return script; }

void Node::messageBOCCheckIn  )  [static]
 

void Node::messageRun  )  [static]
 

Definition at line 571 of file Node.C.

Referenced by startup().

00571                       {
00572   (CProxy_Node(CkpvAccess(BOCclass_group).node)).run();
00573 }

void Node::messageStartUp  )  [static]
 

Definition at line 170 of file Node.C.

00170                           {
00171   (CProxy_Node(CkpvAccess(BOCclass_group).node)).startup();
00172 }

int Node::myid  )  [inline]
 

Definition at line 153 of file Node.h.

Referenced by ComputeMgr::createComputes(), WorkDistrib::distributeHomePatches(), WorkDistrib::initAndSendHomePatch(), and LdbCoordinator::initialize().

00153 { return CkMyPe(); }

int Node::numNodes  )  [inline]
 

Definition at line 154 of file Node.h.

Referenced by WorkDistrib::assignNodeToPatch(), LdbCoordinator::initialize(), and LdbCoordinator::nodeDone().

00154 { return CkNumPes(); }

Node* Node::Object  )  [inline, static]
 

Definition at line 84 of file Node.h.

Referenced by HomePatch::addForceToMomentum(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), HomePatch::addVelocityToPosition(), after_backend_init(), WorkDistrib::assignNodeToPatch(), colvarmodule::atom::atom(), BackEnd::awaken(), ComputeNonbondedCUDA::build_exclusions(), colvarproxy_namd::colvarproxy_namd(), Controller::compareChecksums(), ComputeCylindricalBC::ComputeCylindricalBC(), ComputeEwald::ComputeEwald(), ComputeGlobal::ComputeGlobal(), ComputeHomeTuples< ExclElem, Exclusion, int >::ComputeHomeTuples(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputePme::ComputePme(), ComputeRestraints::ComputeRestraints(), ComputeSphericalBC::ComputeSphericalBC(), ComputeStir::ComputeStir(), ComputeTclBC::ComputeTclBC(), Output::coordinate(), Output::coordinateNeeded(), ComputeMgr::createComputes(), LdbCoordinator::createLoadBalancer(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), ComputeStir::doForce(), ComputeRestraints::doForce(), ComputeGridForce::doForce(), ComputeEField::doForce(), ComputeConsTorque::doForce(), ComputeConsForce::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), ComputeTclBC::doWork(), ComputeNonbondedCUDA::doWork(), ComputeHomeTuples< ExclElem, Exclusion, int >::doWork(), ComputeGridForce::doWork(), dumpbench(), ComputeGridForce::finishForce(), ComputeNonbondedCUDA::finishWork(), ComputeGridForce::finishWork(), GridforceGrid::get_box(), GlobalMasterIMD::get_vmd_forces(), GridforceGrid::getGridIndices(), GlobalMasterEasy::GlobalMasterEasy(), GlobalMasterFreeEnergy::GlobalMasterFreeEnergy(), GlobalMasterIMD::GlobalMasterIMD(), GlobalMasterTMD::GlobalMasterTMD(), OptPmeMgr::initialize(), LdbCoordinator::initialize(), ComputePmeMgr::initialize(), OptPmeMgr::initialize_pencils(), ComputePmeMgr::initialize_pencils(), Sequencer::integrate(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), LJTable::LJTable(), ComputeHomeTuples< ExclElem, Exclusion, int >::loadTuples(), Sequencer::maximumMove(), ScriptTcl::measure(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), LdbCoordinator::nodeDone(), Patch::Patch(), Controller::printDynamicsEnergies(), Controller::printEnergies(), Controller::printMinimizeEnergies(), GlobalMaster::processData(), Sequencer::rattle1(), HomePatch::rattle1(), HomePatch::rattle2(), LdbCoordinator::rebalance(), CollectionMaster::receiveDataStream(), Controller::receivePressure(), ComputeMgr::recvComputeConsForceMsg(), ComputeExtMgr::recvCoord(), OptPmeMgr::recvEvir(), ComputeGlobal::recvResults(), Sequencer::reloadCharges(), ScriptTcl::run(), ComputeGlobal::saveTotalForces(), ComputeNonbondedUtil::select(), SELF(), PatchMgr::setLattice(), CollectionMgr::submitPositions(), Tcl_centerOfMass(), Tcl_centerOfNumber(), Tcl_loadCoords(), Tcl_radiusOfGyration(), Sequencer::tcoupleVelocities(), OptPmeCompute::ungridForces(), ComputePme::ungridForces(), Output::velocity(), Output::velocityNeeded(), and wrap_coor_int().

00084 {return CkpvAccess(Node_instance);}

void Node::recvEnableEarlyExit CkQdMsg *   ) 
 

Definition at line 682 of file Node.C.

References enableEarlyExit().

00682                                            {
00683   delete msg;
00684   enableEarlyExit();
00685 }

void Node::recvEnableExitScheduler CkQdMsg *   ) 
 

Definition at line 656 of file Node.C.

References enableExitScheduler().

00656                                                {
00657   //CmiPrintf("recvEnableExitScheduler\n");
00658   delete msg;
00659   enableExitScheduler();
00660 }

void Node::reloadCharges float  charge[],
int  n
 

Definition at line 644 of file Node.C.

References molecule, and Molecule::reloadCharges().

00644                                               {
00645   molecule->reloadCharges(charge,n);
00646 }

void Node::reloadCharges const char *  filename  ) 
 

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 }

void Node::run  ) 
 

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 }

void Node::saveMolDataPointers NamdState  ) 
 

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 }

void Node::scriptBarrier CkQdMsg *   ) 
 

Definition at line 617 of file Node.C.

00617                                       {
00618   delete qmsg;
00619   //script->awaken();
00620 }

void Node::scriptParam ScriptParamMsg  ) 
 

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 }

void Node::sendCharmArrProxies AllCharmArrsMsg msg  ) 
 

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 }

void Node::sendEnableEarlyExit void   ) 
 

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 }

void Node::sendEnableExitScheduler void   ) 
 

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 }

void Node::setScript ScriptTcl s  )  [inline]
 

Definition at line 156 of file Node.h.

Referenced by after_backend_init().

00156 { script = s; }

void Node::startHPM  ) 
 

Definition at line 716 of file Node.C.

00716                     {
00717 #if USE_HPM
00718   HPM_Start("500 steps", localRankOnNode);
00719 #endif
00720 }

void Node::startUp CkQdMsg *   ) 
 

Definition at line 174 of file Node.C.

00174                                 {
00175   delete qmsg;
00176   (CProxy_Node(CkpvAccess(BOCclass_group).node)).startup();
00177 }

void Node::startup  ) 
 

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 }

void Node::stopHPM  ) 
 

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 }


Member Data Documentation

AtomMap* Node::atomMap [protected]
 

Definition at line 161 of file Node.h.

Referenced by Node().

ComputeMap* Node::computeMap [protected]
 

Definition at line 163 of file Node.h.

Referenced by Node(), and startup().

ComputeMgr* Node::computeMgr
 

Definition at line 134 of file Node.h.

Referenced by Sequencer::integrate(), Node(), and startup().

ConfigList* Node::configList
 

Definition at line 140 of file Node.h.

Referenced by colvarproxy_namd::colvarproxy_namd(), WorkDistrib::createAtomLists(), WorkDistrib::initAndSendHomePatch(), Node(), and saveMolDataPointers().

Vector* Node::coords
 

Definition at line 145 of file Node.h.

Referenced by ScriptTcl::measure(), Tcl_centerOfMass(), Tcl_centerOfNumber(), Tcl_loadCoords(), and Tcl_radiusOfGyration().

IMDOutput* Node::imd
 

Definition at line 144 of file Node.h.

Referenced by Output::coordinate(), GlobalMasterIMD::get_vmd_forces(), GlobalMasterIMD::GlobalMasterIMD(), Node(), and Controller::printEnergies().

LdbCoordinator* Node::ldbCoordinator [protected]
 

Definition at line 164 of file Node.h.

Referenced by Node().

Molecule* Node::molecule
 

Definition at line 137 of file Node.h.

Referenced by Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), WorkDistrib::assignNodeToPatch(), colvarmodule::atom::atom(), ComputeNonbondedCUDA::build_exclusions(), WorkDistrib::caclNumAtomsInEachPatch(), Controller::compareChecksums(), ComputeGlobal::ComputeGlobal(), WorkDistrib::createAtomLists(), ComputeMgr::createComputes(), ComputeStir::doForce(), ComputeRestraints::doForce(), ComputeGridForce::doForce(), ComputeConsTorque::doForce(), ComputeConsForce::doForce(), ComputeNonbondedCUDA::doWork(), ComputeGridForce::doWork(), dumpbench(), WorkDistrib::fillOnePatchAtoms(), ComputeGridForce::finishForce(), ComputeNonbondedCUDA::finishWork(), ComputeGridForce::finishWork(), GridforceGrid::getGridIndices(), GlobalMasterEasy::GlobalMasterEasy(), GlobalMasterFreeEnergy::GlobalMasterFreeEnergy(), GlobalMasterTMD::GlobalMasterTMD(), WorkDistrib::initAndSendHomePatch(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), ComputeHomeTuples< ExclElem, Exclusion, int >::loadTuples(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Node(), Controller::printDynamicsEnergies(), Controller::printEnergies(), Controller::printMinimizeEnergies(), GlobalMaster::processData(), HomePatch::rattle1(), HomePatch::rattle2(), Controller::receivePressure(), ComputeMgr::recvComputeConsForceMsg(), ComputeExtMgr::recvCoord(), ComputeGlobal::recvResults(), Sequencer::reloadCharges(), reloadCharges(), saveMolDataPointers(), ComputeNonbondedUtil::select(), startup(), CollectionMgr::submitPositions(), Tcl_centerOfMass(), Tcl_centerOfNumber(), Tcl_loadCoords(), Tcl_radiusOfGyration(), Sequencer::tcoupleVelocities(), and wrap_coor_int().

Output* Node::output
 

Definition at line 143 of file Node.h.

Referenced by CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), Node(), and startup().

Parameters* Node::parameters
 

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().

PatchMap* Node::patchMap [protected]
 

Definition at line 162 of file Node.h.

Referenced by Node(), and startup().

PDB* Node::pdb
 

Definition at line 141 of file Node.h.

Referenced by WorkDistrib::caclNumAtomsInEachPatch(), WorkDistrib::createAtomLists(), WorkDistrib::fillOnePatchAtoms(), WorkDistrib::initAndSendHomePatch(), Node(), WorkDistrib::patchMapInit(), saveMolDataPointers(), and startup().

SimParameters* Node::simParameters
 

Definition at line 139 of file Node.h.

Referenced by HomePatch::addForceToMomentum(), HomePatch::addVelocityToPosition(), WorkDistrib::caclNumAtomsInEachPatch(), colvarproxy_namd::colvarproxy_namd(), ComputeCylindricalBC::ComputeCylindricalBC(), ComputeEwald::ComputeEwald(), ComputeGlobal::ComputeGlobal(), ComputeHomeTuples< ExclElem, Exclusion, int >::ComputeHomeTuples(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputePme::ComputePme(), ComputeRestraints::ComputeRestraints(), ComputeSphericalBC::ComputeSphericalBC(), ComputeStir::ComputeStir(), ComputeTclBC::ComputeTclBC(), Output::coordinate(), Output::coordinateNeeded(), WorkDistrib::createAtomLists(), ComputeMgr::createComputes(), LdbCoordinator::createLoadBalancer(), ComputeStir::doForce(), ComputeRestraints::doForce(), ComputeGridForce::doForce(), ComputeEField::doForce(), ComputeConsTorque::doForce(), ComputeConsForce::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), ComputeTclBC::doWork(), ComputeNonbondedCUDA::doWork(), ComputeHomeTuples< ExclElem, Exclusion, int >::doWork(), dumpbench(), OptPmeXPencil::fft_init(), OptPmeYPencil::fft_init(), OptPmeZPencil::fft_init(), PmeXPencil::fft_init(), PmeYPencil::fft_init(), PmeZPencil::fft_init(), WorkDistrib::fillOnePatchAtoms(), ComputeGridForce::finishForce(), ComputeNonbondedCUDA::finishWork(), GridforceGrid::get_box(), GlobalMasterIMD::get_vmd_forces(), GlobalMasterFreeEnergy::GlobalMasterFreeEnergy(), GlobalMasterIMD::GlobalMasterIMD(), GlobalMasterTMD::GlobalMasterTMD(), WorkDistrib::initAndSendHomePatch(), OptPmeMgr::initialize(), LdbCoordinator::initialize(), ComputePmeMgr::initialize(), OptPmeMgr::initialize_pencils(), ComputePmeMgr::initialize_pencils(), ComputeHomeTuples< ExclElem, Exclusion, int >::loadTuples(), WorkDistrib::mapComputes(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Node(), Patch::Patch(), WorkDistrib::patchMapInit(), Controller::printDynamicsEnergies(), Controller::printEnergies(), HomePatch::rattle1(), HomePatch::rattle2(), LdbCoordinator::rebalance(), CollectionMaster::receiveDataStream(), Controller::receivePressure(), ComputeExtMgr::recvCoord(), OptPmeMgr::recvEvir(), ScriptTcl::run(), WorkDistrib::saveMaps(), saveMolDataPointers(), ComputeGlobal::saveTotalForces(), scriptParam(), ComputeNonbondedUtil::select(), SELF(), WorkDistrib::sendMaps(), PatchMgr::setLattice(), startup(), OptPmeCompute::ungridForces(), ComputePme::ungridForces(), Output::velocity(), Output::velocityNeeded(), and wrap_coor_int().

NamdState* Node::state
 

Definition at line 142 of file Node.h.

Referenced by Node(), and run().

WorkDistrib* Node::workDistrib
 

Definition at line 131 of file Node.h.

Referenced by Node(), and startup().


The documentation for this class was generated from the following files:
Generated on Sun Nov 22 04:07:51 2009 for NAMD by  doxygen 1.3.9.1