suppress some compiler warnings.
[charm.git] / src / ck-cp / controlPoints.C
index 2f733aa94af911cfd18bf8efe4611ed9aba942ee..536484169037b1e7ccbe547c2a40899ef95de9c2 100644 (file)
@@ -1044,7 +1044,7 @@ public:
     bool haveSamplePeriod = CmiGetArgDoubleDesc(args->argv,"+CPSamplePeriod", &period,"The time between Control Point Framework samples (in seconds)");
     if(haveSamplePeriod){
       CkPrintf("controlPointSamplePeriod = %lf sec\n", period);
-      controlPointSamplePeriod =  period * 1000; /**< A readonly */
+      controlPointSamplePeriod =  (int)(period * 1000); /**< A readonly */
     } else {
       controlPointSamplePeriod =  DEFAULT_CONTROL_POINT_SAMPLE_PERIOD;
     }
@@ -1929,7 +1929,7 @@ void controlPointManager::generatePlan() {
       
       const int before = bestPhase->controlPoints[name];   
   
-      const int range = (maxValue-minValue+1)*(1.0-progress);
+      const int range = (int)((maxValue-minValue+1)*(1.0-progress));
 
       int high = min(before+range, maxValue);
       int low = max(before-range, minValue);
@@ -2419,7 +2419,7 @@ void simplexScheme::adapt(std::map<std::string, std::pair<int,int> > & controlPo
 
                                double val = (cPhaseConfig[v] + best[v])/2.0;
 
-                               newControlPoints[name] = keepInRange(val,lb,ub);
+                               newControlPoints[name] = keepInRange((int)val,lb,ub);
                                CkPrintf("Simplex Tuning: v=%d Reflected worst %d %s -> %f (ought to be %f )\n", (int)v, (int)worstPhase, (char*)name.c_str(), (double)newControlPoints[name], (double)P[v]);
                                v++;
                        }
@@ -2534,7 +2534,7 @@ void simplexScheme::doReflection(std::map<std::string, std::pair<int,int> > & co
                const std::pair<int,int> &bounds = cpsIter->second;
                const int lb = bounds.first;
                const int ub = bounds.second;
-               newControlPoints[name] = keepInRange(P[v],lb,ub);
+               newControlPoints[name] = keepInRange((int)P[v],lb,ub);
                CkPrintf("Simplex Tuning: v=%d Reflected worst %d %s -> %f (ought to be %f )\n", (int)v, (int)worstPhase, (char*)name.c_str(), (double)newControlPoints[name], (double)P[v]);
                v++;
        }
@@ -2578,7 +2578,7 @@ void simplexScheme::doExpansion(std::map<std::string, std::pair<int,int> > & con
                const std::pair<int,int> &bounds = cpsIter->second;
                const int lb = bounds.first;
                const int ub = bounds.second;
-               newControlPoints[name] = keepInRange(P2[v],lb,ub);
+               newControlPoints[name] = keepInRange((int)P2[v],lb,ub);
                CkPrintf("Simplex Tuning: v=%d worstPhase=%d Expanding %s -> %f (ought to be %f )\n", (int)v, (int)worstPhase, (char*)name.c_str(), (double)newControlPoints[name], (double)P[v]);
                v++;
        }
@@ -2619,7 +2619,7 @@ void simplexScheme::doContraction(std::map<std::string, std::pair<int,int> > & c
                const std::pair<int,int> &bounds = cpsIter->second;
                const int lb = bounds.first;
                const int ub = bounds.second;
-               newControlPoints[name] = keepInRange(P2[v],lb,ub);
+               newControlPoints[name] = keepInRange((int)P2[v],lb,ub);
                CkPrintf("Simplex Tuning: v=%d worstPhase=%d Contracting %s -> %f (ought to be %f )\n", (int)v, (int)worstPhase, (char*)name.c_str(), (double)newControlPoints[name], (double)P[v]);
                v++;
        }