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 // Made public for pmeAid; 00127 WorkDistrib *workDistrib; 00128 00129 // Made public in order to access the ComputeGlobal on the node 00130 ComputeMgr *computeMgr; 00131 00132 // NAMD 1.X molecule database objects - must be public for now 00133 Molecule *molecule; 00134 Parameters *parameters; 00135 SimParameters *simParameters; 00136 ConfigList *configList; 00137 PDB *pdb; 00138 NamdState *state; 00139 Output *output; 00140 IMDOutput *imd; 00141 Vector *coords; // Only exists during measure from Tcl 00142 00143 #ifdef CHARMIZE_NAMD 00144 CProxy_AtomsDisInfo atomDisArr; 00145 #endif 00146 00147 00148 // Remove these calls? 00149 int myid() { return CkMyPe(); } 00150 int numNodes() { return CkNumPes(); } 00151 00152 void setScript(ScriptTcl *s) { script = s; } 00153 ScriptTcl *getScript(void) { return script; } 00154 00155 protected: 00156 // Map Databases - they have a singleton this access method ::Object() 00157 AtomMap *atomMap; 00158 PatchMap *patchMap; 00159 ComputeMap *computeMap; 00160 LdbCoordinator *ldbCoordinator; 00161 00162 private: 00163 #ifdef CHARMIZE_NAMD 00164 void populateAtomDisArrs(int startupPhase); 00165 #endif 00166 00167 void namdOneCommInit(); 00168 void namdOneRecv(); 00169 void namdOneSend(); 00170 void threadInit(); 00171 void buildSequencers(); 00172 00173 PatchMgr *patchMgr; 00174 ProxyMgr *proxyMgr; 00175 Namd *namd; 00176 ScriptTcl *script; 00177 00178 // Startup phase 00179 int startupPhase; 00180 }; 00181 00182 #endif /* _NODE_H */ 00183
1.3.9.1