Fixing bug that occurs if an empty control point log is loaded at startup.
authorIsaac Dooley <idooley2@illinois.edu>
Tue, 3 Nov 2009 20:14:44 +0000 (20:14 +0000)
committerIsaac Dooley <idooley2@illinois.edu>
Tue, 3 Nov 2009 20:14:44 +0000 (20:14 +0000)
src/ck-cp/controlPoints.C

index a489b02071b6e23cb11cc1a5616af2c499f5b2be..be8e75911314aec01bf1d3ab394caf37237dac59 100644 (file)
@@ -125,10 +125,7 @@ controlPointManager::controlPointManager(){
     if(loadDataFileAtStartup){    
       loadDataFile();
     }
-    
-    if(allData.phases.size()>0){
-      allData.findBest();
-    }
+
     
     if(CkMyPe() == 0){
       CcdCallFnAfterOnPE((CcdVoidFn)periodicProcessControlPoints, (void*)NULL, controlPointSamplePeriod, CkMyPe());
@@ -866,16 +863,15 @@ int valueProvidedByOptimizer(const char * name){
       p.print();
       CkPrintf("\n");
       controlPointManagerProxy.ckLocalBranch()->best_phase = p;
-    }
-  
-  
+    } 
+    
     instrumentedPhase &p = controlPointManagerProxy.ckLocalBranch()->best_phase;
     int result = p.controlPoints[std::string(name)];
     CkPrintf("valueProvidedByOptimizer(): Control Point \"%s\" for phase %d chosen out of best previous phase to be: %d\n", name, phase_id, result);
     return result;
-
+    
   } else if( whichTuningScheme == SimulatedAnnealing ){
-
+    
     // -----------------------------------------------------------
     //  SIMULATED ANNEALING
     //  Simulated Annealing style hill climbing method
@@ -885,7 +881,7 @@ int valueProvidedByOptimizer(const char * name){
   
     std::map<std::string, pair<int,int> > &controlPointSpace = controlPointManagerProxy.ckLocalBranch()->controlPointSpace;  
   
-    CkPrintf("Finding best phase\n"); 
+    CkPrintf("Finding best phase\n");
     instrumentedPhase p = controlPointManagerProxy.ckLocalBranch()->allData.findBest();  
     CkPrintf("best found:\n"); 
     p.print();