important fix: correctly keep track of non-NULL element when doing broadcast when...
authorGengbin Zheng <gzheng@illinois.edu>
Sat, 17 Mar 2012 16:11:26 +0000 (11:11 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Sat, 17 Mar 2012 16:11:26 +0000 (11:11 -0500)
src/ck-core/ckarray.C

index ad8f33cdcbd606fa5ee4c00317f97fdd101c77a7..92e20f4fe78646e812c1d39cfff0f7f6b95df223 100644 (file)
@@ -1300,7 +1300,7 @@ void CkArray::recvBroadcast(CkMessage *m)
         locMgr->callForAllRecords(CkArray::staticBroadcastHomeElements,this,(void *)msg);
 #else
        //Run through the list of local elements
-       int idx=0, len=0;
+       int idx=0, len=0, count=0;
         if (stableLocations) {            /* remove all NULLs in the array */
           len = 0;
           while (elements->next(idx)!=NULL) len++;
@@ -1324,7 +1324,7 @@ void CkArray::recvBroadcast(CkMessage *m)
                startVTimer();
 #endif
                CmiBool doFree = CmiFalse;
-               if (stableLocations && idx == len) doFree = CmiTrue;
+               if (stableLocations && ++count == len) doFree = CmiTrue;
                broadcaster->deliver(msg, el, doFree);
        }
 #endif