Changing adaptive lb
authorHarshitha <gplkrsh2@illinois.edu>
Mon, 2 Apr 2012 20:02:56 +0000 (15:02 -0500)
committerHarshitha <gplkrsh2@illinois.edu>
Mon, 2 Apr 2012 20:02:56 +0000 (15:02 -0500)
src/ck-ldb/AdaptiveLB.C
src/ck-ldb/AdaptiveLB.h

index ea92b2f610da85d6db888e739db24dc96cb987ca..c2e72af77d624937bf10d5189854b62605d423ee 100644 (file)
@@ -25,6 +25,7 @@ AdaptiveLB::AdaptiveLB(const CkLBOptions &opt): CentralLB(opt)
   char *greedyLBString = "GreedyLB";
   char *refineLBString = "RefineLB";
   char *metisLBString = "MetisLB";
+  char *commRefineLBString = "CommAwareRefineLB";
 
   LBAllocFn fn = getLBAllocFn(greedyLBString);
   if (fn == NULL) {
@@ -49,6 +50,14 @@ AdaptiveLB::AdaptiveLB(const CkLBOptions &opt): CentralLB(opt)
   }
   BaseLB *slb = fn();
   metisLB = (CentralLB*)slb;
+
+  fn = getLBAllocFn(commRefineLBString);
+  if (fn == NULL) {
+    CkPrintf("LB> Invalid load balancer: %s.\n", commRefineLBString);
+    CmiAbort("");
+  }
+  BaseLB *crlb = fn();
+  commRefineLB = (CentralLB*)crlb;
 }
 
 void AdaptiveLB::work(LDStats* stats)
@@ -108,7 +117,7 @@ void AdaptiveLB::work(LDStats* stats)
       CkPrintf("---METIS LB\n");
     } else if (comm_refine_ratio <= 1.01) {
       lb_type = 3;
-      //commRefineLB->work(stats);
+      commRefineLB->work(stats);
       CkPrintf("---CommAwareRefineLB\n");
     } else if (comm_ratio <= 1.01) {
       lb_type = 2;
@@ -116,7 +125,7 @@ void AdaptiveLB::work(LDStats* stats)
       CkPrintf("---METIS LB\n");
     } else {
       lb_type = 3;
-      //commRefineLB->work(stats);
+      commRefineLB->work(stats);
       CkPrintf("---CommAwareRefineLB\n");
     }
 
index 98d2d7a4695fb62c4e61cb773ae1006c3f5c9375..74640d79aa930bcaf457e669ddd6ec7c053a9126 100644 (file)
@@ -30,6 +30,7 @@ private:
   CentralLB *greedyLB;
   CentralLB *refineLB;
   CentralLB *metisLB;
+  CentralLB *commRefineLB;
 };
 
 #endif /* CENTRAL_ADAPTIVE_LB_H */