Minor fix for intersection case
authorHarshitha <gplkrsh2@illinois.edu>
Fri, 9 Mar 2012 22:51:25 +0000 (16:51 -0600)
committerHarshitha <gplkrsh2@illinois.edu>
Fri, 9 Mar 2012 22:51:25 +0000 (16:51 -0600)
src/ck-ldb/CentralLB.C

index aca503cb77d9919eece5bac8b915128fef40d6ea..2ec8141ae72662a6ac86c88d7b6c4c56e2261df3 100644 (file)
@@ -503,7 +503,8 @@ bool CentralLB::generatePlan(int& period) {
     }
   }
 
-  if (period > ((mc - ac)/(aslope - mslope))) {
+  int intersection_t = (mc-ac) / (aslope - mslope);
+  if (intersection_t > 0 && period > intersection_t) {
     CkPrintf("Avg | Max Period set when curves intersect\n");
     return false;
   }