Node.h

Go to the documentation of this file.
00001 
00007 /*
00008    Master BOC.  coordinates startup, close down of each PE
00009    Also owns pointers to common objects needed by system                
00010    Many utility static methods are owned by Node.
00011 */
00012 
00013 #ifndef _NODE_H
00014 #define _NODE_H
00015 
00016 #include "charm++.h"
00017 
00018 #include "main.h"
00019 
00020 // BEGIN LA
00021 class Random;
00022 // END LA
00023 
00024 #ifdef SOLARIS
00025 extern "C" int gethostname( char *name, int namelen);
00026 #endif
00027 
00028 class Vector;
00029 
00030 #include "ProcessorPrivate.h"
00031 #include "Node.decl.h"
00032 
00033 class PatchMap;
00034 class AtomMap;
00035 class ProxyMgr;
00036 class ComputeMap;
00037 class PatchMgr;
00038 class Molecule;
00039 class Parameters;
00040 class SimParameters;
00041 class ConfigList;
00042 class PDB;
00043 class WorkDistrib;
00044 class PatchMgr;
00045 class ComputeMgr;
00046 class Communicate;
00047 class Namd;
00048 class NamdState;
00049 class Output;
00050 class LdbCoordinator;
00051 class ScriptTcl;
00052 class IMDOutput;
00053 class Vector;
00054 class colvarmodule;
00055 class CheckpointMsg;
00056 class Lattice;
00057 class ControllerState;
00058 
00059 #ifdef MEM_OPT_VERSION
00060 class ParallelIOMgr;
00061 #endif
00062 
00063 // Message to send our per processor BOC's list of groupIDs of
00064 // all other BOC's
00065 class GroupInitMsg : public CMessage_GroupInitMsg
00066 {
00067 public:
00068   BOCgroup group;
00069 };
00070 
00071 #define MAX_SCRIPT_PARAM_SIZE 128
00072 class ScriptParamMsg : public CMessage_ScriptParamMsg {
00073 public:
00074   char param[MAX_SCRIPT_PARAM_SIZE];
00075   char value[MAX_SCRIPT_PARAM_SIZE];
00076 };
00077 
00078 class Node : public CBase_Node
00079 {
00080 public:
00081 
00082   Node(GroupInitMsg *msg);
00083   ~Node(void);
00084 
00085   // Singleton Access method
00086   inline static Node *Object() {return CkpvAccess(Node_instance);}
00087 
00088   // Run for the number of steps specified in the sim_parameters
00089   static void messageRun();
00090   void run();                  
00091 
00092   // Change parameters in mid-run
00093   void enableScriptBarrier();  
00094   void scriptBarrier(CkQdMsg *);  
00095   void scriptParam(ScriptParamMsg *);
00096 
00097   void reloadCharges(const char *filename);
00098   void reloadCharges(float charge[], int n);
00099 
00100   void reloadGridforceGrid(const char *key);
00101   void reloadGridforceGrid(int gridnum);
00102   void updateGridScale(char* key, Vector scale);
00103   void updateGridScale(int gridnum, float sx, float sy, float sz);
00104 
00105   void reloadStructure(const char *, const char *);
00106   void resendMolecule();
00107   void resendMolecule2();
00108 
00109   void sendCheckpointReq(int remote, const char *key, int task, Lattice &lat, ControllerState &cs);
00110   void recvCheckpointReq(CheckpointMsg*);
00111   void recvCheckpointAck(CheckpointMsg*);
00112   
00113   void sendEnableExitScheduler(void);
00114   void recvEnableExitScheduler(CkQdMsg *);
00115   void enableExitScheduler(void);
00116   void exitScheduler(CkQdMsg *);
00117 
00118   void sendEnableEarlyExit(void);
00119   void recvEnableEarlyExit(CkQdMsg *);
00120   void enableEarlyExit(void);
00121   void earlyExit(CkQdMsg *);
00122 
00123   // Charm Entry point - Read in system data, get all ready to simulate
00124   static void messageStartUp();
00125   void startup();  
00126   void startUp(CkQdMsg *);
00127 
00128   void mallocTest(int);
00129   void mallocTestQd(CkQdMsg *);
00130   int mallocTest_size;
00131   
00132 #ifdef MEM_OPT_VERSION
00133   ParallelIOMgr *ioMgr;
00134 #endif
00135 
00136   float initVM, initRSS;
00137   float measureMemory();
00138 
00139   // Charm Entry point - synchronize on BOC creation and startup
00140   static void messageBOCCheckIn();
00141   void BOCCheckIn();
00142   void awaitBOCCheckIn();
00143 
00144   // Utility for storing away simulation data for Node
00145   void saveMolDataPointers(NamdState *);
00146 
00147   // entry methods for BG/P HPM (performance counters) library
00148   void startHPM();
00149   void stopHPM();
00150   
00151   //entry methods for trace barriers
00152   int curTimeStep;
00153   void traceBarrier(int turnOnTrace, int step);
00154   void resumeAfterTraceBarrier(CkReductionMsg *msg);
00155 
00156   //entry methods for measuring flops barriers
00157   int curMFlopStep;
00158   void papiMeasureBarrier(int turnOnMeasure, int step);
00159   void resumeAfterPapiMeasureBarrier(CkReductionMsg *msg);
00160   
00161   void outputPatchComputeMaps(const char *filename, int tag);
00162 
00163   //to show whether +traceoff is specified
00164   bool specialTracing;
00165   
00166   // Made public for pmeAid;
00167   WorkDistrib *workDistrib;
00168 
00169   // Made public in order to access the ComputeGlobal on the node
00170   ComputeMgr *computeMgr;
00171   
00172   // BEGIN LA
00173   Random *rand;
00174   // END LA
00175   
00176   // NAMD 1.X molecule database objects - must be public for now
00177   Molecule *molecule;
00178   Parameters *parameters;
00179   SimParameters *simParameters;
00180   ConfigList *configList;
00181   PDB *pdb;
00182   NamdState *state;
00183   Output *output;
00184   IMDOutput *imd;
00185   colvarmodule *colvars;
00186   Vector *coords;  // Only exists during measure from Tcl
00187 
00188   // Remove these calls?
00189   int myid() { return CkMyPe(); }
00190   int numNodes() { return CkNumPes(); }
00191 
00192   void setScript(ScriptTcl *s) { script = s; }
00193   ScriptTcl *getScript(void) { return script; } 
00194 
00195 #ifdef OPENATOM_VERSION
00196   doneMoaStart();
00197 #endif //OPENATOM_VERSION
00198 
00199   protected:
00200   // Map Databases - they have a singleton this access method ::Object()
00201   AtomMap    *atomMap;
00202   PatchMap   *patchMap;
00203   ComputeMap *computeMap;
00204   LdbCoordinator *ldbCoordinator;
00205 
00206 private:  
00207   void bindBocVars();
00208 
00209   void namdOneCommInit();
00210   void namdOneRecv();
00211   void namdOneSend();
00212   void threadInit();
00213   void buildSequencers();
00214 
00215   PatchMgr *patchMgr;
00216   ProxyMgr *proxyMgr;
00217   Namd *namd;
00218   ScriptTcl *script;
00219 
00220   // Startup phase
00221   int startupPhase;
00222   int localRankOnNode;
00223 #ifdef CMK_BALANCED_INJECTION_API
00224   int balancedInjectionLevel;
00225 #endif
00226 
00227   int recvCheckpointCReq_index;
00228   int recvCheckpointCAck_index;
00229 };
00230 
00231 #endif /* _NODE_H */
00232 

Generated on Thu Nov 23 01:17:13 2017 for NAMD by  doxygen 1.4.7