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

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 #ifdef CHARMIZE_NAMD
00021 #include "AtomsDisInfo.h"
00022 #endif
00023 
00024 #ifdef SOLARIS
00025 extern "C" int gethostname( char *name, int namelen);
00026 #endif
00027 
00028 #include "ProcessorPrivate.h"
00029 #include "Node.decl.h"
00030 
00031 class PatchMap;
00032 class AtomMap;
00033 class ProxyMgr;
00034 class ComputeMap;
00035 class PatchMgr;
00036 class Molecule;
00037 class Parameters;
00038 class SimParameters;
00039 class ConfigList;
00040 class PDB;
00041 class WorkDistrib;
00042 class PatchMgr;
00043 class ComputeMgr;
00044 class Communicate;
00045 class Namd;
00046 class NamdState;
00047 class Output;
00048 class LdbCoordinator;
00049 class ScriptTcl;
00050 class IMDOutput;
00051 class Vector;
00052 
00053 // Message to send our per processor BOC's list of groupIDs of
00054 // all other BOC's
00055 class GroupInitMsg : public CMessage_GroupInitMsg
00056 {
00057 public:
00058   BOCgroup group;
00059 };
00060 
00061 class AllCharmArrsMsg : public CMessage_AllCharmArrsMsg
00062 {
00063 #ifdef CHARMIZE_NAMD
00064 public:
00065   CProxy_AtomsDisInfo atomsDis;
00066 #endif
00067 };
00068 
00069 #define MAX_SCRIPT_PARAM_SIZE 128
00070 class ScriptParamMsg : public CMessage_ScriptParamMsg {
00071 public:
00072   char param[MAX_SCRIPT_PARAM_SIZE];
00073   char value[MAX_SCRIPT_PARAM_SIZE];
00074 };
00075 
00076 class Node : public BOCclass
00077 {
00078 public:
00079 
00080   Node(GroupInitMsg *msg);
00081   ~Node(void);
00082 
00083   // Singleton Access method
00084   inline static Node *Object() {return CkpvAccess(Node_instance);}
00085 
00086   // Run for the number of steps specified in the sim_parameters
00087   static void messageRun();
00088   void run();                  
00089 
00090   // Change parameters in mid-run
00091   void enableScriptBarrier();  
00092   void scriptBarrier(CkQdMsg *);  
00093   void scriptParam(ScriptParamMsg *);
00094 
00095   void reloadCharges(const char *filename);
00096   void reloadCharges(float charge[], int n);
00097 
00098   void sendEnableExitScheduler(void);
00099   void recvEnableExitScheduler(CkQdMsg *);
00100   void enableExitScheduler(void);
00101   void exitScheduler(CkQdMsg *);
00102 
00103   void sendEnableEarlyExit(void);
00104   void recvEnableEarlyExit(CkQdMsg *);
00105   void enableEarlyExit(void);
00106   void earlyExit(CkQdMsg *);
00107 
00108   // Charm Entry point - Read in system data, get all ready to simulate
00109   static void messageStartUp();
00110   void startup();  
00111   void startUp(CkQdMsg *);  
00112 
00113   // Charm Entry point - synchronize on BOC creation and startup
00114   static void messageBOCCheckIn();
00115   void BOCCheckIn();
00116   void awaitBOCCheckIn();
00117 
00118   // Utility for storing away simulation data for Node
00119   void saveMolDataPointers(NamdState *);
00120 
00121   //#ifdef CHARMIZE_NAMD  
00122   //It is an entry method which has to be declared
00123   void sendCharmArrProxies(AllCharmArrsMsg *msg);
00124   //#endif
00125 
00126   // entry methods for BG/P HPM (performance counters) library
00127   void startHPM();
00128   void stopHPM();
00129 
00130   // Made public for pmeAid;
00131   WorkDistrib *workDistrib;
00132 
00133   // Made public in order to access the ComputeGlobal on the node
00134   ComputeMgr *computeMgr;
00135   
00136   // NAMD 1.X molecule database objects - must be public for now
00137   Molecule *molecule;
00138   Parameters *parameters;
00139   SimParameters *simParameters;
00140   ConfigList *configList;
00141   PDB *pdb;
00142   NamdState *state;
00143   Output *output;
00144   IMDOutput *imd;
00145   Vector *coords;  // Only exists during measure from Tcl
00146 
00147   #ifdef CHARMIZE_NAMD
00148   CProxy_AtomsDisInfo atomDisArr;
00149   #endif
00150 
00151 
00152   // Remove these calls?
00153   int myid() { return CkMyPe(); }
00154   int numNodes() { return CkNumPes(); }
00155 
00156   void setScript(ScriptTcl *s) { script = s; }
00157   ScriptTcl *getScript(void) { return script; }
00158 
00159 protected:
00160   // Map Databases - they have a singleton this access method ::Object()
00161   AtomMap    *atomMap;
00162   PatchMap   *patchMap;
00163   ComputeMap *computeMap;
00164   LdbCoordinator *ldbCoordinator;
00165 
00166 private:
00167   #ifdef CHARMIZE_NAMD  
00168   void populateAtomDisArrs(int startupPhase);
00169   #endif
00170   
00171   void namdOneCommInit();
00172   void namdOneRecv();
00173   void namdOneSend();
00174   void threadInit();
00175   void buildSequencers();
00176 
00177   PatchMgr *patchMgr;
00178   ProxyMgr *proxyMgr;
00179   Namd *namd;
00180   ScriptTcl *script;
00181 
00182   // Startup phase
00183   int startupPhase;
00184   int localRankOnNode;
00185 };
00186 
00187 #endif /* _NODE_H */
00188 

Generated on Sat Nov 7 04:07:48 2009 for NAMD by  doxygen 1.3.9.1