lock LateMigrantMsg function so that it works correctly for SMP
authorGengbin Zheng <gzheng@h2ologin1.ncsa.illinois.edu>
Thu, 23 Aug 2012 21:17:23 +0000 (16:17 -0500)
committerGengbin Zheng <gzheng@h2ologin1.ncsa.illinois.edu>
Thu, 23 Aug 2012 21:17:23 +0000 (16:17 -0500)
src/ck-core/ckreduction.C

index c47120c3d7ccde9520f18d876d222aa6b9686736..047cd9fd0c55ece5d9106b16186db2acbc68142e 100644 (file)
@@ -1754,6 +1754,9 @@ void CkNodeReductionMgr::contributeWithCounter(contributorInfo *ci,CkReductionMs
 void CkNodeReductionMgr::ReductionStarting(CkReductionNumberMsg *m)
 {
   CmiLock(lockEverything);
+       /*
+               FAULT_EVAC
+       */
   if(blocked){
        delete m;
        CmiUnlock(lockEverything);
@@ -1919,9 +1922,14 @@ void CkNodeReductionMgr::addContribution(CkReductionMsg *m)
 }
 
 void CkNodeReductionMgr::LateMigrantMsg(CkReductionMsg *m){
+        CmiLock(lockEverything);   
+       /*
+               FAULT_EVAC
+       */
        if(blocked){
                DEBR(("[%d] This node is blocked, so local message is being buffered as no %d\n",CkMyNode(),bufferedMsgs.length()));
                bufferedMsgs.enq(m);
+                CmiUnlock(lockEverything);   
                return;
        }
        
@@ -1935,6 +1943,7 @@ void CkNodeReductionMgr::LateMigrantMsg(CkReductionMsg *m){
                msgs.enq(m);
                finishReduction();
        }
+        CmiUnlock(lockEverything);   
 }