Fix load balancer bug in fault recovery.
authorEsteban Meneses <emenese2@illinois.edu>
Thu, 11 Mar 2010 20:07:30 +0000 (14:07 -0600)
committerEsteban Meneses <emenese2@illinois.edu>
Thu, 11 Mar 2010 20:07:30 +0000 (14:07 -0600)
src/ck-ldb/LBDatabase.C

index 79f798e9715bd856597a589b3e32f12a27551be8..d9ac54b64cce6141257198cc01ff377aef3afd8d 100644 (file)
@@ -433,22 +433,23 @@ const char *LBDatabase::loadbalancer(int seq) {
 
 void LBDatabase::pup(PUP::er& p)
 { 
-  IrrGroup::pup(p); 
-  // the memory should be already allocated
-  int np;
-  if (!p.isUnpacking()) np = CkNumPes();
-  p|np;
+       IrrGroup::pup(p); 
+       // the memory should be already allocated
+       int np;
+       if (!p.isUnpacking()) np = CkNumPes();
+       p|np;
        CmiAssert(avail_vector);
-  // in case number of processors changes
-  if (p.isUnpacking() && np > CkNumPes()) {
-    CmiLock(avail_vector_lock);
-    delete [] avail_vector;
-    avail_vector = new char[np];
-    for (int i=0; i<np; i++) avail_vector[i] = 1;
-    CmiUnlock(avail_vector_lock);
-  }
-  p(avail_vector, np);
+       // in case number of processors changes
+       if (p.isUnpacking() && np > CkNumPes()) {
+               CmiLock(avail_vector_lock);
+               delete [] avail_vector;
+               avail_vector = new char[np];
+               for (int i=0; i<np; i++) avail_vector[i] = 1;
+               CmiUnlock(avail_vector_lock);
+       }
+       p(avail_vector, np);
        p|mystep;
+       if(p.isUnpacking()) nloadbalancers = 0;
 }