little tweak in getNonLocal to only call network progress engine when no message
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 16 Sep 2011 13:45:48 +0000 (06:45 -0700)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 16 Sep 2011 13:45:48 +0000 (06:45 -0700)
src/arch/util/machine-common-core.c

index 3a2d2f71b8786382f9e6cadc9919dbf4bf482898..148171c65d9d2e9f5e88b8909dd56ce383fcaebb 100644 (file)
@@ -818,12 +818,14 @@ void *CmiGetNonLocal(void) {
     CmiIdleLock_checkMessage(&cs->idle);
     /* ?????although it seems that lock is not needed, I found it crashes very often
        on mpi-smp without lock */
+    msg = PCQueuePop(cs->recv);
 #if !CMK_SMP
-    AdvanceCommunication();
+    if (!msg) {
+       AdvanceCommunication();
+       msg = PCQueuePop(cs->recv);
+    } 
 #endif
 
-    msg = PCQueuePop(cs->recv);
-
 #if !CMK_SMP
     LrtsPostNonLocal();
 #endif
@@ -832,6 +834,7 @@ void *CmiGetNonLocal(void) {
 
     return msg;
 }
+
 #if CMK_NODE_QUEUE_AVAILABLE
 void *CmiGetNonLocalNodeQ(void) {
     CmiState cs = CmiGetState();