Fix the potential problem in neighbor seed balancer, which is that when converse...
authorYanhua Yanhua <sun51@illinois.edu>
Thu, 29 Jul 2010 21:14:47 +0000 (16:14 -0500)
committerYanhua Yanhua <sun51@illinois.edu>
Thu, 29 Jul 2010 21:14:47 +0000 (16:14 -0500)
src/conv-ldb/cldb.neighbor.c

index bb98d9991768daa437caec620c2dca3074ddcf9c..4a6326965c836d71a452b5b59a3d7283e613b4a8 100644 (file)
@@ -192,11 +192,11 @@ int CldMinAvg()
 {
   int sum=0, i;
 
-
   int nNeighbors = CpvAccess(numNeighbors);
-  
   if(CpvAccess(topologyReady) == 0 || nNeighbors == 0)
+  {
       return CmiMyPe();
+  }
 #ifdef YHDEBUG
   CmiPrintf("Line 196 processor %d, numNeighbor=%d\n", CmiMyPe(), nNeighbors);
 #endif
@@ -702,6 +702,8 @@ void CldGraphModuleInit(char **argv)
 
 void CldCallback()
 {
+    if(CpvAccess(topologyReady))
+        return;
     CldComputeNeighborData();
     CpvAccess(topologyReady) = 1;
 #if CMK_MULTICORE