fix barrier problem for MPI
authorYanhuaSun <sun51@illinois.edu>
Tue, 26 Mar 2013 19:37:31 +0000 (14:37 -0500)
committerYanhuaSun <sun51@illinois.edu>
Tue, 26 Mar 2013 19:37:31 +0000 (14:37 -0500)
src/arch/util/machine-common-core.c

index 7b246caedb88a5b2353c836f83e42a7212779490..0a362afab3b9fdae1df61534bf9dffecba51d96c 100644 (file)
@@ -1218,8 +1218,13 @@ int CmiBarrier() {
     /* make sure all ranks reach here, otherwise comm threads may reach barrier ignoring other ranks  */
     CmiNodeAllBarrier();
 #endif
+#if ( CMK_SMP && !NO_COMM_THREAD )
+    if (CmiMyRank() == CmiMyNodeSize())
+    {
+#else
     if (CmiMyRank() == 0)
     {
+#endif
         LrtsBarrier();
     }
 #if CMK_SMP