support load balancing
authorEric Bohm <ebohm@illinois.edu>
Wed, 20 Apr 2005 21:33:52 +0000 (21:33 +0000)
committerEric Bohm <ebohm@illinois.edu>
Wed, 20 Apr 2005 21:33:52 +0000 (21:33 +0000)
src/libs/ck-libs/paircalc/ckPairCalculator.C
src/libs/ck-libs/paircalc/ckPairCalculator.h

index 10db2b4aecd465d8cebf4728c4bad288d1419fa9..f75086c25dcd510472bf46f4d33ceb57cab9ceac 100644 (file)
@@ -40,7 +40,8 @@ PairCalculator::PairCalculator(bool sym, int grainSize, int s, int blkSize,  int
   sumPartialCount = 0;
   setMigratable(true);
   usesAtSync=true;
-  //setMigratable(false);
+  //  setMigratable(false);
+  //  usesAtSync=false;
   CProxy_PairCalcReducer pairCalcReducerProxy(reducer_id); 
   pairCalcReducerProxy.ckLocalBranch()->doRegister(this, symmetric);
 }
@@ -111,8 +112,11 @@ PairCalculator::~PairCalculator()
 
 }
 void PairCalculator::ResumeFromSync() {
-    CProxy_PairCalcReducer pairCalcReducerProxy(reducer_id); 
-    pairCalcReducerProxy.ckLocalBranch()->doRegister(this,symmetric);
+  if(usesAtSync)
+    {
+      CProxy_PairCalcReducer pairCalcReducerProxy(reducer_id); 
+      pairCalcReducerProxy.ckLocalBranch()->doRegister(this,symmetric);
+    }
 }
 void
 PairCalculator::calculatePairs_gemm(calculatePairsMsg *msg)
index 0939157435a26bf3ee7d9cdf119115ab7ec3f68b..e255989fc4c53d595d40f88b3397f91e99b75323 100644 (file)
@@ -162,6 +162,8 @@ class PairCalcReducer : public Group {
   ~PairCalcReducer() {}
   void clearRegister()
     {  
+      acceptCount=0;
+      reduction_elementCount=0;
       localElements[0].resize(0);
       localElements[1].resize(0);
       numRegistered[0]=0;