fixed that bug that prevent charm converse broadcast to work on num of pes greater...
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 18 Mar 2011 04:39:23 +0000 (23:39 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 18 Mar 2011 04:39:23 +0000 (23:39 -0500)
Fixed it by expanding it to a UInt4.
Prevent the header size from increasing by remove the error checking fields (magic and checksum) to be only used when --enable-error-checking.
Production build of mpi layer should not be affected.

src/arch/mpi/conv-common.h
src/arch/mpi/machine.c

index d3f5bbcf5c8eac61f79ba47f9ddbab529c8e6ddc..ef07391c37ae954f1ee05e7e9aabe14d14df53a4 100644 (file)
@@ -7,7 +7,11 @@
 
 #define CMK_HANDLE_SIGUSR                                  1
 
-#define CMK_MSG_HEADER_EXT_    CmiUInt2 rank, root, hdl,xhdl,info, stratid; unsigned char cksum, magic; CmiUInt2 redID;
+#if CMK_ERROR_CHECKING
+#define CMK_MSG_HEADER_EXT_    CmiUInt2 rank, hdl,xhdl,info, stratid, redID; CmiUInt4 root; unsigned char cksum, magic;
+#else
+#define CMK_MSG_HEADER_EXT_    CmiUInt2 rank, hdl,xhdl,info, stratid, redID; CmiUInt4 root; 
+#endif
 #define CMK_MSG_HEADER_BASIC  CMK_MSG_HEADER_EXT
 #define CMK_MSG_HEADER_EXT    { CMK_MSG_HEADER_EXT_ }
 #define CMK_MSG_HEADER_BLUEGENE    { CMK_MSG_HEADER_EXT_ CMK_BLUEGENE_FIELDS }
index e0832c918ff50ff05096296e81f244cde869949d..4c0c96be66f9953649e86fa104fbd2da8c2ee465 100644 (file)
@@ -108,7 +108,7 @@ CpvStaticDeclare(double, projTraceStart);
 /* FIXME: need a random number that everyone agrees ! */
 #define CHARM_MAGIC_NUMBER              126
 
-#if !CMK_OPTIMIZE
+#if CMK_ERROR_CHECKING
 static int checksum_flag = 0;
 #define CMI_SET_CHECKSUM(msg, len)     \
        if (checksum_flag)  {   \
@@ -765,12 +765,14 @@ int PumpMsgs(void)
        
     MACHSTATE2(3,"PumpMsgs recv one from node:%d to rank:%d", sts.MPI_SOURCE, CMI_DEST_RANK(msg));
     CMI_CHECK_CHECKSUM(msg, nbytes);
+#if CMK_ERROR_CHECKING
     if (CMI_MAGIC(msg) != CHARM_MAGIC_NUMBER) { /* received a non-charm msg */
       CmiPrintf("Charm++ Abort: Non Charm++ Message Received of size %d. \n", nbytes);
       CmiFree(msg);
       CmiAbort("Abort!\n");
       continue;
     }
+#endif
        
 #if CMK_BROADCAST_SPANNING_TREE
     if (CMI_BROADCAST_ROOT(msg))
@@ -1194,7 +1196,9 @@ static int SendMsgBuf()
        PumpMsgs();
       }
       MACHSTATE2(3,"MPI_send to node %d rank: %d{", node, CMI_DEST_RANK(msg));
+#if CMK_ERROR_CHECKING
       CMI_MAGIC(msg) = CHARM_MAGIC_NUMBER;
+#endif
       CMI_SET_CHECKSUM(msg, size);
 
 #if MPI_POST_RECV_COUNT > 0
@@ -1324,7 +1328,9 @@ CmiCommHandle CmiAsyncSendFn_(int destPE, int size, char *msg)
        CmiReleaseSentMessages();
        PumpMsgs();
   }
+#if CMK_ERROR_CHECKING
   CMI_MAGIC(msg) = CHARM_MAGIC_NUMBER;
+#endif
   CMI_SET_CHECKSUM(msg, size);
 
 #if MPI_POST_RECV_COUNT > 0