Adding command line arguments to enable loading/saving of control point data.
authorIsaac Dooley <idooley2@illinois.edu>
Tue, 3 Nov 2009 16:33:26 +0000 (16:33 +0000)
committerIsaac Dooley <idooley2@illinois.edu>
Tue, 3 Nov 2009 16:33:26 +0000 (16:33 +0000)
src/ck-cp/controlPoints.C
src/ck-cp/controlPoints.h

index da7eb34873c10fcc775503c79c74d0d8cabec3f2..050b6364550ea52165e3aacbcee11100408e53b1 100644 (file)
@@ -15,9 +15,6 @@
  *
  */
 
-
-
-
 using namespace std;
 
 #define DEFAULT_CONTROL_POINT_SAMPLE_PERIOD  10000000
@@ -32,12 +29,13 @@ using namespace std;
 static void periodicProcessControlPoints(void* ptr, double currWallTime);
 
 
-
 // A pointer to this PE's controlpoint manager Proxy
 /* readonly */ CProxy_controlPointManager controlPointManagerProxy;
 /* readonly */ int random_seed;
 /* readonly */ long controlPointSamplePeriod;
 /* readonly */ int whichTuningScheme;
+/* readonly */ bool writeDataFileAtShutdown;
+/* readonly */ bool loadDataFileAtStartup;
 
 
 typedef enum tuningSchemeEnum {RandomSelection, SimulatedAnnealing, ExhaustiveSearch, CriticalPathAutoPrioritization, UseBestKnownTiming}  tuningScheme;
@@ -726,6 +724,19 @@ public:
     } 
 
 
+    writeDataFileAtShutdown = false;   
+    if( CmiGetArgFlagDesc(args->argv,"+CPSaveData","Save Control Point timings & configurations at completion") ){
+      writeDataFileAtShutdown = true;
+    }
+
+   loadDataFileAtStartup = false;   
+    if( CmiGetArgFlagDesc(args->argv,"+CPLoadData","Load Control Point timings & configurations at startup") ){
+      loadDataFileAtStartup = true;
+    }
+
+
+
+
     controlPointManagerProxy = CProxy_controlPointManager::ckNew();
   }
   ~controlPointMain(){}
@@ -750,10 +761,11 @@ void registerControlPointTiming(double time){
 /// Shutdown the control point framework, writing data to disk if necessary
 extern "C" void controlPointShutdown(){
   if(CkMyPe() == 0){
-#if 0
-    CkPrintf("[%d] controlPointShutdown() at CkExit()\n", CkMyPe());
-    controlPointManagerProxy.ckLocalBranch()->writeDataFile();
-#endif
+
+    if(writeDataFileAtShutdown){
+      CkPrintf("[%d] controlPointShutdown() at CkExit()\n", CkMyPe());
+      controlPointManagerProxy.ckLocalBranch()->writeDataFile();
+    }
     CkExit();
   }
 }
index be196213844f11ee577979d20313bdb99c1f7b6a..4760baa899f7df490e5ec980e42905d7fd32b923 100644 (file)
@@ -43,7 +43,8 @@
 /* readonly */ extern int random_seed;
 /* readonly */ extern long controlPointSamplePeriod;
 /* readonly */ extern int whichTuningScheme;
-
+/* readonly */ extern bool writeDataFileAtShutdown;
+/* readonly */ extern bool loadDataFileAtStartup;