fixed a subtle out-of-order message deliver case when doing broadcast.
authorGengbin Zheng <gzheng@krakenpf9.nics.utk.edu>
Wed, 21 Sep 2011 05:50:47 +0000 (01:50 -0400)
committerGengbin Zheng <gzheng@krakenpf9.nics.utk.edu>
Wed, 21 Sep 2011 05:50:47 +0000 (01:50 -0400)
In processProcBcastMsg(), first push msg to local queue before calling sending along spanning tree.

src/arch/util/machine-broadcast.c

index 473b0ef3bbc4ac33a6a6ccff185056e9a5de5c1c..3232e5420113b87c7f6c5163bd263f96cc443aea 100644 (file)
@@ -42,18 +42,19 @@ static void processBcastQs() {
 }
 
 static INLINE_KEYWORD void processProcBcastMsg(int size, char *msg) {
-#if CMK_BROADCAST_SPANNING_TREE
-    SendSpanningChildrenProc(size, msg);
-#elif CMK_BROADCAST_HYPERCUBE
-    SendHyperCubeProc(size, msg);
-#endif
-
     /* Since this function is only called on intermediate nodes,
      * the rank of this msg should be 0.
      */
     CmiAssert(CMI_DEST_RANK(msg)==0);
     /*CmiPushPE(CMI_DEST_RANK(msg), msg);*/
     CmiPushPE(0, msg);
+
+#if CMK_BROADCAST_SPANNING_TREE
+    SendSpanningChildrenProc(size, msg);
+#elif CMK_BROADCAST_HYPERCUBE
+    SendHyperCubeProc(size, msg);
+#endif
+
 }
 
 static INLINE_KEYWORD void processNodeBcastMsg(int size, char *msg) {
@@ -102,6 +103,7 @@ static void SendSpanningChildren(int size, char *msg, int rankToAssign, int star
     CMI_DEST_RANK(msg) = oldRank;
 #endif
 }
+
 static void SendHyperCube(int size,  char *msg, int rankToAssign, int startNode) {
 #if CMK_BROADCAST_HYPERCUBE
     int i, cnt, tmp, relDist, oldRank;