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 290 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.

291 {
292  DebugM(4,"Creating Node\n");
293 #if(CMK_CCS_AVAILABLE && CMK_WEB_MODE)
294  CApplicationInit();
295 #endif
296  if (CkpvAccess(Node_instance) == 0) {
297  CkpvAccess(Node_instance) = this;
298  eventEndOfTimeStep = traceRegisterUserEvent("EndOfTimeStep", 135);
299  } else {
300  NAMD_bug("Node::Node() - another instance of Node exists!");
301  }
302 
303  CkpvAccess(BOCclass_group) = msg->group;
304  delete msg;
305 
306  CkpvAccess(BOCclass_group).node = thisgroup;
307 
308  recvCheckpointCReq_index = CmiRegisterHandler((CmiHandler)recvCheckpointCReq_handler);
309  recvCheckpointCAck_index = CmiRegisterHandler((CmiHandler)recvCheckpointCAck_handler);
310 
311  startupPhase = 0;
312 
313  molecule = NULL;
314  parameters = NULL;
315  simParameters = NULL;
316  configList = NULL;
317  pdb = NULL;
318  state = NULL;
319  output = NULL;
320  imd = new IMDOutput;
321  colvars = 0;
322 
323 #if USE_HPM
324  // assumes that this will be done only on BG/P
325  TopoManager *tmgr = new TopoManager();
326  int x, y, z;
327  tmgr->rankToCoordinates(CkMyPe(), x, y, z, localRankOnNode);
328  delete tmgr;
329 #endif
330 
331  specialTracing = traceAvailable() && (traceIsOn()==0);
332 
333  DebugM(4,"Creating PatchMap, AtomMap, ComputeMap\n");
336  if ( CkMyRank() == 0 ) ComputeMap::Instance();
337 
338  //Note: Binding BOC vars such as workDistrib has been moved
339  //to the 1st phase of startup because the in-order message delivery
340  //is not always guaranteed --Chao Mei
341 #ifdef CMK_BALANCED_INJECTION_API
342  if(CkMyRank() == 0){
343  balancedInjectionLevel=ck_get_GNI_BIConfig();
344  // CkPrintf("[%d] get retrieved BI=%d\n",CkMyPe(),balancedInjectionLevel);
345  ck_set_GNI_BIConfig(20);
346  // CkPrintf("[%d] set retrieved BI=%d\n",CkMyPe(),ck_get_GNI_BIConfig());
347  }
348 #endif
349 
350 }
bool specialTracing
Definition: Node.h:163
void recvCheckpointCReq_handler(envelope *)
Definition: Node.C:1289
BOCgroup group
Definition: Node.h:68
int eventEndOfTimeStep
Definition: Node.C:285
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:123
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:1311
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 355 of file Node.C.

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

356 {
357  delete output;
358  delete computeMap;
359  delete atomMap;
360  delete patchMap;
361  delete CkpvAccess(comm);
362  // BEGIN LA
363  delete rand;
364  // END LA
365 #ifdef MEASURE_NAMD_WITH_PAPI
366  delete CkpvAccess(papiEvents);
367 #endif
368 }
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 1364 of file Node.C.

References NAMD_die().

1364  {
1365  NAMD_die("Exiting prematurely; see error messages above.");
1366 }
void NAMD_die(const char *err_msg)
Definition: common.C:83
void Node::enableEarlyExit ( void  )

Definition at line 1356 of file Node.C.

References sendEnableEarlyExit().

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

1356  {
1357  if ( CkMyPe() ) {
1359  } else {
1360  CkStartQD(CkIndex_Node::earlyExit(),&thishandle);
1361  }
1362 }
void sendEnableEarlyExit(void)
Definition: Node.C:1347
void Node::enableExitScheduler ( void  )

Definition at line 1334 of file Node.C.

References sendEnableExitScheduler().

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

1334  {
1335  if ( CkMyPe() ) {
1337  } else {
1338  CkStartQD(CkIndex_Node::exitScheduler(), &thishandle);
1339  }
1340 }
void sendEnableExitScheduler(void)
Definition: Node.C:1323
void Node::enableScriptBarrier ( )

Definition at line 1131 of file Node.C.

1131  {
1132  CkStartQD(CkIndex_Node::scriptBarrier(), &thishandle);
1133 }
void Node::exitScheduler ( void  )

Definition at line 1342 of file Node.C.

1342  {
1343  //CmiPrintf("exitScheduler %d\n",CkMyPe());
1344  CsdExitScheduler();
1345 }
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 391 of file Node.C.

References NAMD_die().

Referenced by mallocTestQd().

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

Definition at line 403 of file Node.C.

References mallocTest(), and mallocTest_size.

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

Definition at line 1087 of file Node.C.

References run().

Referenced by startup().

1087  {
1088  (CProxy_Node(CkpvAccess(BOCclass_group).node)).run();
1089 }
void run()
Definition: Node.C:1096
void Node::messageStartUp ( )
static

Definition at line 418 of file Node.C.

References startup().

418  {
419  (CProxy_Node(CkpvAccess(BOCclass_group).node)).startup();
420 }
void startup()
Definition: Node.C:428
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 1512 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().

1512  {
1514 
1515  int numpes = CkNumPes();
1516  int nodesize = CkMyNodeSize();
1518  numpes = simParameters->simulatedPEs;
1519  nodesize = simParameters->simulatedNodeSize;
1520  }
1521 
1522  char fname[128];
1523  sprintf(fname, "mapdump_%s.%d_%d_%d_%s", filename, numpes, nodesize, tag, gNAMDBinaryName);
1524 
1525  FILE *fp = fopen(fname, "w");
1526  if(fp == NULL) {
1527  NAMD_die("Error in outputing PatchMap and ComputeMap info!\n");
1528  return;
1529  }
1530  PatchMap *pMap = PatchMap::Object();
1531  ComputeMap *cMap = ComputeMap::Object();
1532  int numPatches = pMap->numPatches();
1533  int numComputes = cMap->numComputes();
1534  fprintf(fp, "%d %d %d %d %d %d %d\n", numpes, nodesize, numPatches, numComputes,
1535  pMap->gridsize_a(), pMap->gridsize_b(), pMap->gridsize_c());
1536  //output PatchMap info
1537  for(int i=0; i<numPatches; i++) {
1538  #ifdef MEM_OPT_VERSION
1539  fprintf(fp, "%d %d\n", pMap->numAtoms(i), pMap->node(i));
1540  #else
1541  fprintf(fp, "%d %d\n", pMap->patch(i)->getNumAtoms(), pMap->node(i));
1542  #endif
1543  }
1544 
1545  //output ComputeMap info
1546  for(int i=0; i<numComputes; i++) {
1547  fprintf(fp, "%d %d %d %d\n", cMap->node(i), cMap->type(i), cMap->pid(i,0), cMap->pid(i,1));
1548  }
1549 }
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
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const 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__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
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
void NAMD_die(const char *err_msg)
Definition: common.C:83
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 1417 of file Node.C.

References curMFlopStep.

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

Definition at line 1317 of file Node.C.

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

Referenced by recvCheckpointCAck_handler().

1317  {
1318  state->controller->recvCheckpointAck(msg->checkpoint);
1319  delete msg;
1320 }
Controller::checkpoint checkpoint
Definition: Node.C:88
NamdState * state
Definition: Node.h:181
void recvCheckpointAck(checkpoint &cp)
Definition: Controller.C:4108
void Node::recvCheckpointReq ( CheckpointMsg msg)

Definition at line 1295 of file Node.C.

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

Referenced by recvCheckpointCReq_handler().

1295  {
1296  state->controller->recvCheckpointReq(msg->key,msg->task,msg->checkpoint);
1297 
1298  int remote = msg->replica;
1299  msg->replica = CmiMyPartition();
1300  envelope *env = UsrToEnv(CheckpointMsg::pack(msg));
1301  CmiSetHandler(env,recvCheckpointCAck_index);
1302 #if CMK_HAS_PARTITION
1303  CmiInterSyncSendAndFree(CkMyPe(),remote,env->getTotalsize(),(char*)env);
1304 #else
1305  CmiSyncSendAndFree(CkMyPe(),env->getTotalsize(),(char*)env);
1306 #endif
1307 }
void recvCheckpointReq(const char *key, int task, checkpoint &cp)
Definition: Controller.C:4078
int task
Definition: Node.C:86
int replica
Definition: Node.C:87
Controller::checkpoint checkpoint
Definition: Node.C:88
NamdState * state
Definition: Node.h:181
char * key
Definition: Node.C:89
void Node::recvEnableEarlyExit ( void  )

Definition at line 1352 of file Node.C.

References enableEarlyExit().

1352  {
1353  enableEarlyExit();
1354 }
void enableEarlyExit(void)
Definition: Node.C:1356
void Node::recvEnableExitScheduler ( void  )

Definition at line 1329 of file Node.C.

References enableExitScheduler().

1329  {
1330  //CmiPrintf("recvEnableExitScheduler\n");
1332 }
void enableExitScheduler(void)
Definition: Node.C:1334
void Node::reloadCharges ( const char *  filename)

Definition at line 1144 of file Node.C.

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

1144  {
1145  FILE *file = fopen(filename,"r");
1146  if ( ! file ) NAMD_die("node::reloadCharges():Error opening charge file.");
1147 
1148  int n = molecule->numAtoms;
1149  float *charge = new float[n];
1150 
1151  for ( int i = 0; i < n; ++i ) {
1152  if ( ! fscanf(file,"%f",&charge[i]) )
1153  NAMD_die("Node::reloadCharges():Not enough numbers in charge file.");
1154  }
1155 
1156  fclose(file);
1157  CProxy_Node(thisgroup).reloadCharges(charge,n);
1158  delete [] charge;
1159 }
int numAtoms
Definition: Molecule.h:556
void NAMD_die(const char *err_msg)
Definition: common.C:83
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 1161 of file Node.C.

References molecule, and Molecule::reloadCharges().

1161  {
1163 }
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 1167 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.

1167  {
1168  DebugM(4, "reloadGridforceGrid(const char*) called on node " << CkMyPe() << "\n" << endi);
1169 
1170  int gridnum;
1171  MGridforceParams *mgridParams;
1172  if (key == NULL) {
1175  } else {
1176  gridnum = simParameters->mgridforcelist.index_for_key(key);
1177  mgridParams = simParameters->mgridforcelist.find_key(key);
1178  }
1179 
1180  if (gridnum < 0 || mgridParams == NULL) {
1181  NAMD_die("Node::reloadGridforceGrid(const char*):Could not find grid.");
1182  }
1183 
1184  GridforceGrid *grid = molecule->get_gridfrc_grid(gridnum);
1185  if (grid == NULL) {
1186  NAMD_bug("Node::reloadGridforceGrid(const char*):grid not found");
1187  }
1188  grid->reinitialize(simParameters, mgridParams);
1189 
1190  CProxy_Node(thisgroup).reloadGridforceGrid(gridnum);
1191 
1192  DebugM(4, "reloadGridforceGrid(const char*) finished\n" << endi);
1193 }
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
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:123
#define MGRIDFORCEPARAMS_DEFAULTKEY
MGridforceParams * find_key(const char *key)
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1276
void NAMD_die(const char *err_msg)
Definition: common.C:83
MGridforceParamsList mgridforcelist
infostream & endi(infostream &s)
Definition: InfoStream.C:38
Molecule * molecule
Definition: Node.h:176
void Node::reloadGridforceGrid ( int  gridnum)

Definition at line 1236 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().

1236  {
1237  if (CmiMyRank()) return;
1238  DebugM(4, "reloadGridforceGrid(int) called on node " << CkMyPe() << "\n" << endi);
1239 
1240  GridforceGrid *grid = molecule->get_gridfrc_grid(gridnum);
1241  if (grid == NULL) {
1242  NAMD_bug("Node::reloadGridforceGrid(int):grid not found");
1243  }
1244 
1245  if (CkMyPe()) {
1246  // not node 0 -> receive grid
1247  DebugM(4, "Receiving grid\n");
1248 
1249  delete grid;
1250 
1251  MIStream *msg = CkpvAccess(comm)->newInputStream(0, GRIDFORCEGRIDTAG);
1252  grid = GridforceGrid::unpack_grid(gridnum, msg);
1253  molecule->set_gridfrc_grid(gridnum, grid);
1254  delete msg;
1255  } else {
1256  // node 0 -> send grid
1257  DebugM(4, "Sending grid\n");
1258 
1259  MOStream *msg = CkpvAccess(comm)->newOutputStream(ALLBUTME, GRIDFORCEGRIDTAG, BUFSIZE);
1260  GridforceGrid::pack_grid(grid, msg);
1261  msg->end();
1262  delete msg;
1263  }
1264 
1265  DebugM(4, "reloadGridforceGrid(int) finished\n" << endi);
1266 }
#define GRIDFORCEGRIDTAG
Definition: common.h:156
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
#define ALLBUTME
Definition: Communicate.h:14
void NAMD_bug(const char *err_msg)
Definition: common.C:123
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1276
#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:1285
infostream & endi(infostream &s)
Definition: InfoStream.C:38
Molecule * molecule
Definition: Node.h:176
void Node::reloadStructure ( const char *  fname,
const char *  pdbname 
)

Definition at line 998 of file Node.C.

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

998  {
999  delete molecule;
1000  molecule = state->molecule = 0;
1001  delete pdb;
1002  pdb = state->pdb = 0;
1003  state->loadStructure(fname,pdbname,1);
1004  this->molecule = state->molecule;
1005  this->pdb = state->pdb;
1006  CProxy_Node nodeProxy(thisgroup);
1007  nodeProxy.resendMolecule();
1008 }
int loadStructure(const char *, const char *, int)
Definition: NamdState.C:152
NamdState * state
Definition: Node.h:181
PDB * pdb
Definition: Node.h:180
Molecule * molecule
Definition: Node.h:176
void Node::resendMolecule ( )

Definition at line 1011 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.

1011  {
1012  if ( CmiMyRank() ) {
1013  return;
1014  }
1015  if ( CmiMyPe() == 0 ) {
1016  int bufSize = BUFSIZE;
1017  MOStream *conv_msg;
1018  conv_msg = CkpvAccess(comm)->newOutputStream(ALLBUTME, STATICPARAMSTAG, bufSize);
1019  parameters->send_Parameters(conv_msg);
1020  if(molecule->numAtoms>=1000000) bufSize = 16*BUFSIZE;
1021  conv_msg = CkpvAccess(comm)->newOutputStream(ALLBUTME, MOLECULETAG, bufSize);
1022  molecule->send_Molecule(conv_msg);
1023  } else {
1024  MIStream *conv_msg;
1025  delete parameters;
1026  parameters = new Parameters;
1027  conv_msg = CkpvAccess(comm)->newInputStream(0, STATICPARAMSTAG);
1028  parameters->receive_Parameters(conv_msg);
1029  delete molecule;
1031  conv_msg = CkpvAccess(comm)->newInputStream(0, MOLECULETAG);
1032  molecule->receive_Molecule(conv_msg);
1033  }
1039  CProxy_Node nodeProxy(thisgroup);
1040  for ( int i=0; i<CmiMyNodeSize(); ++i ) {
1041  nodeProxy[CmiMyPe()+i].resendMolecule2();
1042  }
1043 }
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:151
Molecule * node_molecule
Definition: Node.C:424
void sendBuildCudaExclusions()
Definition: ComputeMgr.C:1448
static void pme_select()
int numAtoms
Definition: Molecule.h:556
#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:423
#define MOLECULETAG
Definition: common.h:152
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 1045 of file Node.C.

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

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

Definition at line 1469 of file Node.C.

References curMFlopStep, simParameters, and state.

1469  {
1470 #ifdef MEASURE_NAMD_WITH_PAPI
1471 
1472  if(simParameters->papiMeasureStartStep != curMFlopStep) {
1473  double *results = (double *)msg->getData();
1474  double endtime=CmiWallTimer();
1475  int bstep = simParameters->papiMeasureStartStep;
1476  int estep = bstep + simParameters->numPapiMeasureSteps;
1477 #if MEASURE_PAPI_SPP
1478  CkPrintf("SPP INFO: PAPI_FP_OPS timestep %d to %d is %lf(1e6)\n", bstep,estep,results[0]);
1479  CkPrintf("SPP INFO: PAPI_TOT_INS timestep %d to %d is %lf(1e6)\n", bstep,estep,results[1]);
1480  CkPrintf("SPP INFO: perf::PERF_COUNT_HW_CACHE_LL:MISS timestep %d to %d is %lf(1e6)\n", bstep,estep,results[2]);
1481  CkPrintf("SPP INFO: DATA_PREFETCHER:ALL timestep %d to %d is %lf(1e6)\n", bstep,estep,results[3]);
1482  CkPrintf("SPP INFO: PAPI_L1_DCA timestep %d to %d is %lf(1e6)\n", bstep,estep,results[4]);
1483  CkPrintf("SPP INFO: PAPI_TOT_CYC timestep %d to % is %lf(1e6)\n", bstep,estep,results[5]);
1484  // CkPrintf("SPP INFO: INSTRUCTION_FETCH_STALL timestep %d to %d is %lf(1e6)\n", bstep,estep,results[6]);
1485  // CkPrintf("SPP INFO: WALLtime timestep %d to %d is %lf\n", bstep,estep,endtime-results[NUM_PAPI_EVENTS]/CkNumPes());
1486  CkPrintf("SPP INFO: WALLtime timestep %d to %d is %lf\n", bstep,estep,endtime-results[NUM_PAPI_EVENTS]);
1487  CkPrintf("SPP INFO: endtime %lf avgtime %lf tottime %lf\n", endtime,results[NUM_PAPI_EVENTS]/CkNumPes(),results[NUM_PAPI_EVENTS] );
1488 #else
1489  if(CkpvAccess(papiEvents)[0] == PAPI_FP_INS){
1490  double totalFPIns = results[0];
1491  if(CkpvAccess(papiEvents)[1] == PAPI_FMA_INS) totalFPIns += (results[1]*2);
1492  CkPrintf("FLOPS INFO: from timestep %d to %d, the total FP instruction of NAMD is %lf(x1e6) per processor\n",
1493  bstep, estep, totalFPIns/CkNumPes());
1494  }else{
1495  char nameBuf[PAPI_MAX_STR_LEN];
1496  CkPrintf("PAPI COUNTERS INFO: from timestep %d to %d, ",
1497  bstep, estep);
1498  for(int i=0; i<NUM_PAPI_EVENTS; i++) {
1499  PAPI_event_code_to_name(CkpvAccess(papiEvents)[i], nameBuf);
1500  CkPrintf("%s is %lf(x1e6), ", nameBuf, results[i]/CkNumPes());
1501  }
1502  CkPrintf("per processor\n");
1503  }
1504 #endif
1505  }
1506  delete msg;
1507  state->controller->resumeAfterPapiMeasureBarrier(curMFlopStep);
1508 #endif
1509 }
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 1411 of file Node.C.

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

1411  {
1412  CmiAssert(CmiMyPe()==0);
1413  delete msg;
1415 }
int curTimeStep
Definition: Node.h:151
NamdState * state
Definition: Node.h:181
void resumeAfterTraceBarrier(int)
Definition: Controller.C:4148
void Node::run ( void  )

Definition at line 1096 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().

1097 {
1098  // Start Controller (aka scalar Sequencer) on Pe(0)
1099 // printf("\n\n I am in Node.C in run method about to call state->runController\n\n");
1100  if ( ! CkMyPe() ) {
1101  state->runController();
1102  }
1103 
1104  DebugM(4, "Starting Sequencers\n");
1105  // Run Sequencer on each HomePatch - i.e. start simulation
1108  for (ai=ai.begin(); ai != ai.end(); ai++) {
1109  HomePatch *patch = (*ai).patch;
1110 //CkPrintf("Proc#%d in Node calling Sequencer ",CkMyPe());
1111  patch->runSequencer();
1112  }
1113 
1114  if (!CkMyPe()) {
1115  double newTime = CmiWallTimer();
1116  iout << iINFO << "Startup phase " << startupPhase-1 << " took "
1117  << newTime - startupTime << " s, "
1118  << memusage_MB() << " MB of memory in use\n";
1119  iout << iINFO << "Finished startup at " << newTime << " s, "
1120  << memusage_MB() << " MB of memory in use\n\n" << endi;
1121  fflush(stdout);
1122  }
1123 
1124 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:107
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:286
HomePatchList * homePatchList()
Definition: PatchMap.C:438
#define iout
Definition: InfoStream.h:87
void runController(void)
Definition: NamdState.C:79
double memusage_MB()
Definition: memusage.h:13
NamdState * state
Definition: Node.h:181
infostream & endi(infostream &s)
Definition: InfoStream.C:38
void Node::saveMolDataPointers ( NamdState state)

Definition at line 1372 of file Node.C.

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

1373 {
1374  this->molecule = state->molecule;
1375  this->parameters = state->parameters;
1376  this->simParameters = state->simParameters;
1377  this->configList = state->configList;
1378  this->pdb = state->pdb;
1379  this->state = state;
1380 }
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 1135 of file Node.C.

1135  {
1136  //script->awaken();
1137 }
void Node::scriptParam ( ScriptParamMsg msg)

Definition at line 1139 of file Node.C.

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

1139  {
1140  simParameters->scriptSet(msg->param,msg->value);
1141  delete msg;
1142 }
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 1271 of file Node.C.

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

Referenced by Controller::algorithm().

1271  {
1272  CheckpointMsg *msg = new (1+strlen(key),0) CheckpointMsg;
1273  msg->replica = CmiMyPartition();
1274  msg->task = task;
1275  msg->checkpoint.lattice = lat;
1276  msg->checkpoint.state = cs;
1277  strcpy(msg->key,key);
1278  envelope *env = UsrToEnv(CheckpointMsg::pack(msg));
1279  CmiSetHandler(env,recvCheckpointCReq_index);
1280 #if CMK_HAS_PARTITION
1281  CmiInterSyncSendAndFree(CkMyPe(),remote,env->getTotalsize(),(char*)env);
1282 #else
1283  CmiSyncSendAndFree(CkMyPe(),env->getTotalsize(),(char*)env);
1284 #endif
1285 }
ControllerState state
Definition: Controller.h:274
int task
Definition: Node.C:86
int replica
Definition: Node.C:87
Controller::checkpoint checkpoint
Definition: Node.C:88
char * key
Definition: Node.C:89
void Node::sendEnableEarlyExit ( void  )

Definition at line 1347 of file Node.C.

Referenced by enableEarlyExit().

1347  {
1348  CProxy_Node nodeProxy(thisgroup);
1349  nodeProxy[0].recvEnableEarlyExit();
1350 }
void Node::sendEnableExitScheduler ( void  )

Definition at line 1323 of file Node.C.

Referenced by enableExitScheduler().

1323  {
1324  //CmiPrintf("sendEnableExitScheduler\n");
1325  CProxy_Node nodeProxy(thisgroup);
1326  nodeProxy[0].recvEnableExitScheduler();
1327 }
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 1383 of file Node.C.

1383  {
1384 #if USE_HPM
1385  HPM_Start("500 steps", localRankOnNode);
1386 #endif
1387 }
void Node::startup ( )

Definition at line 428 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(), 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().

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

Definition at line 1389 of file Node.C.

1389  {
1390 #if USE_HPM
1391  HPM_Stop("500 steps", localRankOnNode);
1392  HPM_Print(CkMyPe(), localRankOnNode);
1393 #endif
1394 }
void Node::traceBarrier ( int  turnOnTrace,
int  step 
)

Definition at line 1396 of file Node.C.

References curTimeStep.

1396  {
1397  curTimeStep = step;
1398  if(turnOnTrace) traceBegin();
1399  else traceEnd();
1400 
1401  if(turnOnTrace) CmiTurnOnStats();
1402  else CmiTurnOffStats();
1403 
1404  //CkPrintf("traceBarrier (%d) at step %d called on proc %d\n", turnOnTrace, step, CkMyPe());
1405  CProxy_Node nd(CkpvAccess(BOCclass_group).node);
1406  CkCallback cb(CkIndex_Node::resumeAfterTraceBarrier(NULL), nd[0]);
1407  contribute(0, NULL, CkReduction::sum_int, cb);
1408 
1409 }
int curTimeStep
Definition: Node.h:151
void Node::updateGridScale ( const char *  key,
Vector  scale 
)

Definition at line 1195 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.

1195  {
1196  DebugM(4, "updateGridScale(char*, Vector) called on node " << CkMyPe() << "\n" << endi);
1197 
1198  int gridnum;
1199  MGridforceParams* mgridParams;
1200  if (key == NULL) {
1203  } else {
1204  gridnum = simParameters->mgridforcelist.index_for_key(key);
1205  mgridParams = simParameters->mgridforcelist.find_key(key);
1206  }
1207 
1208  if (gridnum < 0 || mgridParams == NULL) {
1209  NAMD_die("Node::updateGridScale(char*, Vector): Could not find grid.");
1210  }
1211 
1212  GridforceGrid* grid = molecule->get_gridfrc_grid(gridnum);
1213  if (grid == NULL) {
1214  NAMD_bug("Node::updateGridScale(char*, Vector): grid not found");
1215  }
1216  CProxy_Node(thisgroup).updateGridScale(gridnum, scale.x, scale.y, scale.z);
1217 
1218  DebugM(4, "updateGridScale(char*, Vector) finished\n" << endi);
1219 }
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
BigReal z
Definition: Vector.h:66
int index_for_key(const char *key)
void NAMD_bug(const char *err_msg)
Definition: common.C:123
#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:1276
void NAMD_die(const char *err_msg)
Definition: common.C:83
MGridforceParamsList mgridforcelist
BigReal y
Definition: Vector.h:66
infostream & endi(infostream &s)
Definition: InfoStream.C:38
Molecule * molecule
Definition: Node.h:176
void Node::updateGridScale ( int  gridnum,
float  sx,
float  sy,
float  sz 
)

Definition at line 1220 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.

1220  {
1221  if (CmiMyRank()) return;
1222  DebugM(4, "updateGridScale(char*, int, float, float, float) called on node " << CkMyPe() << "\n" << endi);
1223 
1224  GridforceGrid *grid = molecule->get_gridfrc_grid(gridnum);
1225  if (grid == NULL) {
1226  NAMD_bug("Node::updateGridScale(char*, int, float, float, float):grid not found");
1227  }
1228 
1229  Vector scale(sx,sy,sz);
1231  grid->set_scale( scale );
1232 
1233  DebugM(4, "updateGridScale(char*, int, float, float, float) finished\n" << endi);
1234 }
Definition: Vector.h:64
SimParameters * simParameters
Definition: Node.h:178
#define DebugM(x, y)
Definition: Debug.h:59
void NAMD_bug(const char *err_msg)
Definition: common.C:123
GridforceGrid * get_gridfrc_grid(int gridnum) const
Definition: Molecule.h:1276
MGridforceParamsList mgridforcelist
infostream & endi(infostream &s)
Definition: InfoStream.C:38
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: