a patch from Jim: find a group size that evenly divides the number of pes.
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 4 Feb 2011 18:07:06 +0000 (12:07 -0600)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 4 Feb 2011 18:07:06 +0000 (12:07 -0600)
src/ck-ldb/HybridBaseLB.h

index e52027773626d57adab6c82e36718031bdea4ad3..94578d4ce5db4d40e21dd823b019d7fa69038c68 100644 (file)
@@ -108,6 +108,11 @@ public:
     while (groupsize && CkNumPes() / groupsize < 2) {
       groupsize /= 2;
     }
+    while ( CkNumPes() % groupsize ) --groupsize;
+    if ( groupsize == 1 ) {
+      ++groupsize;
+      while ( CkNumPes() % groupsize ) ++groupsize;
+    }
     span[0] = groupsize;
     CmiAssert(span[0]>1);
     span[1] = (CkNumPes()+span[0]-1)/span[0];