Merge branch 'charm' of charmgit:charm into charm
authorGengbin Zheng <gzheng@honest1.ncsa.uiuc.edu>
Fri, 18 Mar 2011 21:29:11 +0000 (16:29 -0500)
committerGengbin Zheng <gzheng@honest1.ncsa.uiuc.edu>
Fri, 18 Mar 2011 21:29:11 +0000 (16:29 -0500)
examples/charm++/load_balancing/kNeighbor/Makefile
src/arch/mpi/conv-common.h
src/arch/mpi/machine.c
src/ck-ldb/HybridBaseLB.C

index 9ba8e4601a046f79bd1fb02918ed9d8a69f9b6c3..592dd96a728ebc556cc7eb74536e37abf7776c61 100644 (file)
@@ -21,8 +21,8 @@ clean:
        rm -f *.decl.h *.def.h conv-host *.o charmrun *~ kNeighbor kNeighbor.prj
 
 test: all
-       ./charmrun +p4 ./kNeighbor 15 100 1024 10 +balancer GreedyLB $(TESTOPTS)
+       ./charmrun +p4 ./kNeighbor 4 50 128 10 +balancer GreedyLB +LBDebug 1 $(TESTOPTS)
 
 bgtest: all
-       ./charmrun +p4 ./kNeighbor 20 100 1024 10 +balancer GreedyLB +x2 +y2 +z1 +cth1 +wth1
+       ./charmrun +p4 ./kNeighbor 4 50 128 10 +balancer GreedyLB +x2 +y2 +z1 +cth1 +wth1 +LBDebug 1 $(TESTOPTS)
 
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
index bbabe32d6f834cdea7fbb96ef0640d12145f23e4..fbf631f9d8a868d21f9154eb6e321a5d5f753315 100644 (file)
@@ -755,13 +755,13 @@ void HybridBaseLB::ObjsMigrated(LDObjData *datas, int m, LDCommData *cdata, int
 void HybridBaseLB::VectorDone(int atlevel)
 {
   LevelData *lData = levelData[atlevel];
-  if (_lb_args.debug()>1)
-    CkPrintf("[%d] VectorDone %d at %f.\n", CkMyPe(), lData->vector_expected, CkWallTimer());
   lData->vector_expected = -1;
   lData->vector_completed = 0;
     // update the migration expected
   lData->migrates_expected = vector_n_moves;
   vector_n_moves = 0;
+  if (_lb_args.debug()>1)
+    CkPrintf("[%d] VectorDone %d %d at %f.\n", CkMyPe(), lData->vector_expected, lData->migrates_expected, CkWallTimer());
 }
 
 // one processor is going to send "count" objects to this processor
@@ -868,7 +868,7 @@ void HybridBaseLB::StatsDone(int atlevel)
   thisProxy[lData->parent].NotifyObjectMigrationDone(atlevel);
 }
 
-// called one a parent node
+// called on a parent node
 void HybridBaseLB::NotifyObjectMigrationDone(int fromlevel)
 {
   int i;