NAMD
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
Node Class Reference

#include <Node.h>

Inheritance diagram for Node:

Public Member Functions

 Node (GroupInitMsg *msg)
 
 ~Node (void)
 
void run ()
 
void enableScriptBarrier ()
 
void scriptBarrier (void)
 
void scriptParam (ScriptParamMsg *)
 
void reloadCharges (const char *filename)
 
void reloadCharges (float charge[], int n)
 
void reloadGridforceGrid (const char *key)
 
void reloadGridforceGrid (int gridnum)
 
void updateGridScale (const char *key, Vector scale)
 
void updateGridScale (int gridnum, float sx, float sy, float sz)
 
void reloadStructure (const char *, const char *)
 
void resendMolecule ()
 
void resendMolecule2 ()
 
void sendCheckpointReq (int remote, const char *key, int task, Lattice &lat, ControllerState &cs)
 
void recvCheckpointReq (CheckpointMsg *)
 
void recvCheckpointAck (CheckpointMsg *)
 
void sendEnableExitScheduler (void)
 
void recvEnableExitScheduler (void)
 
void enableExitScheduler (void)
 
void exitScheduler (void)
 
void sendEnableEarlyExit (void)
 
void recvEnableEarlyExit (void)
 
void enableEarlyExit (void)
 
void earlyExit (void)
 
void startup ()
 
void mallocTest (int)
 
void mallocTestQd (void)
 
float measureMemory ()
 
void BOCCheckIn ()
 
void awaitBOCCheckIn ()
 
void saveMolDataPointers (NamdState *)
 
void startHPM ()
 
void stopHPM ()
 
void traceBarrier (int turnOnTrace, int step)
 
void resumeAfterTraceBarrier (CkReductionMsg *msg)
 
void papiMeasureBarrier (int turnOnMeasure, int step)
 
void resumeAfterPapiMeasureBarrier (CkReductionMsg *msg)
 
void outputPatchComputeMaps (const char *filename, int tag)
 
int myid ()
 
int numNodes ()
 
void setScript (ScriptTcl *s)
 
ScriptTclgetScript (void)
 

Static Public Member Functions

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

Public Attributes

int mallocTest_size
 
float initVM
 
float initRSS
 
int curTimeStep
 
int curMFlopStep
 
bool specialTracing
 
WorkDistribworkDistrib
 
ComputeMgrcomputeMgr
 
Randomrand
 
Moleculemolecule
 
Parametersparameters
 
SimParameterssimParameters
 
ConfigListconfigList
 
PDBpdb
 
NamdStatestate
 
Outputoutput
 
IMDOutputimd
 
colvarmodule * colvars
 
Vectorcoords
 

Protected Attributes

AtomMapatomMap
 
PatchMappatchMap
 
ComputeMapcomputeMap
 
LdbCoordinatorldbCoordinator
 

Detailed Description

Definition at line 78 of file Node.h.

Constructor & Destructor Documentation

Node::Node ( GroupInitMsg msg)

Definition at line 291 of file Node.C.

References atomMap, colvars, configList, DebugM, GroupInitMsg::group, imd, PatchMap::Instance(), AtomMap::Instance(), ComputeMap::Instance(), molecule, NAMD_bug(), output, parameters, patchMap, pdb, recvCheckpointCAck_handler(), recvCheckpointCReq_handler(), simParameters, specialTracing, state, x, y, and z.

292 {
293  DebugM(4,"Creating Node\n");
294 #if(CMK_CCS_AVAILABLE && CMK_WEB_MODE)
295  CApplicationInit();
296 #endif
297  if (CkpvAccess(Node_instance) == 0) {
298  CkpvAccess(Node_instance) = this;
299  eventEndOfTimeStep = traceRegisterUserEvent("EndOfTimeStep", 135);
300  } else {
301  NAMD_bug("Node::Node() - another instance of Node exists!");
302  }
303 
304  CkpvAccess(BOCclass_group) = msg->group;
305  delete msg;
306 
307  CkpvAccess(BOCclass_group).node = thisgroup;
308 
309  recvCheckpointCReq_index = CmiRegisterHandler((CmiHandler)recvCheckpointCReq_handler);
310  recvCheckpointCAck_index = CmiRegisterHandler((CmiHandler)recvCheckpointCAck_handler);
311 
312  startupPhase = 0;
313 
314  molecule = NULL;
315  parameters = NULL;
316  simParameters = NULL;
317  configList = NULL;
318  pdb = NULL;
319  state = NULL;
320  output = NULL;
321  imd = new IMDOutput;
322  colvars = 0;
323 
324 #if USE_HPM
325  // assumes that this will be done only on BG/P
326  TopoManager *tmgr = new TopoManager();
327  int x, y, z;
328  tmgr->rankToCoordinates(CkMyPe(), x, y, z, localRankOnNode);
329  delete tmgr;
330 #endif
331 
332  specialTracing = traceAvailable() && (traceIsOn()==0);
333 
334  DebugM(4,"Creating PatchMap, AtomMap, ComputeMap\n");
337  if ( CkMyRank() == 0 ) ComputeMap::Instance();
338 
339  //Note: Binding BOC vars such as workDistrib has been moved
340  //to the 1st phase of startup because the in-order message delivery
341  //is not always guaranteed --Chao Mei
342 #if defined(CMK_BALANCED_INJECTION_API) && CMK_BALANCED_INJECTION_API != 0
343  if(CkMyRank() == 0){
344  balancedInjectionLevel=ck_get_GNI_BIConfig();
345  // CkPrintf("[%d] get retrieved BI=%d\n",CkMyPe(),balancedInjectionLevel);
346  ck_set_GNI_BIConfig(20);
347  // CkPrintf("[%d] set retrieved BI=%d\n",CkMyPe(),ck_get_GNI_BIConfig());
348  }
349 #endif
350 
351 }
bool specialTracing
Definition: Node.h:163
void recvCheckpointCReq_handler(envelope *)
Definition: Node.C:1298
BOCgroup group
Definition: Node.h:68
int eventEndOfTimeStep
Definition: Node.C:286
IMDOutput * imd
Definition: Node.h:183
static AtomMap * Instance()
Definition: AtomMap.C:125
Output * output
Definition: Node.h:182
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
void NAMD_bug(const char *err_msg)
Definition: common.C:129
NamdState * state
Definition: Node.h:181
gridSize z
AtomMap * atomMap
Definition: Node.h:200
PDB * pdb
Definition: Node.h:180
ConfigList * configList
Definition: Node.h:179
Parameters * parameters
Definition: Node.h:177
static ComputeMap * Instance()
Definition: ComputeMap.C:26
void recvCheckpointCAck_handler(envelope *)
Definition: Node.C:1320
PatchMap * patchMap
Definition: Node.h:201
colvarmodule * colvars
Definition: Node.h:184
gridSize y
gridSize x
static PatchMap * Instance()
Definition: PatchMap.C:32
Molecule * molecule
Definition: Node.h:176
Node::~Node ( void  )

Definition at line 356 of file Node.C.

References atomMap, computeMap, output, patchMap, and rand.

357 {
358  delete output;
359  delete computeMap;
360  delete atomMap;
361  delete patchMap;
362  delete CkpvAccess(comm);
363  // BEGIN LA
364  delete rand;
365  // END LA
366 #ifdef MEASURE_NAMD_WITH_PAPI
367  delete CkpvAccess(papiEvents);
368 #endif
369 }
Output * output
Definition: Node.h:182
ComputeMap * computeMap
Definition: Node.h:202
AtomMap * atomMap
Definition: Node.h:200
Random * rand
Definition: Node.h:172
PatchMap * patchMap
Definition: Node.h:201

Member Function Documentation

void Node::awaitBOCCheckIn ( )
void Node::BOCCheckIn ( )
void Node::earlyExit ( void  )

Definition at line 1373 of file Node.C.

References NAMD_die().

1373  {
1374  NAMD_die("Exiting prematurely; see error messages above.");
1375 }
void NAMD_die(const char *err_msg)
Definition: common.C:85
void Node::enableEarlyExit ( void  )

Definition at line 1365 of file Node.C.

References sendEnableEarlyExit().

Referenced by Sequencer::hardWallDrude(), Sequencer::maximumMove(), Sequencer::rattle1(), and recvEnableEarlyExit().

1365  {
1366  if ( CkMyPe() ) {
1368  } else {
1369  CkStartQD(CkIndex_Node::earlyExit(),&thishandle);
1370  }
1371 }
void sendEnableEarlyExit(void)
Definition: Node.C:1356
void Node::enableExitScheduler ( void  )

Definition at line 1343 of file Node.C.

References sendEnableExitScheduler().

Referenced by BackEnd::awaken(), and recvEnableExitScheduler().

1343  {
1344  if ( CkMyPe() ) {
1346  } else {
1347  CkStartQD(CkIndex_Node::exitScheduler(), &thishandle);
1348  }
1349 }
void sendEnableExitScheduler(void)
Definition: Node.C:1332
void Node::enableScriptBarrier ( )

Definition at line 1140 of file Node.C.

1140  {
1141  CkStartQD(CkIndex_Node::scriptBarrier(), &thishandle);
1142 }
void Node::exitScheduler ( void  )

Definition at line 1351 of file Node.C.

1351  {
1352  //CmiPrintf("exitScheduler %d\n",CkMyPe());
1353  CsdExitScheduler();
1354 }
ScriptTcl* Node::getScript ( void  )
inline

Definition at line 192 of file Node.h.

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

192 { return script; }
void Node::mallocTest ( int  step)

Definition at line 392 of file Node.C.

References NAMD_die().

Referenced by mallocTestQd().

392  {
393  int MB = 1024*1024;
394  int size = 100;
395  char* foo = (char*) malloc(size*MB);
396  if ( ! foo ) {
397  char buf[256];
398  sprintf(buf,"Malloc fails on Pe %d at %d MB.\n",CkMyPe(),step*size);
399  NAMD_die(buf);
400  }
401  memset(foo,0,size*MB*sizeof(char));
402 }
void NAMD_die(const char *err_msg)
Definition: common.C:85
void Node::mallocTestQd ( void  )

Definition at line 404 of file Node.C.

References mallocTest(), and mallocTest_size.

404  {
405  if ( mallocTest_size ) {
406  CkPrintf("All PEs successfully allocated %d MB.\n", 100*mallocTest_size);
407  } else {
408  CkPrintf("Starting malloc test on all PEs.\n");
409  }
410  fflush(stdout);
411  ++mallocTest_size;
412  CkStartQD(CkIndex_Node::mallocTestQd(), &thishandle);
413  (CProxy_Node(CkpvAccess(BOCclass_group).node)).mallocTest(mallocTest_size);
414 }
void mallocTest(int)
Definition: Node.C:392
int mallocTest_size
Definition: Node.h:129
float Node::measureMemory ( )
static void Node::messageBOCCheckIn ( )
static
void Node::messageRun ( )
static

Definition at line 1096 of file Node.C.

References run().

Referenced by startup().

1096  {
1097  (CProxy_Node(CkpvAccess(BOCclass_group).node)).run();
1098 }
void run()
Definition: Node.C:1105
void Node::messageStartUp ( )
static

Definition at line 419 of file Node.C.

References startup().

419  {
420  (CProxy_Node(CkpvAccess(BOCclass_group).node)).startup();
421 }
void startup()
Definition: Node.C:429
int Node::myid ( )
inline

Definition at line 188 of file Node.h.

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

188 { return CkMyPe(); }
int Node::numNodes ( )
inline

Definition at line 189 of file Node.h.

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

189 { return CkNumPes(); }
static Node* Node::Object ( )
inlinestatic

Definition at line 86 of file Node.h.

Referenced by HomePatch::addForceToMomentum(), HomePatch::addForceToMomentum3(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), HomePatch::addVelocityToPosition(), after_backend_init(), Controller::algorithm(), WorkDistrib::assignNodeToPatch(), BackEnd::awaken(), PmeZPencil::backward_fft(), PmeYPencil::backward_fft(), PmeXPencil::backward_fft(), ComputeNonbondedCUDA::build_exclusions(), HomePatch::buildRattleList(), ComputeQMMgr::calcMOPAC(), ComputeQMMgr::calcORCA(), Controller::calcPressure(), colvarproxy_namd::calculate(), ComputeQMMgr::calcUSR(), ComputePmeMgr::chargeGridSubmitted(), colvarproxy_namd::check_atom_id(), SimParameters::close_dcdfile(), SimParameters::close_veldcdfile(), colvarproxy_namd::colvarproxy_namd(), Controller::compareChecksums(), ComputeCylindricalBC::ComputeCylindricalBC(), ComputeEwald::ComputeEwald(), AngleElem::computeForce(), ImproperElem::computeForce(), CrosstermElem::computeForce(), DihedralElem::computeForce(), AnisoElem::computeForce(), TholeElem::computeForce(), BondElem::computeForce(), GromacsPairElem::computeForce(), ComputeFullDirect::ComputeFullDirect(), ComputeGlobal::ComputeGlobal(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::ComputeHomeTuples(), ComputeLCPO::ComputeLCPO(), ComputeMsm::ComputeMsm(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputeNonbondedPair::ComputeNonbondedPair(), ComputeNonbondedSelf::ComputeNonbondedSelf(), ComputePme::ComputePme(), ComputeRestraints::ComputeRestraints(), ComputeSphericalBC::ComputeSphericalBC(), ComputeStir::ComputeStir(), ComputeTclBC::ComputeTclBC(), Controller::Controller(), Output::coordinate(), Output::coordinateNeeded(), ComputeMgr::createComputes(), ComputeCUDAMgr::createCudaComputeNonbonded(), ParallelIOMgr::createHomePatches(), LdbCoordinator::createLoadBalancer(), CudaComputeNonbonded::CudaComputeNonbonded(), CollectionMaster::disposeForces(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), ComputeConsForce::doForce(), ComputeEField::doForce(), ComputeConsTorque::doForce(), ComputeStir::doForce(), ComputeGridForce::doForce(), ComputeNonbondedPair::doForce(), ComputeNonbondedSelf::doForce(), ComputeRestraints::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), ComputePme::doQMWork(), ComputeTclBC::doWork(), ComputeGBISser::doWork(), ComputeNonbondedCUDA::doWork(), CudaComputeNonbonded::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), dumpbench(), HomePatch::exchangeAtoms(), HomePatch::exchangeCheckpoint(), ComputeNonbondedCUDA::finishReductions(), CudaComputeNonbonded::finishReductions(), ComputeNonbondedCUDA::finishWork(), Output::force(), Patch::forceBoxClosed(), Output::forceNeeded(), PmeZPencil::forward_fft(), PmeYPencil::forward_fft(), PmeXPencil::forward_fft(), ComputePmeCUDADevice::gatherForceDone(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), GlobalMasterIMD::get_vmd_forces(), GlobalMasterEasy::GlobalMasterEasy(), GlobalMasterFreeEnergy::GlobalMasterFreeEnergy(), GlobalMasterIMD::GlobalMasterIMD(), GlobalMasterServer::GlobalMasterServer(), GlobalMasterSymmetry::GlobalMasterSymmetry(), GlobalMasterTMD::GlobalMasterTMD(), ComputePmeMgr::gridCalc2R(), Sequencer::hardWallDrude(), HomePatch::hardWallDrude(), colvarproxy_namd::init_atom_group(), colvarproxy_namd::init_tcl_pointers(), colvarproxy_namd::init_volmap(), ComputePmeCUDA::initialize(), LdbCoordinator::initialize(), ComputeQM::initialize(), ComputePmeMgr::initialize(), ComputeMsmMgr::initialize(), ComputePmeMgr::initialize_computes(), ComputePmeMgr::initialize_pencils(), Sequencer::integrate(), Controller::integrate(), isPmeProcessor(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), CudaComputeNonbonded::launchWork(), LJTable::LJTable(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), HomePatch::loweAndersenVelocities(), WorkDistrib::mapComputes(), Sequencer::maximumMove(), ScriptTcl::measure(), Sequencer::minimize(), HomePatch::minimize_rattle2(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Controller::multigatorCalcEnthalpy(), NamdHybridLB::NamdHybridLB(), ComputeNonbondedCUDA::noWork(), PmePencil< CBase_PmeZPencil >::order_init(), Patch::Patch(), WorkDistrib::patchMapInit(), PmeXPencil::pme_kspace(), Patch::positionsReady(), HomePatch::positionsReady(), Controller::printDynamicsEnergies(), Controller::printEnergies(), Controller::printMinimizeEnergies(), HomePatch::qmSwapAtoms(), Sequencer::rattle1(), HomePatch::rattle1(), HomePatch::rattle1old(), HomePatch::rattle2(), LdbCoordinator::rebalance(), Controller::rebalanceLoad(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), CollectionMaster::receiveDataStream(), CollectionMaster::receiveForces(), CollectionMaster::receivePositions(), Controller::receivePressure(), CollectionMaster::receiveVelocities(), recursive_bisect_with_curve(), ParallelIOMgr::recvAtomsCntPerPatch(), recvCheckpointCAck_handler(), recvCheckpointCReq_handler(), HomePatch::recvCheckpointLoad(), ComputeMgr::recvComputeConsForceMsg(), ComputeMsmSerialMgr::recvCoord(), ComputeExtMgr::recvCoord(), ComputeFmmSerialMgr::recvCoord(), ComputeGBISserMgr::recvCoord(), ComputeQMMgr::recvPartQM(), ComputeQMMgr::recvPntChrg(), recvReplicaDcdData(), recvReplicaDcdInit(), ComputeNonbondedCUDA::recvYieldDevice(), ComputeNonbondedCUDA::registerPatches(), Sequencer::reloadCharges(), Controller::rescaleaccelMD(), Sequencer::rescaleSoluteCharges(), ScriptTcl::run(), ComputeQM::saveResults(), ComputeGlobal::saveTotalForces(), ComputePmeUtil::select(), ComputeNonbondedUtil::select(), PmeZPencil::send_all_ungrid(), PmeZPencil::send_trans(), PmeYPencil::send_trans(), PmeYPencil::send_untrans(), PmeXPencil::send_untrans(), ComputePmeMgr::sendTrans(), ComputePmeMgr::sendUngrid(), ComputePmeMgr::sendUntrans(), HomePatch::setGBISIntrinsicRadii(), PatchMgr::setLattice(), HomePatch::setLcpoType(), ComputePmeCUDAMgr::setupPencils(), ComputeNonbondedCUDA::skip(), NamdHybridLB::splitComputes(), CollectionMaster::startNextRoundOutputForce(), CollectionMaster::startNextRoundOutputPos(), CollectionMaster::startNextRoundOutputVel(), NamdCentLB::Strategy(), CollectionMgr::submitForces(), ComputePmeMgr::submitReductions(), Tcl_centerOfMass(), Tcl_centerOfNumber(), Tcl_loadCoords(), Tcl_radiusOfGyration(), Sequencer::tcoupleVelocities(), ComputePme::ungridForces(), colvarproxy_namd::update_atom_properties(), colvarproxy_namd::update_group_properties(), ComputeMgr::updateLocalComputes4(), Output::velocity(), Output::velocityNeeded(), wrap_coor_int(), and CollectionMaster::wrapCoorFinished().

86 {return CkpvAccess(Node_instance);}
void Node::outputPatchComputeMaps ( const char *  filename,
int  tag 
)

Definition at line 1521 of file Node.C.

References Patch::getNumAtoms(), PatchMap::gridsize_a(), PatchMap::gridsize_b(), PatchMap::gridsize_c(), NAMD_die(), ComputeMap::node(), PatchMap::node(), ComputeMap::numComputes(), PatchMap::numPatches(), numPatches, PatchMap::Object(), ComputeMap::Object(), SimParameters::outputMaps, PatchMap::patch(), ComputeMap::pid(), simParameters, SimParameters::simulatedNodeSize, SimParameters::simulatedPEs, SimParameters::simulateInitialMapping, and ComputeMap::type().

Referenced by Controller::rebalanceLoad(), and startup().

1521  {
1523 
1524  int numpes = CkNumPes();
1525  int nodesize = CkMyNodeSize();
1527  numpes = simParameters->simulatedPEs;
1528  nodesize = simParameters->simulatedNodeSize;
1529  }
1530 
1531  char fname[128];
1532  sprintf(fname, "mapdump_%s.%d_%d_%d_%s", filename, numpes, nodesize, tag, gNAMDBinaryName);
1533 
1534  FILE *fp = fopen(fname, "w");
1535  if(fp == NULL) {
1536  NAMD_die("Error in outputing PatchMap and ComputeMap info!\n");
1537  return;
1538  }
1539  PatchMap *pMap = PatchMap::Object();
1540  ComputeMap *cMap = ComputeMap::Object();
1541  int numPatches = pMap->numPatches();
1542  int numComputes = cMap->numComputes();
1543  fprintf(fp, "%d %d %d %d %d %d %d\n", numpes, nodesize, numPatches, numComputes,
1544  pMap->gridsize_a(), pMap->gridsize_b(), pMap->gridsize_c());
1545  //output PatchMap info
1546  for(int i=0; i<numPatches; i++) {
1547  #ifdef MEM_OPT_VERSION
1548  fprintf(fp, "%d %d\n", pMap->numAtoms(i), pMap->node(i));
1549  #else
1550  fprintf(fp, "%d %d\n", pMap->patch(i)->getNumAtoms(), pMap->node(i));
1551  #endif
1552  }
1553 
1554  //output ComputeMap info
1555  for(int i=0; i<numComputes; i++) {
1556  fprintf(fp, "%d %d %d %d\n", cMap->node(i), cMap->type(i), cMap->pid(i,0), cMap->pid(i,1));
1557  }
1558 }
Bool simulateInitialMapping
int numComputes(void)
Definition: ComputeMap.h:101
int gridsize_c(void) const
Definition: PatchMap.h:66
static PatchMap * Object()
Definition: PatchMap.h:27
SimParameters * simParameters
Definition: Node.h:178
char * gNAMDBinaryName
Definition: BackEnd.C:237
Patch * patch(PatchID pid)
Definition: PatchMap.h:235
int gridsize_a(void) const
Definition: PatchMap.h:64
ComputeType type(ComputeID cid)
Definition: ComputeMap.C:120
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ cudaTextureObject_t const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
void NAMD_die(const char *err_msg)
Definition: common.C:85
int numPatches(void) const
Definition: PatchMap.h:59
int node(int pid) const
Definition: PatchMap.h:114
static ComputeMap * Object()
Definition: ComputeMap.h:89
int getNumAtoms()
Definition: Patch.h:105
int node(ComputeID cid)
Definition: ComputeMap.h:106
int pid(ComputeID cid, int i)
Definition: ComputeMap.C:109
int gridsize_b(void) const
Definition: PatchMap.h:65
void Node::papiMeasureBarrier ( int  turnOnMeasure,
int  step 
)

Definition at line 1426 of file Node.C.

References curMFlopStep.

1426  {
1427 #ifdef MEASURE_NAMD_WITH_PAPI
1428  curMFlopStep = step;
1429  double results[NUM_PAPI_EVENTS+1];
1430 
1431  if(turnOnMeasure){
1432  CkpvAccess(papiEvents)[NUM_PAPI_EVENTS]=CmiWallTimer();
1433 
1434  long long counters[NUM_PAPI_EVENTS+1];
1435  int ret=PAPI_start_counters(CkpvAccess(papiEvents), NUM_PAPI_EVENTS);
1436  if(ret==PAPI_OK)
1437  {
1438  // CkPrintf("traceBarrier start counters (%d) at step %d called on proc %d\n", turnOnMeasure, step, CkMyPe());
1439  }
1440  else
1441  {
1442  CkPrintf("error PAPI_start_counters (%d) at step %d called on proc %d\n",ret , step, CkMyPe());
1443  }
1444  if(PAPI_read_counters(counters, NUM_PAPI_EVENTS)!=PAPI_OK)
1445  {
1446  CkPrintf("error PAPI_read_counters %d\n",PAPI_read_counters(counters, NUM_PAPI_EVENTS));
1447  };
1448  }else{
1449  long long counters[NUM_PAPI_EVENTS+1];
1450  for(int i=0;i<NUM_PAPI_EVENTS;i++) counters[i]=0LL;
1451  if(PAPI_read_counters(counters, NUM_PAPI_EVENTS)==PAPI_OK)
1452  {
1453 #if !MEASURE_PAPI_SPP
1454  results[0] = (double)counters[0]/1e6;
1455  results[1] = (double)counters[1]/1e6;
1456 #else
1457  for(int i=0;i<NUM_PAPI_EVENTS;i++) results[i] = counters[i]/1e6;
1458 #endif
1459  // for(int i=0;i<NUM_PAPI_EVENTS;i++) CkPrintf("[%d] counter %d is %ld\n",CkMyPe(),i,counters[i]);
1460  }
1461  else
1462  {
1463  // CkPrintf("error PAPI_read_counters %d\n",PAPI_read_counters(counters, NUM_PAPI_EVENTS));
1464  }
1465  // CkPrintf("traceBarrier stop counters (%d) at step %d called on proc %d\n", turnOnMeasure, step, CkMyPe());
1466 
1467  PAPI_stop_counters(counters, NUM_PAPI_EVENTS);
1468  }
1469  if(CkMyPe()==0)
1470  // CkPrintf("traceBarrier (%d) at step %d called on proc %d\n", turnOnMeasure, step, CkMyPe());
1471  results[NUM_PAPI_EVENTS]=CkpvAccess(papiEvents)[NUM_PAPI_EVENTS]; //starttime
1472  CProxy_Node nd(CkpvAccess(BOCclass_group).node);
1473  CkCallback cb(CkIndex_Node::resumeAfterPapiMeasureBarrier(NULL), nd[0]);
1474  contribute(sizeof(double)*(NUM_PAPI_EVENTS+1), &results, CkReduction::sum_double, cb);
1475 #endif
1476 }
int curMFlopStep
Definition: Node.h:156
void Node::recvCheckpointAck ( CheckpointMsg msg)

Definition at line 1326 of file Node.C.

References CheckpointMsg::checkpoint, Controller::recvCheckpointAck(), and state.

Referenced by recvCheckpointCAck_handler().

1326  {
1327  state->controller->recvCheckpointAck(msg->checkpoint);
1328  delete msg;
1329 }
Controller::checkpoint checkpoint
Definition: Node.C:89
NamdState * state
Definition: Node.h:181
void recvCheckpointAck(checkpoint &cp)
Definition: Controller.C:4117
void Node::recvCheckpointReq ( CheckpointMsg msg)

Definition at line 1304 of file Node.C.

References CheckpointMsg::checkpoint, CheckpointMsg::key, Controller::recvCheckpointReq(), CheckpointMsg::replica, state, and CheckpointMsg::task.

Referenced by recvCheckpointCReq_handler().

1304  {
1305  state->controller->recvCheckpointReq(msg->key,msg->task,msg->checkpoint);
1306 
1307  int remote = msg->replica;
1308  msg->replica = CmiMyPartition();
1309  envelope *env = UsrToEnv(CheckpointMsg::pack(msg));
1310  CmiSetHandler(env,recvCheckpointCAck_index);
1311 #if CMK_HAS_PARTITION
1312  CmiInterSyncSendAndFree(CkMyPe(),remote,env->getTotalsize(),(char*)env);
1313 #else
1314  CmiSyncSendAndFree(CkMyPe(),env->getTotalsize(),(char*)env);
1315 #endif
1316 }
void recvCheckpointReq(const char *key, int task, checkpoint &cp)
Definition: Controller.C:4087
int task
Definition: Node.C:87
int replica
Definition: Node.C:88
Controller::checkpoint checkpoint
Definition: Node.C:89
NamdState * state
Definition: Node.h:181
char * key
Definition: Node.C:90
void Node::recvEnableEarlyExit ( void  )

Definition at line 1361 of file Node.C.

References enableEarlyExit().

1361  {
1362  enableEarlyExit();
1363 }
void enableEarlyExit(void)
Definition: Node.C:1365
void Node::recvEnableExitScheduler ( void  )

Definition at line 1338 of file Node.C.

References enableExitScheduler().

1338  {
1339  //CmiPrintf("recvEnableExitScheduler\n");
1341 }
void enableExitScheduler(void)
Definition: Node.C:1343
void Node::reloadCharges ( const char *  filename)

Definition at line 1153 of file Node.C.

References charge, molecule, NAMD_die(), and Molecule::numAtoms.

1153  {
1154  FILE *file = fopen(filename,"r");
1155  if ( ! file ) NAMD_die("node::reloadCharges():Error opening charge file.");
1156 
1157  int n = molecule->numAtoms;
1158  float *charge = new float[n];
1159 
1160  for ( int i = 0; i < n; ++i ) {
1161  if ( ! fscanf(file,"%f",&charge[i]) )
1162  NAMD_die("Node::reloadCharges():Not enough numbers in charge file.");
1163  }
1164 
1165  fclose(file);
1166  CProxy_Node(thisgroup).reloadCharges(charge,n);
1167  delete [] charge;
1168 }
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
k< npairi;++k){TABENERGY(const int numtypes=simParams->tableNumTypes;const float table_spacing=simParams->tableSpacing;const int npertype=(int)(namdnearbyint(simParams->tableMaxDist/simParams->tableSpacing)+1);) int table_i=(r2iilist[2 *k] >> 14)+r2_delta_expc;const int j=pairlisti[k];#define p_j BigReal diffa=r2list[k]-r2_table[table_i];#define table_four_i TABENERGY(register const int tabtype=-1-(lj_pars->A< 0?lj_pars->A:0);) BigReal kqq=kq_i *p_j-> charge
Molecule * molecule
Definition: Node.h:176
void Node::reloadCharges ( float  charge[],
int  n 
)

Definition at line 1170 of file Node.C.

References molecule, and Molecule::reloadCharges().

1170  {
1172 }
void reloadCharges(float charge[], int n)
k< npairi;++k){TABENERGY(const int numtypes=simParams->tableNumTypes;const float table_spacing=simParams->tableSpacing;const int npertype=(int)(namdnearbyint(simParams->tableMaxDist/simParams->tableSpacing)+1);) int table_i=(r2iilist[2 *k] >> 14)+r2_delta_expc;const int j=pairlisti[k];#define p_j BigReal diffa=r2list[k]-r2_table[table_i];#define table_four_i TABENERGY(register const int tabtype=-1-(lj_pars->A< 0?lj_pars->A:0);) BigReal kqq=kq_i *p_j-> charge
Molecule * molecule
Definition: Node.h:176
void Node::reloadGridforceGrid ( const char *  key)

Definition at line 1176 of file Node.C.

References DebugM, MGridforceParamsList::find_key(), Molecule::get_gridfrc_grid(), MGridforceParamsList::index_for_key(), SimParameters::mgridforcelist, MGRIDFORCEPARAMS_DEFAULTKEY, molecule, NAMD_bug(), NAMD_die(), GridforceGrid::reinitialize(), and simParameters.

1176  {
1177  DebugM(4, "reloadGridforceGrid(const char*) called on node " << CkMyPe() << "\n" << endi);
1178 
1179  int gridnum;
1180  MGridforceParams *mgridParams;
1181  if (key == NULL) {
1184  } else {
1185  gridnum = simParameters->mgridforcelist.index_for_key(key);
1186  mgridParams = simParameters->mgridforcelist.find_key(key);
1187  }
1188 
1189  if (gridnum < 0 || mgridParams == NULL) {
1190  NAMD_die("Node::reloadGridforceGrid(const char*):Could not find grid.");
1191  }
1192 
1193  GridforceGrid *grid = molecule->get_gridfrc_grid(gridnum);
1194  if (grid == NULL) {
1195  NAMD_bug("Node::reloadGridforceGrid(const char*):grid not found");
1196  }
1197  grid->reinitialize(simParameters, mgridParams);
1198 
1199  CProxy_Node(thisgroup).reloadGridforceGrid(gridnum);
1200 
1201  DebugM(4, "reloadGridforceGrid(const char*) finished\n" << endi);
1202 }
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
virtual void reinitialize(SimParameters *simParams, MGridforceParams *mgridParams)=0
int index_for_key(const char *key)
void NAMD_bug(const char *err_msg)
Definition: common.C:129
#define MGRIDFORCEPARAMS_DEFAULTKEY
MGridforceParams * find_key(const char *key)
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1280
void NAMD_die(const char *err_msg)
Definition: common.C:85
MGridforceParamsList mgridforcelist
Molecule * molecule
Definition: Node.h:176
void Node::reloadGridforceGrid ( int  gridnum)

Definition at line 1245 of file Node.C.

References ALLBUTME, BUFSIZE, DebugM, MOStream::end(), Molecule::get_gridfrc_grid(), GRIDFORCEGRIDTAG, molecule, NAMD_bug(), GridforceGrid::pack_grid(), Molecule::set_gridfrc_grid(), and GridforceGrid::unpack_grid().

1245  {
1246  if (CmiMyRank()) return;
1247  DebugM(4, "reloadGridforceGrid(int) called on node " << CkMyPe() << "\n" << endi);
1248 
1249  GridforceGrid *grid = molecule->get_gridfrc_grid(gridnum);
1250  if (grid == NULL) {
1251  NAMD_bug("Node::reloadGridforceGrid(int):grid not found");
1252  }
1253 
1254  if (CkMyPe()) {
1255  // not node 0 -> receive grid
1256  DebugM(4, "Receiving grid\n");
1257 
1258  delete grid;
1259 
1260  MIStream *msg = CkpvAccess(comm)->newInputStream(0, GRIDFORCEGRIDTAG);
1261  grid = GridforceGrid::unpack_grid(gridnum, msg);
1262  molecule->set_gridfrc_grid(gridnum, grid);
1263  delete msg;
1264  } else {
1265  // node 0 -> send grid
1266  DebugM(4, "Sending grid\n");
1267 
1268  MOStream *msg = CkpvAccess(comm)->newOutputStream(ALLBUTME, GRIDFORCEGRIDTAG, BUFSIZE);
1269  GridforceGrid::pack_grid(grid, msg);
1270  msg->end();
1271  delete msg;
1272  }
1273 
1274  DebugM(4, "reloadGridforceGrid(int) finished\n" << endi);
1275 }
#define GRIDFORCEGRIDTAG
Definition: common.h:158
void end(void)
Definition: MStream.C:176
static void pack_grid(GridforceGrid *grid, MOStream *msg)
Definition: GridForceGrid.C:50
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define ALLBUTME
Definition: Communicate.h:14
void NAMD_bug(const char *err_msg)
Definition: common.C:129
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1280
#define BUFSIZE
Definition: Communicate.h:15
static GridforceGrid * unpack_grid(int gridnum, MIStream *msg)
Definition: GridForceGrid.C:60
int set_gridfrc_grid(int gridnum, GridforceGrid *grid)
Definition: Molecule.h:1289
Molecule * molecule
Definition: Node.h:176
void Node::reloadStructure ( const char *  fname,
const char *  pdbname 
)

Definition at line 1007 of file Node.C.

References NamdState::loadStructure(), molecule, pdb, and state.

1007  {
1008  delete molecule;
1009  molecule = state->molecule = 0;
1010  delete pdb;
1011  pdb = state->pdb = 0;
1012  state->loadStructure(fname,pdbname,1);
1013  this->molecule = state->molecule;
1014  this->pdb = state->pdb;
1015  CProxy_Node nodeProxy(thisgroup);
1016  nodeProxy.resendMolecule();
1017 }
int loadStructure(const char *, const char *, int)
Definition: NamdState.C:153
NamdState * state
Definition: Node.h:181
PDB * pdb
Definition: Node.h:180
Molecule * molecule
Definition: Node.h:176
void Node::resendMolecule ( )

Definition at line 1020 of file Node.C.

References ALLBUTME, BUFSIZE, computeMgr, molecule, MOLECULETAG, SimParameters::nonbonded_select(), Molecule::numAtoms, parameters, SimParameters::pme_select(), SimParameters::PMEOn, Molecule::receive_Molecule(), Parameters::receive_Parameters(), Molecule::send_Molecule(), Parameters::send_Parameters(), ComputeMgr::sendBuildCudaExclusions(), simParameters, and STATICPARAMSTAG.

1020  {
1021  if ( CmiMyRank() ) {
1022  return;
1023  }
1024  if ( CmiMyPe() == 0 ) {
1025  int bufSize = BUFSIZE;
1026  MOStream *conv_msg;
1027  conv_msg = CkpvAccess(comm)->newOutputStream(ALLBUTME, STATICPARAMSTAG, bufSize);
1028  parameters->send_Parameters(conv_msg);
1029  if(molecule->numAtoms>=1000000) bufSize = 16*BUFSIZE;
1030  conv_msg = CkpvAccess(comm)->newOutputStream(ALLBUTME, MOLECULETAG, bufSize);
1031  molecule->send_Molecule(conv_msg);
1032  } else {
1033  MIStream *conv_msg;
1034  delete parameters;
1035  parameters = new Parameters;
1036  conv_msg = CkpvAccess(comm)->newInputStream(0, STATICPARAMSTAG);
1037  parameters->receive_Parameters(conv_msg);
1038  delete molecule;
1040  conv_msg = CkpvAccess(comm)->newInputStream(0, MOLECULETAG);
1041  molecule->receive_Molecule(conv_msg);
1042  }
1048  CProxy_Node nodeProxy(thisgroup);
1049  for ( int i=0; i<CmiMyNodeSize(); ++i ) {
1050  nodeProxy[CmiMyPe()+i].resendMolecule2();
1051  }
1052 }
void send_Molecule(MOStream *)
Definition: Molecule.C:5448
SimParameters * simParameters
Definition: Node.h:178
#define ALLBUTME
Definition: Communicate.h:14
#define STATICPARAMSTAG
Definition: common.h:153
Molecule * node_molecule
Definition: Node.C:425
void sendBuildCudaExclusions()
Definition: ComputeMgr.C:1448
static void pme_select()
int numAtoms
Definition: Molecule.h:557
#define BUFSIZE
Definition: Communicate.h:15
static void nonbonded_select()
void send_Parameters(MOStream *)
Definition: Parameters.C:5048
Parameters * parameters
Definition: Node.h:177
Parameters * node_parameters
Definition: Node.C:424
#define MOLECULETAG
Definition: common.h:154
ComputeMgr * computeMgr
Definition: Node.h:169
void receive_Molecule(MIStream *)
Definition: Molecule.C:5806
Molecule * molecule
Definition: Node.h:176
void receive_Parameters(MIStream *)
Definition: Parameters.C:5424
void Node::resendMolecule2 ( )

Definition at line 1054 of file Node.C.

References AtomMap::allocateMap(), molecule, node_molecule, node_parameters, Molecule::numAtoms, AtomMap::Object(), and parameters.

1054  {
1058 }
void allocateMap(int nAtomIDs)
Definition: AtomMap.C:161
Molecule * node_molecule
Definition: Node.C:425
int numAtoms
Definition: Molecule.h:557
static AtomMap * Object()
Definition: AtomMap.h:36
Parameters * parameters
Definition: Node.h:177
Parameters * node_parameters
Definition: Node.C:424
Molecule * molecule
Definition: Node.h:176
void Node::resumeAfterPapiMeasureBarrier ( CkReductionMsg *  msg)

Definition at line 1478 of file Node.C.

References curMFlopStep, simParameters, and state.

1478  {
1479 #ifdef MEASURE_NAMD_WITH_PAPI
1480 
1481  if(simParameters->papiMeasureStartStep != curMFlopStep) {
1482  double *results = (double *)msg->getData();
1483  double endtime=CmiWallTimer();
1484  int bstep = simParameters->papiMeasureStartStep;
1485  int estep = bstep + simParameters->numPapiMeasureSteps;
1486 #if MEASURE_PAPI_SPP
1487  CkPrintf("SPP INFO: PAPI_FP_OPS timestep %d to %d is %lf(1e6)\n", bstep,estep,results[0]);
1488  CkPrintf("SPP INFO: PAPI_TOT_INS timestep %d to %d is %lf(1e6)\n", bstep,estep,results[1]);
1489  CkPrintf("SPP INFO: perf::PERF_COUNT_HW_CACHE_LL:MISS timestep %d to %d is %lf(1e6)\n", bstep,estep,results[2]);
1490  CkPrintf("SPP INFO: DATA_PREFETCHER:ALL timestep %d to %d is %lf(1e6)\n", bstep,estep,results[3]);
1491  CkPrintf("SPP INFO: PAPI_L1_DCA timestep %d to %d is %lf(1e6)\n", bstep,estep,results[4]);
1492  CkPrintf("SPP INFO: PAPI_TOT_CYC timestep %d to % is %lf(1e6)\n", bstep,estep,results[5]);
1493  // CkPrintf("SPP INFO: INSTRUCTION_FETCH_STALL timestep %d to %d is %lf(1e6)\n", bstep,estep,results[6]);
1494  // CkPrintf("SPP INFO: WALLtime timestep %d to %d is %lf\n", bstep,estep,endtime-results[NUM_PAPI_EVENTS]/CkNumPes());
1495  CkPrintf("SPP INFO: WALLtime timestep %d to %d is %lf\n", bstep,estep,endtime-results[NUM_PAPI_EVENTS]);
1496  CkPrintf("SPP INFO: endtime %lf avgtime %lf tottime %lf\n", endtime,results[NUM_PAPI_EVENTS]/CkNumPes(),results[NUM_PAPI_EVENTS] );
1497 #else
1498  if(CkpvAccess(papiEvents)[0] == PAPI_FP_INS){
1499  double totalFPIns = results[0];
1500  if(CkpvAccess(papiEvents)[1] == PAPI_FMA_INS) totalFPIns += (results[1]*2);
1501  CkPrintf("FLOPS INFO: from timestep %d to %d, the total FP instruction of NAMD is %lf(x1e6) per processor\n",
1502  bstep, estep, totalFPIns/CkNumPes());
1503  }else{
1504  char nameBuf[PAPI_MAX_STR_LEN];
1505  CkPrintf("PAPI COUNTERS INFO: from timestep %d to %d, ",
1506  bstep, estep);
1507  for(int i=0; i<NUM_PAPI_EVENTS; i++) {
1508  PAPI_event_code_to_name(CkpvAccess(papiEvents)[i], nameBuf);
1509  CkPrintf("%s is %lf(x1e6), ", nameBuf, results[i]/CkNumPes());
1510  }
1511  CkPrintf("per processor\n");
1512  }
1513 #endif
1514  }
1515  delete msg;
1516  state->controller->resumeAfterPapiMeasureBarrier(curMFlopStep);
1517 #endif
1518 }
SimParameters * simParameters
Definition: Node.h:178
int curMFlopStep
Definition: Node.h:156
NamdState * state
Definition: Node.h:181
void Node::resumeAfterTraceBarrier ( CkReductionMsg *  msg)

Definition at line 1420 of file Node.C.

References curTimeStep, Controller::resumeAfterTraceBarrier(), and state.

1420  {
1421  CmiAssert(CmiMyPe()==0);
1422  delete msg;
1424 }
int curTimeStep
Definition: Node.h:151
NamdState * state
Definition: Node.h:181
void resumeAfterTraceBarrier(int)
Definition: Controller.C:4157
void Node::run ( void  )

Definition at line 1105 of file Node.C.

References ResizeArrayIter< Type >::begin(), DebugM, ResizeArrayIter< Type >::end(), endi(), PatchMap::homePatchList(), iINFO(), iout, memusage_MB(), PatchMap::Object(), NamdState::runController(), HomePatch::runSequencer(), and state.

Referenced by messageRun().

1106 {
1107  // Start Controller (aka scalar Sequencer) on Pe(0)
1108 // printf("\n\n I am in Node.C in run method about to call state->runController\n\n");
1109  if ( ! CkMyPe() ) {
1110  state->runController();
1111  }
1112 
1113  DebugM(4, "Starting Sequencers\n");
1114  // Run Sequencer on each HomePatch - i.e. start simulation
1117  for (ai=ai.begin(); ai != ai.end(); ai++) {
1118  HomePatch *patch = (*ai).patch;
1119 //CkPrintf("Proc#%d in Node calling Sequencer ",CkMyPe());
1120  patch->runSequencer();
1121  }
1122 
1123  if (!CkMyPe()) {
1124  double newTime = CmiWallTimer();
1125  iout << iINFO << "Startup phase " << startupPhase-1 << " took "
1126  << newTime - startupTime << " s, "
1127  << memusage_MB() << " MB of memory in use\n";
1128  iout << iINFO << "Finished startup at " << newTime << " s, "
1129  << memusage_MB() << " MB of memory in use\n\n" << endi;
1130  fflush(stdout);
1131  }
1132 
1133 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
void runSequencer(void)
Definition: HomePatch.C:269
static PatchMap * Object()
Definition: PatchMap.h:27
#define DebugM(x, y)
Definition: Debug.h:59
double startupTime
Definition: Node.C:287
HomePatchList * homePatchList()
Definition: PatchMap.C:438
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define iout
Definition: InfoStream.h:51
void runController(void)
Definition: NamdState.C:80
double memusage_MB()
Definition: memusage.h:13
NamdState * state
Definition: Node.h:181
void Node::saveMolDataPointers ( NamdState state)

Definition at line 1381 of file Node.C.

References configList, molecule, parameters, pdb, simParameters, and state.

1382 {
1383  this->molecule = state->molecule;
1384  this->parameters = state->parameters;
1385  this->simParameters = state->simParameters;
1386  this->configList = state->configList;
1387  this->pdb = state->pdb;
1388  this->state = state;
1389 }
SimParameters * simParameters
Definition: Node.h:178
NamdState * state
Definition: Node.h:181
PDB * pdb
Definition: Node.h:180
ConfigList * configList
Definition: Node.h:179
Parameters * parameters
Definition: Node.h:177
Molecule * molecule
Definition: Node.h:176
void Node::scriptBarrier ( void  )

Definition at line 1144 of file Node.C.

1144  {
1145  //script->awaken();
1146 }
void Node::scriptParam ( ScriptParamMsg msg)

Definition at line 1148 of file Node.C.

References ScriptParamMsg::param, SimParameters::scriptSet(), simParameters, and ScriptParamMsg::value.

1148  {
1149  simParameters->scriptSet(msg->param,msg->value);
1150  delete msg;
1151 }
SimParameters * simParameters
Definition: Node.h:178
void scriptSet(const char *, const char *)
char value[MAX_SCRIPT_PARAM_SIZE]
Definition: Node.h:75
char param[MAX_SCRIPT_PARAM_SIZE]
Definition: Node.h:74
void Node::sendCheckpointReq ( int  remote,
const char *  key,
int  task,
Lattice lat,
ControllerState cs 
)

Definition at line 1280 of file Node.C.

References CheckpointMsg::checkpoint, CheckpointMsg::key, Controller::checkpoint::lattice, CheckpointMsg::replica, Controller::checkpoint::state, and CheckpointMsg::task.

Referenced by Controller::algorithm().

1280  {
1281  CheckpointMsg *msg = new (1+strlen(key),0) CheckpointMsg;
1282  msg->replica = CmiMyPartition();
1283  msg->task = task;
1284  msg->checkpoint.lattice = lat;
1285  msg->checkpoint.state = cs;
1286  strcpy(msg->key,key);
1287  envelope *env = UsrToEnv(CheckpointMsg::pack(msg));
1288  CmiSetHandler(env,recvCheckpointCReq_index);
1289 #if CMK_HAS_PARTITION
1290  CmiInterSyncSendAndFree(CkMyPe(),remote,env->getTotalsize(),(char*)env);
1291 #else
1292  CmiSyncSendAndFree(CkMyPe(),env->getTotalsize(),(char*)env);
1293 #endif
1294 }
ControllerState state
Definition: Controller.h:274
int task
Definition: Node.C:87
int replica
Definition: Node.C:88
Controller::checkpoint checkpoint
Definition: Node.C:89
char * key
Definition: Node.C:90
void Node::sendEnableEarlyExit ( void  )

Definition at line 1356 of file Node.C.

Referenced by enableEarlyExit().

1356  {
1357  CProxy_Node nodeProxy(thisgroup);
1358  nodeProxy[0].recvEnableEarlyExit();
1359 }
void Node::sendEnableExitScheduler ( void  )

Definition at line 1332 of file Node.C.

Referenced by enableExitScheduler().

1332  {
1333  //CmiPrintf("sendEnableExitScheduler\n");
1334  CProxy_Node nodeProxy(thisgroup);
1335  nodeProxy[0].recvEnableExitScheduler();
1336 }
void Node::setScript ( ScriptTcl s)
inline

Definition at line 191 of file Node.h.

Referenced by after_backend_init().

191 { script = s; }
void Node::startHPM ( )

Definition at line 1392 of file Node.C.

1392  {
1393 #if USE_HPM
1394  HPM_Start("500 steps", localRankOnNode);
1395 #endif
1396 }
void Node::startup ( )

Definition at line 429 of file Node.C.

References Lattice::a_p(), AtomMap::allocateMap(), WorkDistrib::assignNodeToPatch(), Lattice::b_p(), SimParameters::bondedCUDA, ProxyMgr::buildProxySpanningTree(), Lattice::c_p(), computeMap, computeMgr, ComputeMgr::createComputes(), WorkDistrib::createHomePatches(), LdbCoordinator::createLoadBalancer(), ProxyMgr::createProxies(), DebugM, WorkDistrib::distributeHomePatches(), endi(), BackEnd::exit(), PDB::get_extremes(), ProxyMgr::getRecvSpanning(), ProxyMgr::getSendSpanning(), iINFO(), LdbCoordinator::initialize(), iout, SimParameters::isRecvSpanningTreeOn(), SimParameters::isSendSpanningTreeOn(), SimParameters::lattice, SimParameters::mallocTest, mallocTest_size, WorkDistrib::mapComputes(), memusage_MB(), messageRun(), molecule, SimParameters::MSMOn, SimParameters::MsmSerialOn, NAMD_bug(), NAMD_EVENT_START_EX, NAMD_EVENT_STOP, NamdProfileEventStr, node_molecule, node_parameters, node_simParameters, SimParameters::nonbonded_select(), Molecule::numAtoms, ComputeMap::numComputes(), numPatches, PatchMap::Object(), AtomMap::Object(), Sync::Object(), ComputeMap::Object(), LdbCoordinator::Object(), ProxyMgr::Object(), Sync::openSync(), output, outputPatchComputeMaps(), parameters, WorkDistrib::patchMapInit(), pdb, SimParameters::pme_select(), SimParameters::PMEOn, proxyRecvSpanning, proxySendSpanning, SimParameters::proxyTreeBranchFactor, rand, SimParameters::randomSeed, registerUserEventsForAllComputeObjs(), WorkDistrib::sendComputeMap(), WorkDistrib::sendPatchMap(), WorkDistrib::setPatchMapArrived(), ProxyMgr::setProxyTreeBranchFactor(), ProxyMgr::setRecvSpanning(), ProxyMgr::setSendSpanning(), simParameters, SimParameters::simulatedNodeSize, SimParameters::simulatedPEs, SimParameters::simulateInitialMapping, MsmInitMsg::smax, MsmInitMsg::smin, Random::split(), SimParameters::useCkLoop, SimParameters::useCUDA2, SimParameters::usePMECUDA, and workDistrib.

Referenced by messageStartUp().

429  {
430  int gotoRun = false;
431  double newTime;
432 
433  if (!CkMyPe()) {
434 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
435  char buf[32];
436  sprintf(buf, "%s: %d", NamdProfileEventStr[NamdProfileEvent::NAMD_STARTUP], startupPhase);
437  NAMD_EVENT_START_EX(1, NamdProfileEvent::NAMD_STARTUP, buf);
438 #endif
439  if (!startupPhase) {
440  iout << iINFO << "\n";
441  startupTime = CmiWallTimer();
442  iout << iINFO << "Entering startup at " << startupTime << " s, ";
443  } else {
444  newTime = CmiWallTimer();
445  iout << iINFO << "Startup phase " << startupPhase-1 << " took "
446  << newTime - startupTime << " s, ";
447  startupTime = newTime;
448  }
449  iout << memusage_MB() << " MB of memory in use\n" << endi;
450  fflush(stdout);
451  }
452  switch (startupPhase) {
453 
454  case 0:
456  namdOneCommInit(); // Namd1.X style
457  break;
458 
459  case 1:
460  bindBocVars();
461 
462  // send & receive molecule, simparameters... (Namd1.X style)
463  if (CkMyPe()) {
464  namdOneRecv();
465  } else {
466  namdOneSend();
467  }
468  break;
469 
470  case 2:
471  // fix up one-per-node objects (for SMP version)
475 
478 
479  #if !CMK_SMP || ! USE_CKLOOP
480  //the CkLoop library should be only used in SMP mode
482  #else
483  if ( CkNumPes() < 2 * CkNumNodes() ) simParameters->useCkLoop = 0;
484  #endif
485 
486 
487  if ( simParameters->mallocTest ) {
488  if (!CkMyPe()) {
489  mallocTest_size = 0;
490  CkStartQD(CkIndex_Node::mallocTestQd(), &thishandle);
491  }
492  return;
493  }
494 
495 
496  #ifdef MEASURE_NAMD_WITH_PAPI
497  if(simParameters->papiMeasure) namdInitPapiCounters();
498  #endif
499 
500  #ifdef MEM_OPT_VERSION
501  //At this point, each Node object has received the simParameters,
502  //parameters and the atom signatures info from the master Node
503  //(proc 0). It's time to initialize the parallel IO manager and
504  //read the binary per-atom file --Chao Mei
505 
506  //Step 1: initialize the parallel IO manager per Node
507  ioMgr->initialize(this);
508  #endif
509 
510  break;
511 
512  case 3:
513 
514  #ifdef MEM_OPT_VERSION
515  //Step 2: read the binary per-atom files (signater index, coordinates etc.)
516  ioMgr->readPerAtomInfo();
517  #endif
518 
519  break;
520 
521  case 4:
522 
523  #ifdef MEM_OPT_VERSION
524  //Step 3: update counters of tuples and exclusions inside Molecule object
525  ioMgr->updateMolInfo();
526 
527  //Step 4: prepare distributing the atoms to neighboring procs if necessary
528  ioMgr->migrateAtomsMGrp();
529 
530  //step 5: initialize patchMap and send it to every other processors
531  //to decide atoms to patch distribution on every input processor
532  if(!CkMyPe()) {
533  workDistrib->patchMapInit(); // create space division
535  }
536  #endif
537 
538  #if USE_HPM
539  HPM_Init(localRankOnNode);
540  #endif
541 
542  // take care of inital thread setting
543  threadInit();
544 
545  // create blank AtomMap
547 
548  if (!CkMyPe()) {
549 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
550  if (simParameters->usePMECUDA) {
551  // computePmeCUDAMgr was created in BackEnd.C
552  // This empty branch is to avoid initializing ComputePmeMgr
553  } else
554 #endif
555  if (simParameters->PMEOn) {
556  CkpvAccess(BOCclass_group).computePmeMgr = CProxy_ComputePmeMgr::ckNew();
557  }
558  #ifdef OPENATOM_VERSION
559  if ( simParameters->openatomOn ) {
560  CkpvAccess(BOCclass_group).computeMoaMgr = CProxy_ComputeMoaMgr::ckNew();
561  }
562  #endif // OPENATOM_VERSION
563 
564  }
565 
566  #ifdef OPENATOM_VERSION
567  if ( simParameters->openatomOn ) {
568  // if ( ! CkMyPe() ) {
569  CkCallback doneMoaStart(CkIndexmain::doneMoaSetup(), thishandle);
570  startOA(simParameters->moaDriverFile, simParameters->moaPhysicsFile, doneMoaStart);
571  // }
572  }
573  #endif // OPENATOM_VERSION
574 
575  // BEGIN LA
577  rand->split(CkMyPe(), CkNumPes());
578  // END LA
579 
580  break;
581 
582  case 5:
583  #ifdef MEM_OPT_VERSION
584  //Now, every input proc has received all the atoms necessary
585  //to decide the patches those atoms belong to
586 
587  //step 1: integrate the migrated atoms into the atom list that
588  //contains the initally distributed atoms, and sort the atoms
589  //based on hydrogenList value
590  ioMgr->integrateMigratedAtoms();
591 
592  //step 2: integrate the cluster size of each atom on each output proc
593  ioMgr->integrateClusterSize();
594 
595  //step 3: calculate the number of atoms in each patch on every
596  //input procs (atoms belonging to a patch may lie on different
597  //procs), and reduce such info on proc 0. Such info is required
598  //for determing which node a particular patch is assigned to.
599  ioMgr->calcAtomsInEachPatch();
600 
601  //set to false to re-send PatchMap later
603  #endif
604  break;
605  case 6:
608  }
611  }
614  }
615  #ifdef PROCTRACE_DEBUG
616  DebugFileTrace::Instance("procTrace");
617  #endif
618 
619  if (!CkMyPe()) {
620  output = new Output; // create output object just on PE(0)
621 
622  #ifndef MEM_OPT_VERSION
623  workDistrib->patchMapInit(); // create space division
624  workDistrib->createHomePatches(); // load atoms into HomePatch(es)
625  #endif
626 
629  //ComputeMap::Object()->printComputeMap();
630 
631  // For MIC runs, take the additional step after the compute map has been created to
632  // assign the various computes to either the host or the device. This info will
633  // be distributed across the PEs.
634  #if defined(NAMD_MIC)
635  mic_initHostDeviceLDB();
636  #endif
637 
639  iout << iINFO << "Simulating initial mapping with " << simParameters->simulatedPEs
640  << " PEs with " << simParameters->simulatedNodeSize << " PEs per node\n" << endi;
641  outputPatchComputeMaps("init_mapping", 0);
642  iout << iINFO << "Simulating initial mapping is done, now NAMD exits\n" << endi;
643  BackEnd::exit();
644  }
645 
647 
648  //in MEM_OPT_VERSION, patchMap is resent
649  //because they have been updated since creation including
650  //#atoms per patch, the proc a patch should stay etc. --Chao Mei
652  #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
653  CProxy_NodeProxyMgr npm(CkpvAccess(BOCclass_group).nodeProxyMgr);
654  //a node broadcast
655  npm.createProxyInfo(PatchMap::Object()->numPatches());
656  #endif
657  }
658  {
659  #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
660  CProxy_NodeProxyMgr npm(CkpvAccess(BOCclass_group).nodeProxyMgr);
661  if(CkMyRank()==0) {
662  //just need to register once
663  npm[CkMyNode()].ckLocalBranch()->registerLocalProxyMgr(CkpvAccess(BOCclass_group).proxyMgr);
664  }
665  npm[CkMyNode()].ckLocalBranch()->registerLocalPatchMap(CkMyRank(), PatchMap::Object());
666  #endif
667  }
668  break;
669 
670  case 7:
671 #ifdef CHARM_HAS_MSA
673  CProxy_ComputeMsmMsaMgr msm(CkpvAccess(BOCclass_group).computeMsmMsaMgr);
674  msm[CkMyPe()].initialize(new CkQdMsg);
675  }
676 #else
678  CProxy_ComputeMsmMgr msm(CkpvAccess(BOCclass_group).computeMsmMgr);
679  MsmInitMsg *msg = new MsmInitMsg;
680  Lattice lattice = simParameters->lattice; // system lattice vectors
681  ScaledPosition smin=0, smax=0;
682  if (lattice.a_p() && lattice.b_p() && lattice.c_p()) {
683  msg->smin = smin;
684  msg->smax = smax;
685  msm[CkMyPe()].initialize(msg); // call from my own PE
686  }
687  else if ( ! CkMyPe() ) {
688  pdb->get_extremes(smin, smax); // only available on PE 0
689  msg->smin = smin;
690  msg->smax = smax;
691  msm.initialize(msg); // broadcast to chare group
692  }
693 
694  /*
695  CProxy_Node nd(CkpvAccess(BOCclass_group).node);
696  Node *node = nd.ckLocalBranch();
697  ScaledPosition smin, smax;
698  node->pdb->get_extremes(smin, smax);
699  msg->smin = smin; // extreme positions in system
700  msg->smax = smax;
701  msm[CkMyPe()].initialize(msg);
702  */
703  }
704 #endif
705 
706  if ( simParameters->PMEOn ) {
707  #ifdef OPENATOM_VERSION
708  if ( simParameters->openatomOn ) {
709  CProxy_ComputeMoaMgr moa(CkpvAccess(BOCclass_group).computeMoaMgr);
710  moa[CkMyPe()].initialize(new CkQdMsg);
711  }
712  #endif // OPENATOM_VERSION
713 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
714  if ( simParameters->usePMECUDA ) {
715  if(CkMyRank()==0) {
716  CProxy_ComputePmeCUDAMgr pme(CkpvAccess(BOCclass_group).computePmeCUDAMgr);
717  pme.ckLocalBranch()->initialize(new CkQdMsg); // must run on pe 0 to call ckNew
718  }
719  } else
720 #endif
721  {
722  CProxy_ComputePmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
723  pme[CkMyPe()].initialize(new CkQdMsg);
724  }
725  }
726  break;
727 
728  case 8:
729 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
730  if ( (simParameters->useCUDA2 || simParameters->bondedCUDA) && CkMyRank()==0 ) {
731  CProxy_ComputeCUDAMgr nb(CkpvAccess(BOCclass_group).computeCUDAMgr);
732  nb.ckLocalBranch()->initialize(new CkQdMsg);
733  }
734 #endif
735  break;
736 
737  case 9:
739  break;
740 
741  case 10:
742  #ifdef MEM_OPT_VERSION
743  //migrate atoms to HomePatch processors
744  ioMgr->sendAtomsToHomePatchProcs();
745  #endif
746  break;
747 
748  case 11:
749  // part 2 of MSM init
751  CProxy_ComputeMsmMgr msm(CkpvAccess(BOCclass_group).computeMsmMgr);
752  msm[CkMyPe()].initialize_create(); // call from my own PE
753  }
754 
755  if ( simParameters->PMEOn ) {
756  #ifdef OPENATOM_VERSION
757  if ( simParameters->openatomOn ) {
758  CProxy_ComputeMoaMgr moa(CkpvAccess(BOCclass_group).computeMoaMgr);
759  moa[CkMyPe()].initWorkers(new CkQdMsg);
760  }
761  #endif // OPENATOM_VERSION
762 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
763  if ( simParameters->usePMECUDA ) {
764  if(CkMyRank()==0) {
765  CProxy_ComputePmeCUDAMgr pme(CkpvAccess(BOCclass_group).computePmeCUDAMgr);
766  pme[CkMyNode()].initialize_pencils(new CkQdMsg);
767  }
768  } else
769 #endif
770  {
771  CProxy_ComputePmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
772  pme[CkMyPe()].initialize_pencils(new CkQdMsg);
773  }
774  }
775 #ifdef CHARM_HAS_MSA
776  else if ( simParameters->MSMOn && ! simParameters->MsmSerialOn ) {
777  CProxy_ComputeMsmMsaMgr msm(CkpvAccess(BOCclass_group).computeMsmMsaMgr);
778  msm[CkMyPe()].initWorkers(new CkQdMsg);
779  }
780 #else
781  else if ( simParameters->MSMOn && ! simParameters->MsmSerialOn ) {
782  CProxy_ComputeMsmMgr msm(CkpvAccess(BOCclass_group).computeMsmMgr);
783  msm[CkMyPe()].update(new CkQdMsg);
784  }
785 #endif
786 
787  #ifdef MEM_OPT_VERSION
788  //Now every processor has all the atoms it needs to create the HomePatches.
789  //The HomePatches are created in parallel on every home patch procs.
790  ioMgr->createHomePatches();
791  #else
792  if (!CkMyPe()) {
794  }
795  #endif
796  break;
797 
798  case 12:
799  if ( simParameters->PMEOn ) {
800  #ifdef OPENATOM_VERSION
801  if ( simParameters->openatomOn ) {
802  CProxy_ComputeMoaMgr moa(CkpvAccess(BOCclass_group).computeMoaMgr);
803  moa[CkMyPe()].startWorkers(new CkQdMsg);
804  }
805  #endif // OPENATOM_VERSION
806 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
807  if ( simParameters->usePMECUDA ) {
808  if(CkMyRank()==0) {
809  CProxy_ComputePmeCUDAMgr pme(CkpvAccess(BOCclass_group).computePmeCUDAMgr);
810  pme[CkMyNode()].activate_pencils(new CkQdMsg);
811  }
812  } else
813 #endif
814  {
815  CProxy_ComputePmeMgr pme(CkpvAccess(BOCclass_group).computePmeMgr);
816  pme[CkMyPe()].activate_pencils(new CkQdMsg);
817  }
818  }
819 #ifdef CHARM_HAS_MSA
820  else if ( simParameters->MSMOn && ! simParameters->MsmSerialOn ) {
821  CProxy_ComputeMsmMsaMgr msm(CkpvAccess(BOCclass_group).computeMsmMsaMgr);
822  msm[CkMyPe()].startWorkers(new CkQdMsg);
823  }
824 #else
825  /*
826  else if ( simParameters->MSMOn && ! simParameters->MsmSerialOn ) {
827  CProxy_ComputeMsmMgr msm(CkpvAccess(BOCclass_group).computeMsmMgr);
828  //msm[CkMyPe()].startWorkers(new CkQdMsg);
829  }
830  */
831 #endif
832 
833  proxyMgr->createProxies(); // need Home patches before this
834  if (!CkMyPe()) LdbCoordinator::Object()->createLoadBalancer();
835 
836 #ifdef NAMD_TCL
837  // TclInitSubsystems() has a race condition so we create one interp per node here
838  if (CkMyPe() && CkMyNodeSize() > 1 && ! CkMyRank()) Tcl_DeleteInterp(Tcl_CreateInterp());
839 #endif
840 
841 #ifdef USE_NODEPATCHMGR
842  //at this point, PatchMap info has been recved on PEs. It is time to create
843  //the home patch spanning tree for receiving proxy list info
844  if(proxyMgr->getSendSpanning() || proxyMgr->getRecvSpanning()) {
845  if(CkMyRank()==0) {
846  CProxy_NodeProxyMgr npm(CkpvAccess(BOCclass_group).nodeProxyMgr);
847  npm[CkMyNode()].ckLocalBranch()->createSTForHomePatches(PatchMap::Object());
848  }
849  }
850 #endif
851 
852  break;
853 
854  case 13:
855 
856  // DMK - DEBUG - If, in MIC runs, the debug option to dump all the compute maps to files
857  // for debugging/verification purposes has been enabled, have each PE do so now.
858  #if defined(NAMD_MIC)
859  mic_dumpHostDeviceComputeMap();
860  #endif
861 
862  if (!CkMyPe()) {
863  iout << iINFO << "CREATING " << ComputeMap::Object()->numComputes()
864  << " COMPUTE OBJECTS\n" << endi;
865  }
866  DebugM(4,"Creating Computes\n");
868  DebugM(4,"Building Sequencers\n");
869  buildSequencers();
870  DebugM(4,"Initializing LDB\n");
872  break;
873 
874  case 14:
875  // computes may create proxies on the fly so put these in separate phase
876  Sync::Object()->openSync(); // decide if to open local Sync
878 #if defined(CMK_BALANCED_INJECTION_API) && CMK_BALANCED_INJECTION_API != 0
879  if(CkMyRank() == 0){
880  // CkPrintf("[%d] get retrieved BI=%d\n",CkMyPe(),balancedInjectionLevel);
881  ck_set_GNI_BIConfig(balancedInjectionLevel);
882  // CkPrintf("[%d] set retrieved BI=%d\n",CkMyPe(),ck_get_GNI_BIConfig());
883  }
884 #endif
885 
886  break;
887 
888  case 15:
889  {
890  //For debugging
891  /*if(!CkMyPe()){
892  FILE *dumpFile = fopen("/tmp/NAMD_Bench.dump", "w");
893  dumpbench(dumpFile);
894  NAMD_die("Normal execution\n");
895  }*/
896  }
897  #ifdef MEM_OPT_VERSION
898  //free space in the Molecule object that are not used anymore
899  ioMgr->freeMolSpace();
900  #endif
901  gotoRun = true;
902  break;
903 
904  default:
905  NAMD_bug("Startup Phase has a bug - check case statement");
906  break;
907 
908  }
909 
910  startupPhase++;
911  if (!CkMyPe()) {
912 #if defined(NAMD_NVTX_ENABLED) || defined(NAMD_CMK_TRACE_ENABLED) || defined(NAMD_ROCTX_ENABLED)
913  NAMD_EVENT_STOP(1, NamdProfileEvent::NAMD_STARTUP);
914 #endif
915  if (!gotoRun) {
916  CkStartQD(CkCallback(CkIndex_Node::startup(), thisgroup));
917  } else {
919  }
920  }
921 }
void allocateMap(int nAtomIDs)
Definition: AtomMap.C:161
#define NAMD_EVENT_STOP(eon, id)
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
Bool simulateInitialMapping
void setPatchMapArrived(bool s)
Definition: WorkDistrib.h:107
void createProxies(void)
Definition: ProxyMgr.C:417
void setRecvSpanning()
Definition: ProxyMgr.C:371
int proxyRecvSpanning
Definition: ProxyMgr.C:46
int numComputes(void)
Definition: ComputeMap.h:101
int getRecvSpanning()
Definition: ProxyMgr.C:376
static ProxyMgr * Object()
Definition: ProxyMgr.h:394
static PatchMap * Object()
Definition: PatchMap.h:27
static void exit(int status=0)
Definition: BackEnd.C:276
Definition: Vector.h:64
Output * output
Definition: Node.h:182
SimParameters * simParameters
Definition: Node.h:178
void setSendSpanning()
Definition: ProxyMgr.C:362
#define DebugM(x, y)
Definition: Debug.h:59
void createLoadBalancer()
double startupTime
Definition: Node.C:287
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
int getSendSpanning()
Definition: ProxyMgr.C:367
char const *const NamdProfileEventStr[]
#define iout
Definition: InfoStream.h:51
Molecule * node_molecule
Definition: Node.C:425
void outputPatchComputeMaps(const char *filename, int tag)
Definition: Node.C:1521
void createComputes(ComputeMap *map)
Definition: ComputeMgr.C:1009
void split(int iStream, int numStreams)
Definition: Random.h:77
void patchMapInit(void)
Definition: WorkDistrib.C:1109
void openSync()
Definition: Sync.C:63
ComputeMap * computeMap
Definition: Node.h:202
double memusage_MB()
Definition: memusage.h:13
void sendComputeMap(void)
Definition: WorkDistrib.C:1082
Definition: Output.h:43
void registerUserEventsForAllComputeObjs()
Definition: ComputeMgr.C:830
void initialize(PatchMap *pmap, ComputeMap *cmap, int reinit=0)
Definition: Random.h:37
void buildProxySpanningTree()
Definition: ProxyMgr.C:559
void createHomePatches(void)
Definition: WorkDistrib.C:893
void NAMD_bug(const char *err_msg)
Definition: common.C:129
ScaledPosition smax
Definition: ComputeMsm.h:21
static void pme_select()
static void messageRun()
Definition: Node.C:1096
static Sync * Object()
Definition: Sync.h:50
int numAtoms
Definition: Molecule.h:557
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ cudaTextureObject_t const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
PDB * pdb
Definition: Node.h:180
static LdbCoordinator * Object()
static AtomMap * Object()
Definition: AtomMap.h:36
static void nonbonded_select()
void sendPatchMap(void)
Definition: WorkDistrib.C:982
int isRecvSpanningTreeOn()
Parameters * parameters
Definition: Node.h:177
unsigned int randomSeed
WorkDistrib * workDistrib
Definition: Node.h:166
Parameters * node_parameters
Definition: Node.C:424
#define NAMD_EVENT_START_EX(eon, id, str)
SimParameters * node_simParameters
Definition: Node.C:423
Random * rand
Definition: Node.h:172
void mapComputes(void)
Definition: WorkDistrib.C:2274
static ComputeMap * Object()
Definition: ComputeMap.h:89
ScaledPosition smin
Definition: ComputeMsm.h:21
void distributeHomePatches(void)
Definition: WorkDistrib.C:934
void setProxyTreeBranchFactor(int dim)
Definition: ProxyMgr.C:380
int isSendSpanningTreeOn()
ComputeMgr * computeMgr
Definition: Node.h:169
int b_p() const
Definition: Lattice.h:274
int mallocTest_size
Definition: Node.h:129
int a_p() const
Definition: Lattice.h:273
Molecule * molecule
Definition: Node.h:176
void get_extremes(ScaledPosition &xmin, ScaledPosition &xmax) const
Definition: PDB.h:104
int c_p() const
Definition: Lattice.h:275
void assignNodeToPatch(void)
Definition: WorkDistrib.C:1323
int proxySendSpanning
Definition: ProxyMgr.C:45
void Node::stopHPM ( )

Definition at line 1398 of file Node.C.

1398  {
1399 #if USE_HPM
1400  HPM_Stop("500 steps", localRankOnNode);
1401  HPM_Print(CkMyPe(), localRankOnNode);
1402 #endif
1403 }
void Node::traceBarrier ( int  turnOnTrace,
int  step 
)

Definition at line 1405 of file Node.C.

References curTimeStep.

1405  {
1406  curTimeStep = step;
1407  if(turnOnTrace) traceBegin();
1408  else traceEnd();
1409 
1410  if(turnOnTrace) CmiTurnOnStats();
1411  else CmiTurnOffStats();
1412 
1413  //CkPrintf("traceBarrier (%d) at step %d called on proc %d\n", turnOnTrace, step, CkMyPe());
1414  CProxy_Node nd(CkpvAccess(BOCclass_group).node);
1415  CkCallback cb(CkIndex_Node::resumeAfterTraceBarrier(NULL), nd[0]);
1416  contribute(0, NULL, CkReduction::sum_int, cb);
1417 
1418 }
int curTimeStep
Definition: Node.h:151
void Node::updateGridScale ( const char *  key,
Vector  scale 
)

Definition at line 1204 of file Node.C.

References DebugM, MGridforceParamsList::find_key(), Molecule::get_gridfrc_grid(), MGridforceParamsList::index_for_key(), SimParameters::mgridforcelist, MGRIDFORCEPARAMS_DEFAULTKEY, molecule, NAMD_bug(), NAMD_die(), simParameters, Vector::x, Vector::y, and Vector::z.

1204  {
1205  DebugM(4, "updateGridScale(char*, Vector) called on node " << CkMyPe() << "\n" << endi);
1206 
1207  int gridnum;
1208  MGridforceParams* mgridParams;
1209  if (key == NULL) {
1212  } else {
1213  gridnum = simParameters->mgridforcelist.index_for_key(key);
1214  mgridParams = simParameters->mgridforcelist.find_key(key);
1215  }
1216 
1217  if (gridnum < 0 || mgridParams == NULL) {
1218  NAMD_die("Node::updateGridScale(char*, Vector): Could not find grid.");
1219  }
1220 
1221  GridforceGrid* grid = molecule->get_gridfrc_grid(gridnum);
1222  if (grid == NULL) {
1223  NAMD_bug("Node::updateGridScale(char*, Vector): grid not found");
1224  }
1225  CProxy_Node(thisgroup).updateGridScale(gridnum, scale.x, scale.y, scale.z);
1226 
1227  DebugM(4, "updateGridScale(char*, Vector) finished\n" << endi);
1228 }
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
BigReal z
Definition: Vector.h:66
int index_for_key(const char *key)
void NAMD_bug(const char *err_msg)
Definition: common.C:129
#define MGRIDFORCEPARAMS_DEFAULTKEY
MGridforceParams * find_key(const char *key)
BigReal x
Definition: Vector.h:66
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1280
void NAMD_die(const char *err_msg)
Definition: common.C:85
MGridforceParamsList mgridforcelist
BigReal y
Definition: Vector.h:66
Molecule * molecule
Definition: Node.h:176
void Node::updateGridScale ( int  gridnum,
float  sx,
float  sy,
float  sz 
)

Definition at line 1229 of file Node.C.

References MGridforceParamsList::at_index(), DebugM, Molecule::get_gridfrc_grid(), MGridforceParams::gridforceScale, SimParameters::mgridforcelist, molecule, NAMD_bug(), GridforceGrid::set_scale(), and simParameters.

1229  {
1230  if (CmiMyRank()) return;
1231  DebugM(4, "updateGridScale(char*, int, float, float, float) called on node " << CkMyPe() << "\n" << endi);
1232 
1233  GridforceGrid *grid = molecule->get_gridfrc_grid(gridnum);
1234  if (grid == NULL) {
1235  NAMD_bug("Node::updateGridScale(char*, int, float, float, float):grid not found");
1236  }
1237 
1238  Vector scale(sx,sy,sz);
1240  grid->set_scale( scale );
1241 
1242  DebugM(4, "updateGridScale(char*, int, float, float, float) finished\n" << endi);
1243 }
Definition: Vector.h:64
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
void NAMD_bug(const char *err_msg)
Definition: common.C:129
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1280
MGridforceParamsList mgridforcelist
MGridforceParams * at_index(int idx)
Molecule * molecule
Definition: Node.h:176
virtual void set_scale(Vector s)=0

Member Data Documentation

AtomMap* Node::atomMap
protected

Definition at line 200 of file Node.h.

Referenced by Node(), and ~Node().

colvarmodule* Node::colvars

Definition at line 184 of file Node.h.

Referenced by colvarproxy_namd::colvarproxy_namd(), and Node().

ComputeMap* Node::computeMap
protected

Definition at line 202 of file Node.h.

Referenced by startup(), and ~Node().

ComputeMgr* Node::computeMgr

Definition at line 169 of file Node.h.

Referenced by Sequencer::integrate(), Sequencer::minimize(), resendMolecule(), and startup().

ConfigList* Node::configList
Vector* Node::coords
int Node::curMFlopStep

Definition at line 156 of file Node.h.

Referenced by papiMeasureBarrier(), and resumeAfterPapiMeasureBarrier().

int Node::curTimeStep

Definition at line 151 of file Node.h.

Referenced by resumeAfterTraceBarrier(), and traceBarrier().

IMDOutput* Node::imd
float Node::initRSS

Definition at line 135 of file Node.h.

float Node::initVM

Definition at line 135 of file Node.h.

LdbCoordinator* Node::ldbCoordinator
protected

Definition at line 203 of file Node.h.

int Node::mallocTest_size

Definition at line 129 of file Node.h.

Referenced by mallocTestQd(), and startup().

Molecule* Node::molecule

Definition at line 176 of file Node.h.

Referenced by Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), WorkDistrib::assignNodeToPatch(), ComputeNonbondedCUDA::build_exclusions(), ComputeQMMgr::calcMOPAC(), ComputeQMMgr::calcORCA(), Controller::calcPressure(), colvarproxy_namd::calculate(), ComputeQMMgr::calcUSR(), colvarproxy_namd::check_atom_id(), Controller::compareChecksums(), AngleElem::computeForce(), ImproperElem::computeForce(), CrosstermElem::computeForce(), DihedralElem::computeForce(), TholeElem::computeForce(), AnisoElem::computeForce(), BondElem::computeForce(), Controller::Controller(), WorkDistrib::createAtomLists(), ComputeMgr::createComputes(), ComputeConsForce::doForce(), ComputeConsTorque::doForce(), ComputeStir::doForce(), ComputeGridForce::doForce(), ComputeRestraints::doForce(), ComputePme::doQMWork(), ComputeNonbondedCUDA::doWork(), dumpbench(), ComputeNonbondedCUDA::finishWork(), GlobalMasterEasy::GlobalMasterEasy(), GlobalMasterFreeEnergy::GlobalMasterFreeEnergy(), GlobalMasterSymmetry::GlobalMasterSymmetry(), GlobalMasterTMD::GlobalMasterTMD(), HomePatch::hardWallDrude(), colvarproxy_namd::init_atom_group(), colvarproxy_namd::init_volmap(), ComputeQM::initialize(), ParallelIOMgr::initialize(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), LJTable::LJTable(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), HomePatch::loweAndersenVelocities(), HomePatch::minimize_rattle2(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Controller::multigatorCalcEnthalpy(), Node(), WorkDistrib::patchMapInit(), Controller::printDynamicsEnergies(), Controller::printEnergies(), Controller::printMinimizeEnergies(), HomePatch::qmSwapAtoms(), HomePatch::rattle1old(), HomePatch::rattle2(), Controller::receivePressure(), ComputeMgr::recvComputeConsForceMsg(), ComputeMsmSerialMgr::recvCoord(), ComputeExtMgr::recvCoord(), ComputeFmmSerialMgr::recvCoord(), ComputeGBISserMgr::recvCoord(), ComputeQMMgr::recvPartQM(), Sequencer::reloadCharges(), reloadCharges(), reloadGridforceGrid(), reloadStructure(), Controller::rescaleaccelMD(), Sequencer::rescaleSoluteCharges(), resendMolecule(), resendMolecule2(), saveMolDataPointers(), ComputeQM::saveResults(), ComputeNonbondedUtil::select(), HomePatch::setGBISIntrinsicRadii(), HomePatch::setLcpoType(), startup(), Tcl_centerOfMass(), Tcl_centerOfNumber(), Tcl_loadCoords(), Tcl_radiusOfGyration(), Sequencer::tcoupleVelocities(), colvarproxy_namd::update_atom_properties(), colvarproxy_namd::update_group_properties(), updateGridScale(), and wrap_coor_int().

Output* Node::output
Parameters* Node::parameters
PatchMap* Node::patchMap
protected

Definition at line 201 of file Node.h.

Referenced by Node(), and ~Node().

PDB* Node::pdb
Random* Node::rand
SimParameters* Node::simParameters

Definition at line 178 of file Node.h.

Referenced by HomePatch::addForceToMomentum(), HomePatch::addForceToMomentum3(), HomePatch::addVelocityToPosition(), WorkDistrib::assignNodeToPatch(), PmeZPencil::backward_fft(), PmeYPencil::backward_fft(), PmeXPencil::backward_fft(), HomePatch::buildRattleList(), Controller::calcPressure(), ComputePmeMgr::chargeGridSubmitted(), colvarproxy_namd::colvarproxy_namd(), ComputeCylindricalBC::ComputeCylindricalBC(), ComputeEwald::ComputeEwald(), AngleElem::computeForce(), CrosstermElem::computeForce(), ImproperElem::computeForce(), DihedralElem::computeForce(), TholeElem::computeForce(), AnisoElem::computeForce(), BondElem::computeForce(), GromacsPairElem::computeForce(), ComputeFullDirect::ComputeFullDirect(), ComputeGlobal::ComputeGlobal(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::ComputeHomeTuples(), ComputeLCPO::ComputeLCPO(), ComputeMsm::ComputeMsm(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputeNonbondedPair::ComputeNonbondedPair(), ComputeNonbondedSelf::ComputeNonbondedSelf(), ComputePme::ComputePme(), ComputeRestraints::ComputeRestraints(), ComputeSphericalBC::ComputeSphericalBC(), ComputeStir::ComputeStir(), ComputeTclBC::ComputeTclBC(), Output::coordinate(), Output::coordinateNeeded(), WorkDistrib::createAtomLists(), ComputeMgr::createComputes(), ComputeCUDAMgr::createCudaComputeNonbonded(), LdbCoordinator::createLoadBalancer(), CudaComputeNonbonded::CudaComputeNonbonded(), ComputeConsForce::doForce(), ComputeEField::doForce(), ComputeConsTorque::doForce(), ComputeStir::doForce(), ComputeGridForce::doForce(), ComputeNonbondedPair::doForce(), ComputeNonbondedSelf::doForce(), ComputeRestraints::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), ComputeTclBC::doWork(), ComputeGBISser::doWork(), ComputeNonbondedCUDA::doWork(), CudaComputeNonbonded::doWork(), dumpbench(), HomePatch::exchangeAtoms(), HomePatch::exchangeCheckpoint(), PmeZPencil::fft_init(), PmeYPencil::fft_init(), PmeXPencil::fft_init(), ComputeNonbondedCUDA::finishReductions(), CudaComputeNonbonded::finishReductions(), ComputeNonbondedCUDA::finishWork(), Output::force(), Output::forceNeeded(), PmeZPencil::forward_fft(), PmeYPencil::forward_fft(), PmeXPencil::forward_fft(), ComputePmeCUDADevice::gatherForceDone(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), GlobalMasterIMD::get_vmd_forces(), GlobalMasterFreeEnergy::GlobalMasterFreeEnergy(), GlobalMasterIMD::GlobalMasterIMD(), GlobalMasterServer::GlobalMasterServer(), GlobalMasterSymmetry::GlobalMasterSymmetry(), GlobalMasterTMD::GlobalMasterTMD(), HomePatch::hardWallDrude(), ComputePmeCUDA::initialize(), LdbCoordinator::initialize(), ComputeQM::initialize(), ParallelIOMgr::initialize(), ComputePmeMgr::initialize(), ComputeMsmMgr::initialize(), ComputePmeMgr::initialize_computes(), ComputePmeMgr::initialize_pencils(), isPmeProcessor(), CudaComputeNonbonded::launchWork(), LJTable::LJTable(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), HomePatch::loweAndersenVelocities(), WorkDistrib::mapComputes(), HomePatch::minimize_rattle2(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Controller::multigatorCalcEnthalpy(), NamdHybridLB::NamdHybridLB(), Node(), ComputeNonbondedCUDA::noWork(), PmePencil< CBase_PmeZPencil >::order_init(), outputPatchComputeMaps(), Patch::Patch(), WorkDistrib::patchMapInit(), Patch::positionsReady(), HomePatch::positionsReady(), Controller::printDynamicsEnergies(), Controller::printEnergies(), HomePatch::qmSwapAtoms(), HomePatch::rattle1(), HomePatch::rattle1old(), HomePatch::rattle2(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), CollectionMaster::receiveDataStream(), Controller::receivePressure(), recursive_bisect_with_curve(), HomePatch::recvCheckpointLoad(), ComputeExtMgr::recvCoord(), ComputeMsmSerialMgr::recvCoord(), ComputeFmmSerialMgr::recvCoord(), ComputeQMMgr::recvPartQM(), ComputeNonbondedCUDA::recvYieldDevice(), ComputeNonbondedCUDA::registerPatches(), reloadGridforceGrid(), resendMolecule(), resumeAfterPapiMeasureBarrier(), ScriptTcl::run(), saveMolDataPointers(), WorkDistrib::savePatchMap(), ComputeGlobal::saveTotalForces(), scriptParam(), ComputePmeUtil::select(), ComputeNonbondedUtil::select(), PmeZPencil::send_all_ungrid(), PmeZPencil::send_trans(), PmeYPencil::send_trans(), PmeYPencil::send_untrans(), PmeXPencil::send_untrans(), WorkDistrib::sendPatchMap(), ComputePmeMgr::sendTrans(), ComputePmeMgr::sendUngrid(), ComputePmeMgr::sendUntrans(), HomePatch::setGBISIntrinsicRadii(), PatchMgr::setLattice(), ComputePmeCUDAMgr::setupPencils(), ComputeNonbondedCUDA::skip(), NamdHybridLB::splitComputes(), startup(), NamdCentLB::Strategy(), CollectionMgr::submitForces(), ComputePmeMgr::submitReductions(), ComputePme::ungridForces(), updateGridScale(), ComputeMgr::updateLocalComputes4(), Output::velocity(), Output::velocityNeeded(), and wrap_coor_int().

bool Node::specialTracing

Definition at line 163 of file Node.h.

Referenced by Node().

NamdState* Node::state
WorkDistrib* Node::workDistrib

Definition at line 166 of file Node.h.

Referenced by ParallelIOMgr::createHomePatches(), and startup().


The documentation for this class was generated from the following files: