Moving the "critical path" history code into its own module which is included in...
authorIsaac Dooley <idooley2@illinois.edu>
Mon, 20 Jul 2009 21:42:00 +0000 (21:42 +0000)
committerIsaac Dooley <idooley2@illinois.edu>
Mon, 20 Jul 2009 21:42:00 +0000 (21:42 +0000)
src/ck-core/init.C
src/ck-cp/controlPoints.C
src/ck-cp/controlPoints.ci
src/ck-cp/controlPoints.h
src/ck-cp/pathHistory.C
src/ck-cp/pathHistory.ci [new file with mode: 0644]
src/ck-cp/pathHistory.h
src/scripts/Make.depends
src/scripts/Makefile

index b644756dc7ebe610182838b78b836ed6768135c3..da1bec0c59205262f1d3daf0b9e39a71d7cef32b 100644 (file)
@@ -645,6 +645,7 @@ static void _nullFn(void *, void *)
 }
 
 extern void _registerLBDatabase(void);
+extern void _registerPathHistory(void);
 extern void _registerExternalModules(char **argv);
 extern void _ckModuleInit(void);
 extern void _loadbalancerInit();
@@ -856,6 +857,8 @@ void _initCharm(int unused_argc, char **argv)
                _registerCkMemCheckpoint();
 #endif
                
+               _registerPathHistory();
+
                /**
                  _registerExternalModules is actually generated by 
                  charmc at link time (as "moduleinit<pid>.C").  
index a77a2b518bc001e16f5b1d0a4a10acfbc7c4821e..d32ecc02f079f370be309a4f11ae1960d80c65be 100644 (file)
@@ -99,9 +99,6 @@ unsigned int randInt(unsigned int num, const char* name, int seed=0){
 
 
 controlPointManager::controlPointManager(){
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-    pathHistoryTableLastIdx = 0;
-#endif
 
     newControlPointsAvailable = false;
     alreadyRequestedMemoryUsage = false;   
@@ -116,8 +113,6 @@ controlPointManager::controlPointManager(){
     
     phase_id = 0;
     
-    controlPointManagerProxy = thisProxy;
-    
     loadDataFile();
     
     if(allData.phases.size()>0){
@@ -612,126 +607,6 @@ controlPointManager::controlPointManager(){
   }
 
 
-  /** Trace perform a traversal backwards over the critical path specified as a 
-      table index for the processor upon which this is called.
-      
-      The callback cb will be called with the resulting msg after the path has 
-      been traversed to its origin.  
-  */
- void controlPointManager::traceCriticalPathBack(pathInformationMsg *msg){
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-   int count = pathHistoryTable.count(msg->table_idx);
-#if DEBUGPRINT > 2
-   CkPrintf("Table entry %d on pe %d occurs %d times in table\n", msg->table_idx, CkMyPe(), count);
-#endif
-   CkAssert(count==0 || count==1);
-
-    if(count > 0){ 
-      PathHistoryTableEntry & path = pathHistoryTable[msg->table_idx];
-      int idx = path.sender_history_table_idx;
-      int pe = path.sender_pe;
-
-#if DEBUGPRINT > 2
-      CkPrintf("Table entry %d on pe %d points to pe=%d idx=%d\n", msg->table_idx, CkMyPe(), pe, idx);
-#endif
-
-      // Make a copy of the message for broadcasting to all PEs
-      pathInformationMsg *newmsg = new(msg->historySize+1) pathInformationMsg;
-      for(int i=0;i<msg->historySize;i++){
-       newmsg->history[i] = msg->history[i];
-      }
-      newmsg->history[msg->historySize] = path;
-      newmsg->historySize = msg->historySize+1;
-      newmsg->cb = msg->cb;
-      newmsg->table_idx = idx;
-      
-      // Keep a message for returning to the user's callback
-      pathForUser = new(msg->historySize+1) pathInformationMsg;
-      for(int i=0;i<msg->historySize;i++){
-       pathForUser->history[i] = msg->history[i];
-      }
-      pathForUser->history[msg->historySize] = path;
-      pathForUser->historySize = msg->historySize+1;
-      pathForUser->cb = msg->cb;
-      pathForUser->table_idx = idx;
-      
-      
-      if(idx > -1 && pe > -1){
-       CkAssert(pe < CkNumPes() && pe >= 0);
-       thisProxy[pe].traceCriticalPathBack(newmsg);
-      } else {
-       CkPrintf("Traced critical path back to its origin.\n");
-       CkPrintf("Broadcasting it to all PE\n");
-       thisProxy.broadcastCriticalPathResult(newmsg);
-      }
-    } else {
-      CkAbort("ERROR: Traced critical path back to a nonexistent table entry.\n");
-    }
-
-    delete msg;
-#else
-    CkAbort("Shouldn't call controlPointManager::traceCriticalPathBack when critical path detection is not enabled");
-#endif
-  }
-
-
-void controlPointManager::broadcastCriticalPathResult(pathInformationMsg *msg){
-
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-  CkPrintf("[%d] Received broadcast of critical path\n", CkMyPe());
-  int me = CkMyPe();
-  int intersectsLocalPE = false;
-
-  // Create user events for critical path
-
-  for(int i=msg->historySize-1;i>=0;i--){
-    if(CkMyPe() == msg->history[i].local_pe){
-      // Part of critical path is local
-      // Create user event for it
-
-      //      CkPrintf("\t[%d] Path Step %d: local_path_time=%lf arr=%d ep=%d starttime=%lf preceding path time=%lf pe=%d\n",CkMyPe(), i, msg->history[i].get_local_path_time(), msg-> history[i].local_arr, msg->history[i].local_ep, msg->history[i].get_start_time(), msg->history[i].get_preceding_path_time(), msg->history[i].local_pe);
-      traceUserBracketEvent(5900, msg->history[i].get_start_time(), msg->history[i].get_start_time() + msg->history[i].get_local_path_time());
-      intersectsLocalPE = true;
-    }
-
-  }
-  
-
-#if PRUNE_CRITICAL_PATH_LOGS
-  // Tell projections tracing to only output log entries if I contain part of the critical path
-  if(! intersectsLocalPE){
-    disableTraceLogOutput();
-    CkPrintf("PE %d doesn't intersect the critical path, so its log files won't be created\n", CkMyPe() );
-  }
-#endif  
-  
-#if TRACE_ALL_PATH_TABLE_ENTRIES
-  // Create user events for all table entries
-  std::map< int, PathHistoryTableEntry >::iterator iter;
-  for(iter=pathHistoryTable.begin(); iter != pathHistoryTable.end(); iter++){
-    double startTime = iter->second.get_start_time();
-    double endTime = iter->second.get_start_time() + iter->second.get_local_path_time();
-    traceUserBracketEvent(5901, startTime, endTime);
-  }
-#endif
-
-  int data=1;
-  CkCallback cb(CkIndex_controlPointManager::criticalPathDone(NULL),thisProxy[0]); 
-  contribute(sizeof(int), &data, CkReduction::sum_int, cb);
-
-#endif
-
-}
-
-void controlPointManager::criticalPathDone(CkReductionMsg *msg){
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-  CkPrintf("[%d] All PEs have received the critical path information. Sending critical path to user supplied callback.\n", CkMyPe());
-  pathForUser->cb.send(pathForUser);
-  pathForUser = NULL;
-#endif
-}
-
-
  
   /// Inform the control point framework that a named control point affects the priorities of some array  
   void controlPointManager::associatePriorityArray(const char *name, int groupIdx){
index a1110e5d97a7784d8939e8e2bfb1b9e9800d176a..f1eb3483e2753847b7407204955270b039524675 100644 (file)
@@ -7,12 +7,6 @@ module ControlPoints {
 
 
   initproc void registerIdleTimeReduction(void);       
-  initproc void initializeCriticalPath(void);  
-
-
-  message pathInformationMsg { 
-        PathHistoryTableEntry history[];
-  };
 
 
  message controlPointMsg { 
@@ -40,13 +34,6 @@ module ControlPoints {
     entry void requestIdleTime(CkCallback cb);
     entry void gatherIdleTime(CkReductionMsg *msg);
 
-//    entry void registerTerminalPath(PathHistory &path);
-
-
-     entry void traceCriticalPathBack(pathInformationMsg *msg);
-     entry void broadcastCriticalPathResult(pathInformationMsg *msg);
-     entry void criticalPathDone(CkReductionMsg *msg);
-
  }   
 
 
index 355d22fcb6efc5624f927a86ba41258c00845e40..b17dc969ef64a9d0acddce7e1d5cd5d46f63ff74 100644 (file)
@@ -29,8 +29,8 @@
 #include <float.h>
 
 #include "LBDatabase.h"
-#include "pathHistory.h"
 #include "arrayRedistributor.h"
+#include "pathHistory.h" 
 
 using namespace std;
 
@@ -517,8 +517,6 @@ public:
   instrumentedPhase thisPhaseData;
   instrumentedPhase best_phase;
   
-  pathInformationMsg *pathForUser; // A place to store the path for the user while we go about doing other things.
-
   /// The lower and upper bounds for each named control point
   std::map<string, pair<int,int> > controlPointSpace;
 
@@ -546,13 +544,6 @@ public:
   bool alreadyRequestedMemoryUsage;
   bool alreadyRequestedIdleTime;
 
-
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-  // A table of information about all the paths leading to executions of local entry methods.
-  std::map<int, PathHistoryTableEntry> pathHistoryTable;
-  int pathHistoryTableLastIdx;
-#endif
-
   controlPointManager();
      
   ~controlPointManager();
@@ -602,16 +593,7 @@ public:
   void gatherMemoryUsage(CkReductionMsg *msg);
 
 
-  /** Trace perform a traversal backwards over the critical path specified as a 
-      table index for the processor upon which this is called.
-      
-      The callback cb will be called with the resulting msg after the path has 
-      been traversed to its origin.  
-  */
- void traceCriticalPathBack(pathInformationMsg *msg);
- void broadcastCriticalPathResult(pathInformationMsg *msg);
- void criticalPathDone(CkReductionMsg *msg);
-  
+
 
 
   /// Inform the control point framework that a named control point affects the priorities of some array  
index 89466247b347917f4dbbd1c5eea2c6c6edb32feb..807878ded2fd974bb4a0210dc1e11a32450f9345 100644 (file)
@@ -7,10 +7,9 @@
 #include <vector>
 #include <utility>
 
-#include "ControlPoints.decl.h"
-#include "trace-controlPoints.h"
+#include "PathHistory.decl.h"
 #include "LBDatabase.h"
-#include "controlPoints.h"
+//#include "controlPoints.h"
 #include "pathHistory.h"
 #include "arrayRedistributor.h"
 #include <register.h> // for _entryTable
  *
  */
 
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
 
 
+/*readonly*/ CProxy_pathHistoryManager pathHistoryManagerProxy;
+
 CkpvDeclare(MergeablePathHistory, currentlyExecutingPath); // The maximal incoming path for the node
 CkpvDeclare(double, timeEntryMethodStarted);
 
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+/** A table to store all the local nodes in the parallel dependency graph */
+CkpvDeclare(PathHistoryTableType, pathHistoryTable);
+/** A counter that defines the new keys for the entries in the pathHistoryTable */
+CkpvDeclare(int, pathHistoryTableLastIdx);
+#endif
+
+
+/// A mainchare that is used just to create a group at startup
+class pathHistoryMain : public CBase_pathHistoryMain {
+public:
+  pathHistoryMain(CkArgMsg* args){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+    pathHistoryManagerProxy = CProxy_pathHistoryManager::ckNew();
+#endif
+  }
+  ~pathHistoryMain(){}
+};
+
+
+pathHistoryManager::pathHistoryManager(){
+
+}
+
+
+  /** Trace perform a traversal backwards over the critical path specified as a 
+      table index for the processor upon which this is called.
+      
+      The callback cb will be called with the resulting msg after the path has 
+      been traversed to its origin.  
+  */
+ void pathHistoryManager::traceCriticalPathBack(pathInformationMsg *msg){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+   int count = CkpvAccess(pathHistoryTable).count(msg->table_idx);
+
+#if DEBUGPRINT > 2
+   CkPrintf("Table entry %d on pe %d occurs %d times in table\n", msg->table_idx, CkMyPe(), count);
+#endif
+   CkAssert(count==0 || count==1);
+
+    if(count > 0){ 
+      PathHistoryTableEntry & path = CkpvAccess(pathHistoryTable)[msg->table_idx];
+      int idx = path.sender_history_table_idx;
+      int pe = path.sender_pe;
+
+#if DEBUGPRINT > 2
+      CkPrintf("Table entry %d on pe %d points to pe=%d idx=%d\n", msg->table_idx, CkMyPe(), pe, idx);
+#endif
+
+      // Make a copy of the message for broadcasting to all PEs
+      pathInformationMsg *newmsg = new(msg->historySize+1) pathInformationMsg;
+      for(int i=0;i<msg->historySize;i++){
+       newmsg->history[i] = msg->history[i];
+      }
+      newmsg->history[msg->historySize] = path;
+      newmsg->historySize = msg->historySize+1;
+      newmsg->cb = msg->cb;
+      newmsg->table_idx = idx;
+      
+      // Keep a message for returning to the user's callback
+      pathForUser = new(msg->historySize+1) pathInformationMsg;
+      for(int i=0;i<msg->historySize;i++){
+       pathForUser->history[i] = msg->history[i];
+      }
+      pathForUser->history[msg->historySize] = path;
+      pathForUser->historySize = msg->historySize+1;
+      pathForUser->cb = msg->cb;
+      pathForUser->table_idx = idx;
+      
+      
+      if(idx > -1 && pe > -1){
+       CkAssert(pe < CkNumPes() && pe >= 0);
+       thisProxy[pe].traceCriticalPathBack(newmsg);
+      } else {
+       CkPrintf("Traced critical path back to its origin.\n");
+       CkPrintf("Broadcasting it to all PE\n");
+       thisProxy.broadcastCriticalPathResult(newmsg);
+      }
+    } else {
+      CkAbort("ERROR: Traced critical path back to a nonexistent table entry.\n");
+    }
+
+    delete msg;
+#else
+    CkAbort("Shouldn't call pathHistoryManager::traceCriticalPathBack when critical path detection is not enabled");
+#endif
+  }
+
+
+void pathHistoryManager::broadcastCriticalPathResult(pathInformationMsg *msg){
+
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+  CkPrintf("[%d] Received broadcast of critical path\n", CkMyPe());
+  int me = CkMyPe();
+  int intersectsLocalPE = false;
+
+  // Create user events for critical path
+
+  for(int i=msg->historySize-1;i>=0;i--){
+    if(CkMyPe() == msg->history[i].local_pe){
+      // Part of critical path is local
+      // Create user event for it
+
+      //      CkPrintf("\t[%d] Path Step %d: local_path_time=%lf arr=%d ep=%d starttime=%lf preceding path time=%lf pe=%d\n",CkMyPe(), i, msg->history[i].get_local_path_time(), msg-> history[i].local_arr, msg->history[i].local_ep, msg->history[i].get_start_time(), msg->history[i].get_preceding_path_time(), msg->history[i].local_pe);
+      traceUserBracketEvent(5900, msg->history[i].get_start_time(), msg->history[i].get_start_time() + msg->history[i].get_local_path_time());
+      intersectsLocalPE = true;
+    }
+
+  }
+  
+
+#if PRUNE_CRITICAL_PATH_LOGS
+  // Tell projections tracing to only output log entries if I contain part of the critical path
+  if(! intersectsLocalPE){
+    disableTraceLogOutput();
+    CkPrintf("PE %d doesn't intersect the critical path, so its log files won't be created\n", CkMyPe() );
+  }
+#endif  
+  
+#if TRACE_ALL_PATH_TABLE_ENTRIES
+  // Create user events for all table entries
+  std::map< int, PathHistoryTableEntry >::iterator iter;
+  for(iter=pathHistoryTable.begin(); iter != pathHistoryTable.end(); iter++){
+    double startTime = iter->second.get_start_time();
+    double endTime = iter->second.get_start_time() + iter->second.get_local_path_time();
+    traceUserBracketEvent(5901, startTime, endTime);
+  }
+#endif
+
+  int data=1;
+  CkCallback cb(CkIndex_pathHistoryManager::criticalPathDone(NULL),thisProxy[0]); 
+  contribute(sizeof(int), &data, CkReduction::sum_int, cb);
+
+#endif
+
+}
+
+void pathHistoryManager::criticalPathDone(CkReductionMsg *msg){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+  CkPrintf("[%d] All PEs have received the critical path information. Sending critical path to user supplied callback.\n", CkMyPe());
+  pathForUser->cb.send(pathForUser);
+  pathForUser = NULL;
+#endif
+}
+
+
+
+
 void initializeCriticalPath(void){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
   CkpvInitialize(MergeablePathHistory, currentlyExecutingPath); // The maximal incoming path for the node
   CkpvInitialize(double, timeEntryMethodStarted);
   CkpvAccess(timeEntryMethodStarted) = 0.0;
+
+
+  CkpvInitialize(PathHistoryTableType, pathHistoryTable);
+  CkpvInitialize(int, pathHistoryTableLastIdx);
+  CkpvAccess(pathHistoryTableLastIdx) = 0;
+#endif
 }
 
+
+
+
+
+
+
+
+
+
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+// The PathHistoryEnvelope class is disabled if USE_CRITICAL_PATH_HEADER_ARRAY isn't defined
 void PathHistoryEnvelope::reset(){
   totalTime = 0.0;
   sender_history_table_idx = -1;
@@ -81,13 +247,11 @@ int PathHistoryTableEntry::addToTableAndEnvelope(envelope *env){
 
 /// Add an entry for this path history into the table. Returns the index in the table for it.
 int PathHistoryTableEntry::addToTable(){
-  std::map<int, PathHistoryTableEntry> &table = controlPointManagerProxy.ckLocalBranch()->pathHistoryTable;
-  int &table_last_idx = controlPointManagerProxy.ckLocalBranch()->pathHistoryTableLastIdx;
-  int new_idx = table_last_idx++;
-  table[new_idx] = *this;
+  int new_idx = CkpvAccess(pathHistoryTableLastIdx) ++;
+  CkpvAccess(pathHistoryTable)[new_idx] = *this;
   return new_idx;
 }
-
+#endif
 
 
   
@@ -122,6 +286,7 @@ void setCurrentlyExecutingPathTo100(void){
 
 /// A routine for printing out information along the critical path.
 void traceCriticalPathBack(CkCallback cb){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
 
   pathInformationMsg *newmsg = new(0) pathInformationMsg;
   newmsg->historySize = 0;
@@ -130,7 +295,16 @@ void traceCriticalPathBack(CkCallback cb){
   int pe = CkpvAccess(currentlyExecutingPath).sender_pe;
   CkPrintf("Starting tracing of critical path from pe=%d table_idx=%d\n", pe,  CkpvAccess(currentlyExecutingPath).sender_history_table_idx);
   CkAssert(pe < CkNumPes() && pe >= 0);
-  controlPointManagerProxy[pe].traceCriticalPathBack(newmsg);
+  pathHistoryManagerProxy[pe].traceCriticalPathBack(newmsg);
+#else
+
+  pathInformationMsg * pathForUser = new(0) pathInformationMsg;  
+  pathForUser->historySize = 0;                                                                                        
+  pathForUser->cb = CkCallback();                                                                                                      
+  pathForUser->table_idx = -1;      
+  cb.send(pathForUser);    
+
+#endif
 }
 
 
@@ -144,10 +318,12 @@ void traceCriticalPathBack(CkCallback cb){
 
 /// A debugging routine that prints the number of EPs for the program, and the size of the envelope's path fields
 void  printEPInfo(){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
   CkPrintf("printEPInfo():\n");
   CkPrintf("There are %d EPs\n", (int)_entryTable.size());
   for (int epIdx=0;epIdx<_entryTable.size();epIdx++)
     CkPrintf("EP %d is %s\n", epIdx, _entryTable[epIdx]->name);
+#endif
 }
 
 
@@ -243,6 +419,7 @@ void criticalPath_end(){
 /// Split an entry method invocation into multiple logical tasks for the critical path analysis.
 /// SDAG doen's break up the code in useful ways, so I'll make it add calls to this in the generated code.
 void criticalPath_split(){
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
   saveCurrentPathAsUserEvent("criticalPath_split()<br> ");
 
   // save an entry in the table
@@ -259,32 +436,11 @@ void criticalPath_split(){
   CkpvAccess(currentlyExecutingPath).preceding_path_time = entry.getTotalTime();
   CkpvAccess(currentlyExecutingPath).timeEntryMethodStarted = now;
   CkpvAccess(timeEntryMethodStarted) = now;
-}
-
-
-
-
-
-
-#else
-// Versions that are used when compiled without critical path detection:
-
-void initializeCriticalPath(void){ }
-void traceCriticalPathBack(CkCallback cb){
-  pathInformationMsg * pathForUser = new(0) pathInformationMsg;  
-  pathForUser->historySize = 0;                                                                                        
-  pathForUser->cb = CkCallback();                                                                                                      
-  pathForUser->table_idx = -1;      
-  cb.send(pathForUser);                                   
-}
-
-
-
 #endif
+}
 
 
-
-
+#include "PathHistory.def.h"
 
 /*! @} */
 
diff --git a/src/ck-cp/pathHistory.ci b/src/ck-cp/pathHistory.ci
new file mode 100644 (file)
index 0000000..edad718
--- /dev/null
@@ -0,0 +1,27 @@
+module PathHistory {
+
+  readonly CProxy_pathHistoryManager pathHistoryManagerProxy;
+
+  initproc void initializeCriticalPath(void);  
+
+
+  mainchare pathHistoryMain {
+    entry pathHistoryMain(CkArgMsg*);
+  };
+
+
+  message pathInformationMsg { 
+        PathHistoryTableEntry history[];
+  };
+
+
+ group pathHistoryManager {
+     entry pathHistoryManager();
+
+     entry void traceCriticalPathBack(pathInformationMsg *msg);
+     entry void broadcastCriticalPathResult(pathInformationMsg *msg);
+     entry void criticalPathDone(CkReductionMsg *msg);
+ }   
+
+
+};
index c0ed7c282b66c84570b97f2c2edc702a167c64d5..56046db5815e21850e0d25b2f4e734a61c7b881d 100644 (file)
 #include <vector>
 #include <map>
 #include <cmath>
-#include "ControlPoints.decl.h"
+#include "PathHistory.decl.h"
 #include "envelope.h"
 
 #include<pup_stl.h>
 
 
+
+
+
 void initializeCriticalPath(void);
 
 
+class pathHistoryManager : public CBase_pathHistoryManager {
+ public:
+  
+  pathInformationMsg *pathForUser; // A place to store the path for the user while we go about doing other things.
+  
+  pathHistoryManager();
+
+  pathHistoryManager(CkMigrateMessage *m){
+    CkAbort("pathHistoryManager does not have a working migration constructor."); 
+  }
+  
+  void pup(PUP::er &p) { 
+    CkAbort("pathHistoryManager cannot be pupped.");
+  } 
+
+  /** Trace perform a traversal backwards over the critical path specified as a 
+      table index for the processor upon which this is called.
+      
+      The callback cb will be called with the resulting msg after the path has 
+      been traversed to its origin.
+  */
+ void traceCriticalPathBack(pathInformationMsg *msg);
+ void broadcastCriticalPathResult(pathInformationMsg *msg);
+ void criticalPathDone(CkReductionMsg *msg);
+
+};
+
+
+
 /**
    Augments the PathHistory in the envelope with the other necessary information
    from the envelope. These should be derived from an incoming message.
@@ -42,9 +74,6 @@ void initializeCriticalPath(void);
    This can be constructed from an envelope.
 */
 
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-
-//#warning "Usinge MergeablePathHistory in pathHistory.h"
 class MergeablePathHistory {
  public:
   double timeEntryMethodStarted;
@@ -57,6 +86,7 @@ class MergeablePathHistory {
   int local_ep;  // The locally executing EP
   int local_arr; // The locally executing array
 
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
  MergeablePathHistory(const envelope *env) 
    : sender_pe(env->getSrcPe()), 
     sender_history_table_idx(env->pathHistory.get_sender_history_table_idx()), 
@@ -67,7 +97,16 @@ class MergeablePathHistory {
       {
        // No body
       }
-
+#else
+ MergeablePathHistory(const envelope *env) 
+   : sender_pe(env->getSrcPe()), 
+    local_ep(env->getEpIdx()),
+    local_arr(env->getArrayMgrIdx()),
+    timeEntryMethodStarted(0.0)
+      {
+       // No body
+      }
+#endif
 
   MergeablePathHistory() {
     reset();
@@ -110,8 +149,10 @@ class MergeablePathHistory {
 
   /// Write a description of the path into the beginning of the provided buffer. The buffer ought to be large enough.
   void printHTMLToString(char* buf) const{
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
     buf[0] = '\0';
     sprintf(buf+strlen(buf), "MergeablePathHistory time=%lf send pe=%d idx=%d timeEntryStarted=%lf", (double)preceding_path_time, (int)sender_pe, (int)sender_history_table_idx, (double)timeEntryMethodStarted);
+#endif
   }
 
   void setDebug100(){
@@ -119,11 +160,8 @@ class MergeablePathHistory {
     CkPrintf("Setting path length to 100\n");
   }
 
-
 };
 
-#endif
-
 
 /** 
     Stores information about the critical path in the table on each PE. 
@@ -256,10 +294,20 @@ class pathInformationMsg : public CMessage_pathInformationMsg {
 };
 
 
-#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
-CkpvExtern(MergeablePathHistory, currentlyExecutingPath);
+CkpvExtern(MergeablePathHistory, currentlyExecutingPath); // The maximal incoming path for the node
 CkpvExtern(double, timeEntryMethodStarted);
 
+
+#ifdef USE_CRITICAL_PATH_HEADER_ARRAY
+/** A table to store all the local nodes in the parallel dependency graph */
+typedef std::map<int, PathHistoryTableEntry> PathHistoryTableType;
+CkpvExtern(PathHistoryTableType, pathHistoryTable);
+/** A counter that defines the new keys for the entries in the pathHistoryTable */
+CkpvExtern(int, pathHistoryTableLastIdx);
+
+
+
+
 // Reset the counts for the currently executing message. Cut the incoming path
 extern void resetThisEntryPath();
 
@@ -319,5 +367,7 @@ extern void criticalPath_split();
 #endif
 
 
+
+
 /** @} */
 #endif
index dd0954b3e1a47ea85c8df2753a6cd048dfb459b3..88328ead1fc4db4c7188b72afc98ff24d5336863 100644 (file)
@@ -489,7 +489,8 @@ ck.o: ck.C ck.h charm++.h charm.h converse.h conv-config.h \
   tempo.decl.h waitqd.h waitqd.decl.h sdag.h ckcheckpoint.h \
   CkCheckpoint.decl.h ckevacuation.h ckarrayreductionmgr.h trace.h \
   trace-bluegene.h envelope.h qd.h register.h stats.h ckfutures.h \
-  ckIgetControl.h queueing.h CkMarshall.def.h
+  ckIgetControl.h queueing.h pathHistory.h PathHistory.decl.h pup_stl.h \
+  pup.h CkMarshall.def.h
        $(CHARMC) -c -I. ck.C
 
 main.o: main.C ck.h charm++.h charm.h converse.h conv-config.h \
@@ -662,7 +663,7 @@ ckarray.o: ckarray.C charm++.h charm.h converse.h conv-config.h \
   tempo.decl.h waitqd.h waitqd.decl.h sdag.h ckcheckpoint.h \
   CkCheckpoint.decl.h ckevacuation.h ckarrayreductionmgr.h trace.h \
   trace-bluegene.h envelope.h register.h ck.h qd.h stats.h ckfutures.h \
-  ckIgetControl.h pathHistory.h ControlPoints.decl.h pup_stl.h pup.h \
+  ckIgetControl.h pathHistory.h PathHistory.decl.h pup_stl.h pup.h \
   CkArray.def.h
        $(CHARMC) -c -I. ckarray.C
 
@@ -681,7 +682,8 @@ ckreduction.o: ckreduction.C charm++.h charm.h converse.h conv-config.h \
   tempo.decl.h waitqd.h waitqd.decl.h sdag.h ckcheckpoint.h \
   CkCheckpoint.decl.h ckevacuation.h ckarrayreductionmgr.h trace.h \
   trace-bluegene.h envelope.h ck.h qd.h register.h stats.h ckfutures.h \
-  ckIgetControl.h CkReduction.def.h
+  ckIgetControl.h pathHistory.h PathHistory.decl.h pup_stl.h pup.h \
+  CkReduction.def.h
        $(CHARMC) -c -I. ckreduction.C
 
 ckarrayreductionmgr.o: ckarrayreductionmgr.C charm++.h charm.h converse.h \
@@ -1384,6 +1386,37 @@ charmProjections.o: charmProjections.C converse.h conv-config.h \
   trace-common.h
        $(CHARMC) -c -I. charmProjections.C
 
+pathHistory.o: pathHistory.C charm++.h charm.h converse.h conv-config.h \
+  conv-autoconfig.h conv-common.h conv-mach.h conv-mach-opt.h pup_c.h \
+  conv-config.h conv-cpm.h converse.h conv-cpath.h converse.h conv-qd.h \
+  conv-random.h conv-lists.h conv-trace.h converse.h persistent.h \
+  debug-conv.h pup_c.h pup.h middle.h middle-conv.h converse.h pup.h \
+  cklists.h pup.h ckbitvector.h ckstream.h init.h charm.h ckhashtable.h \
+  pup.h debug-charm.h converse.h debug-conv.h pup.h cklists.h simd.h \
+  CkMarshall.decl.h charm++.h ckhashtable.h pup.h cksection.h \
+  ckcallback.h conv-ccs.h converse.h sockRoutines.h conv-config.h \
+  ccs-server.h sockRoutines.h ckobjQ.h cklists.h ckreduction.h \
+  CkReduction.decl.h charm++.h cknodegroupreduction.h \
+  CkArrayReductionMgr.decl.h charm++.h CkReduction.decl.h \
+  ckmemcheckpoint.h CkMemCheckpoint.decl.h charm++.h readonly.h charm.h \
+  ckarray.h cklocation.h LBDatabase.h lbdb.h converse.h charm.h middle.h \
+  LBDBManager.h converse.h lbdb.h cklists.h LBObj.h lbdb.h LBOM.h lbdb.h \
+  LBObj.h LBComm.h converse.h lbdb.h LBMachineUtil.h lbdb++.h \
+  LBDBManager.h LBDatabase.decl.h charm++.h NullLB.decl.h charm++.h \
+  LBDatabase.decl.h BaseLB.decl.h charm++.h LBDatabase.decl.h \
+  CkLocation.decl.h charm++.h CkMarshall.decl.h ckmemcheckpoint.h \
+  CkArray.decl.h charm++.h CkReduction.decl.h CkLocation.decl.h \
+  CkArrayReductionMgr.decl.h CkArrayReductionMgr.decl.h ckstream.h \
+  CkFutures.decl.h charm++.h charisma.h charisma.decl.h charm++.h tempo.h \
+  charm++.h tempo.decl.h charm++.h waitqd.h charm++.h waitqd.decl.h \
+  charm++.h CkFutures.decl.h sdag.h charm++.h ckcheckpoint.h \
+  CkCheckpoint.decl.h charm++.h ckevacuation.h ckarrayreductionmgr.h \
+  trace.h conv-trace.h trace-bluegene.h trace.h envelope.h charm.h \
+  PathHistory.decl.h charm++.h LBDatabase.h pathHistory.h envelope.h \
+  pup_stl.h pup.h arrayRedistributor.h ControlPoints.decl.h register.h \
+  PathHistory.def.h
+       $(CHARMC) -c -I. pathHistory.C
+
 EveryLB.o: EveryLB.C charm++.h charm.h converse.h conv-config.h \
   conv-autoconfig.h conv-common.h conv-mach.h conv-mach-opt.h pup_c.h \
   conv-config.h conv-cpm.h converse.h conv-cpath.h converse.h conv-qd.h \
@@ -2915,8 +2948,8 @@ controlPoints.o: controlPoints.C charm++.h charm.h converse.h \
   ckcheckpoint.h CkCheckpoint.decl.h charm++.h ckevacuation.h \
   ckarrayreductionmgr.h trace.h conv-trace.h trace-bluegene.h trace.h \
   envelope.h charm.h controlPoints.h ControlPoints.decl.h charm++.h \
-  pup_stl.h pup.h LBDatabase.h pathHistory.h envelope.h \
-  arrayRedistributor.h trace-controlPoints.h trace.h register.h \
+  pup_stl.h pup.h LBDatabase.h arrayRedistributor.h pathHistory.h \
+  PathHistory.decl.h envelope.h trace-controlPoints.h trace.h register.h \
   trace-common.h trace-projections.h ckhashtable.h pup.h \
   ControlPoints.def.h
        $(CHARMC) -c -I. controlPoints.C
@@ -2949,37 +2982,7 @@ arrayRedistributor.o: arrayRedistributor.C charm++.h charm.h converse.h \
   ckarrayreductionmgr.h trace.h conv-trace.h trace-bluegene.h trace.h \
   envelope.h charm.h ControlPoints.decl.h charm++.h trace-controlPoints.h \
   trace.h envelope.h register.h trace-common.h LBDatabase.h \
-  controlPoints.h pup_stl.h pup.h pathHistory.h arrayRedistributor.h
+  controlPoints.h pup_stl.h pup.h arrayRedistributor.h pathHistory.h \
+  PathHistory.decl.h
        $(CHARMC) -c -I. arrayRedistributor.C
 
-pathHistory.o: pathHistory.C charm++.h charm.h converse.h conv-config.h \
-  conv-autoconfig.h conv-common.h conv-mach.h conv-mach-opt.h pup_c.h \
-  conv-config.h conv-cpm.h converse.h conv-cpath.h converse.h conv-qd.h \
-  conv-random.h conv-lists.h conv-trace.h converse.h persistent.h \
-  debug-conv.h pup_c.h pup.h middle.h middle-conv.h converse.h pup.h \
-  cklists.h pup.h ckbitvector.h ckstream.h init.h charm.h ckhashtable.h \
-  pup.h debug-charm.h converse.h debug-conv.h pup.h cklists.h simd.h \
-  CkMarshall.decl.h charm++.h ckhashtable.h pup.h cksection.h \
-  ckcallback.h conv-ccs.h converse.h sockRoutines.h conv-config.h \
-  ccs-server.h sockRoutines.h ckobjQ.h cklists.h ckreduction.h \
-  CkReduction.decl.h charm++.h cknodegroupreduction.h \
-  CkArrayReductionMgr.decl.h charm++.h CkReduction.decl.h \
-  ckmemcheckpoint.h CkMemCheckpoint.decl.h charm++.h readonly.h charm.h \
-  ckarray.h cklocation.h LBDatabase.h lbdb.h converse.h charm.h middle.h \
-  LBDBManager.h converse.h lbdb.h cklists.h LBObj.h lbdb.h LBOM.h lbdb.h \
-  LBObj.h LBComm.h converse.h lbdb.h LBMachineUtil.h lbdb++.h \
-  LBDBManager.h LBDatabase.decl.h charm++.h NullLB.decl.h charm++.h \
-  LBDatabase.decl.h BaseLB.decl.h charm++.h LBDatabase.decl.h \
-  CkLocation.decl.h charm++.h CkMarshall.decl.h ckmemcheckpoint.h \
-  CkArray.decl.h charm++.h CkReduction.decl.h CkLocation.decl.h \
-  CkArrayReductionMgr.decl.h CkArrayReductionMgr.decl.h ckstream.h \
-  CkFutures.decl.h charm++.h charisma.h charisma.decl.h charm++.h tempo.h \
-  charm++.h tempo.decl.h charm++.h waitqd.h charm++.h waitqd.decl.h \
-  charm++.h CkFutures.decl.h sdag.h charm++.h ckcheckpoint.h \
-  CkCheckpoint.decl.h charm++.h ckevacuation.h ckarrayreductionmgr.h \
-  trace.h conv-trace.h trace-bluegene.h trace.h envelope.h charm.h \
-  ControlPoints.decl.h charm++.h trace-controlPoints.h trace.h envelope.h \
-  register.h trace-common.h LBDatabase.h controlPoints.h pup_stl.h pup.h \
-  pathHistory.h arrayRedistributor.h register.h
-       $(CHARMC) -c -I. pathHistory.C
-
index a9edf973fa81d0467729d73332de8bf3045eca64..17c7e65084ca7712a6aa65b5fd1935447b0c04da 100644 (file)
@@ -179,7 +179,7 @@ CVHEADERS=cpthreads.h converse.h conv-trace.h conv-random.h conv-qd.h \
        convcomlibmanager.h graphrouter.h petable.h gridrouter.h router.h \
        prefixrouter.h pipebroadcastconverse.h pipelinestrategy.h cmipool.h \
       comlib.h cmidirect.h cmidirectmanytomany.h \
-      controlPoints.h arrayRedistributor.h controlPoints.h pathHistory.h
+      controlPoints.h arrayRedistributor.h controlPoints.h 
 
 # The .c files are there to be #included by clients whole
 # This is a bit unusual, but makes client linking simpler.
@@ -189,7 +189,7 @@ UTILHEADERS=pup.h pupf.h pup_c.h pup_stl.h pup_mpi.h pup_toNetwork.h pup_toNetwo
        sockRoutines.h sockRoutines.c ckpool.h BGLTorus.h BGPTorus.h \
        TopoManager.h XT3Torus.h XT4Torus.h cmimemcpy.h simd.h SSE-Double.h SSE-Float.h
 
-CKHEADERS=ck.h ckstream.h envelope-path.h envelope.h envelope-path.h init.h qd.h charm.h charm++.h \
+CKHEADERS=ck.h ckstream.h envelope.h init.h qd.h charm.h charm++.h \
          ckfutures.h ckIgetControl.h \
          ckcallback.h CkCallback.decl.h ckcallback-ccs.h       \
          ckarrayreductionmgr.h cknodegroupreduction.h cksection.h \
@@ -212,7 +212,6 @@ CKHEADERS=ck.h ckstream.h envelope-path.h envelope.h envelope-path.h init.h qd.h
           CkMarshall.decl.h CkArray.decl.h CkLocation.decl.h   \
           CkReduction.decl.h CkArrayReductionMgr.decl.h\
           tempo.decl.h waitqd.decl.h \
-         ControlPoints.decl.h \
           CkFutures.decl.h CkCheckpoint.decl.h CkMemCheckpoint.decl.h \
           LBDatabase.decl.h CentralLB.decl.h ComboCentLB.decl.h NullLB.decl.h \
           RandCentLB.decl.h RecBisectBfLB.decl.h BaseLB.decl.h MetisLB.decl.h \
@@ -236,6 +235,8 @@ CKHEADERS=ck.h ckstream.h envelope-path.h envelope.h envelope-path.h init.h qd.h
          BroadcastStrategy.h ComlibSectionInfo.h AAPLearner.h \
          AAMLearner.h ComlibStats.h \
          RectMulticastStrategy.h ckdirect.h \
+         ControlPoints.decl.h PathHistory.decl.h \
+         pathHistory.h envelope-path.h \
          $(CVHEADERS)
 
 ALLHEADERS=$(CKHEADERS) \
@@ -627,7 +628,7 @@ LIBCK_CORE=trace-common.o tracef.o init.o register.o qd.o ck.o main.o  \
            ObjGraph.o graph.o LButil.o Refiner.o RefinerApprox.o  \
            RefinerComm.o bitvecset.o Set.o heap.o CommLBHeap.o \
           NullLB.o LBSimulation.o $(COMLIB_CORE_OBJS) \
-          charmProjections.o
+          charmProjections.o pathHistory.o
 
 charm-target: converse $(L)/libck.a $(L)/libckf.a loadbalancers default_libs comlib_objs controlPoints_objs 
 
@@ -873,7 +874,7 @@ TRACE_OBJS =  trace-projections.o  trace-summary.o  trace-simple.o \
 ######################################################################
 
 
-CONTROLPOINTS_OBJS = controlPoints.o arrayRedistributor.o pathHistory.o
+CONTROLPOINTS_OBJS = controlPoints.o arrayRedistributor.o
 
 ControlPoints.def.h: ControlPoints.decl.h
 
@@ -886,6 +887,20 @@ $(L)/libmoduleControlPoints.a: $(CONTROLPOINTS_OBJS)
        $(CHARMC) -o $(L)/libmoduleControlPoints.a $(CONTROLPOINTS_OBJS)
 
 
+######################################################################
+#
+# Critical Path Library
+#
+######################################################################
+
+
+PathHistory.def.h: PathHistory.decl.h
+
+PathHistory.decl.h : pathHistory.ci charmxi
+       $(CHARMXI) pathHistory.ci
+
+
+
 ###############################################################################
 #
 # Dynamic Load Balancers