actually use CMK_CHARMDEBUG (which is off when CCS is disabled in conv-mach)
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 23 Apr 2010 16:22:57 +0000 (11:22 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 23 Apr 2010 16:22:57 +0000 (11:22 -0500)
build with-production disables charmdebug
clean up charmdebug init for bigsim (moving it to debug-charm.C)

build
src/ck-core/debug-charm.C
src/ck-core/init.C
src/ck-core/register.C
src/conv-core/conv-config.h
src/langs/bluegene/blue.C

diff --git a/build b/build
index dd5877a2f4de62f81d43a83a4fab67b12795a419..dc39a749348fc5b4a44e55bedfff93dea0f7dbd3 100755 (executable)
--- a/build
+++ b/build
@@ -344,6 +344,10 @@ do
                CONFIG_OPTS="$CONFIG_OPTS $1"
                shift
                ;;
+    --disable-*)
+               CONFIG_OPTS="$CONFIG_OPTS $1"
+               shift
+               ;;
     -j*)
                 PMAKENUM=`echo $1 | awk -Fj '{print $2}'`
                MAKEOPTS="$MAKEOPTS -j $PMAKENUM"
@@ -547,7 +551,7 @@ then
     echo '#define CMK_OPTIMIZE 1' >> $ConvHeader
     # Prepend optimize so that an explicit -no-optimize still works
     OPTS="-optimize $OPTS"
-    CONFIG_OPTS="--disable-tracing --disable-replay $CONFIG_OPTS"
+    CONFIG_OPTS="--disable-tracing --disable-charmdebug --disable-replay $CONFIG_OPTS"
 fi
 
 # build with Tau
@@ -588,6 +592,7 @@ echo $VERSION | sed -e 's@-.*@@' > $DESTINATION/tmp/.gdir
 if test $BUILD_EMULATOR = 1
 then
   PROGRAM="$PROGRAM bigsim"
+#  CONFIG_OPTS="--disable-charmdebug $CONFIG_OPTS"
 fi
 
 printError()
index 746c195eb7c423db85bca0c4e6b57d5f6e845b86..5b2b9a97593eeb94bc6b2167cb2233875de9d3c0 100644 (file)
@@ -20,7 +20,7 @@
 #include <unistd.h>
 
 
-#if CMK_CCS_AVAILABLE && !defined(_WIN32)
+#if CMK_CHARMDEBUG && CMK_CCS_AVAILABLE && !defined(_WIN32)
 
 #include "ck.h"
 
@@ -847,10 +847,43 @@ void CpdCharmInit()
 #endif
 }
 
+#if CMK_BLUEGENE_CHARM
+CpvExtern(int, _bgCcsHandlerIdx);
+CpvExtern(int, _bgCcsAck);
+extern "C" void req_fw_handler(char*);
+CkpvExtern(void *, debugQueue);
+CkpvExtern(int, freezeModeFlag);
+#include "blue_impl.h"
+extern void BgProcessMessageFreezeMode(threadInfo *, char *);
+
+void CpdBlueGeneInit()
+{
+        // Register the BG handler for CCS. Notice that this is put into a variable shared by
+        // the whole real processor. This because converse needs to find it. We check that all
+        // virtual processors register the same index for this handler.
+        int bgCcsHandlerIdx = CkRegisterHandler((CmiHandler)req_fw_handler);
+        if (CpvAccess(_bgCcsHandlerIdx) == 0) CpvAccess(_bgCcsHandlerIdx) = bgCcsHandlerIdx;
+        CkAssert(CpvAccess(_bgCcsHandlerIdx)==bgCcsHandlerIdx);
+        CpvAccess(_bgCcsAck) ++;
+        CcsReleaseMessages();
+        
+        CkpvInitialize(int, freezeModeFlag);
+        CkpvAccess(freezeModeFlag) = 0;
+
+        CkpvInitialize(void *, debugQueue);
+        CkpvAccess(debugQueue) = CdsFifo_Create();
+        
+        BgProcessMessage = BgProcessMessageFreezeMode;
+}
+#endif
+
 #else
 
 void CpdBreakPointInit() {}
 void CpdCharmInit() {}
+#if CMK_BLUEGENE_CHARM
+void CpdBlueGeneInit() {}
+#endif
 
 void CpdFinishInitialization() {}
 
index e21ec8fb0ea717299579bce7a3adf46c6ed24d30..a1c97f790c542183d32bcab5610519e140c1ca57 100644 (file)
@@ -853,14 +853,8 @@ extern "C" void initQd(char **argv)
         }
 }
 
-#if CMK_BLUEGENE_CHARM && CMK_CCS_AVAILABLE
-CpvExtern(int, _bgCcsHandlerIdx);
-CpvExtern(int, _bgCcsAck);
-extern "C" void req_fw_handler(char*);
-CkpvExtern(void *, debugQueue);
-CkpvExtern(int, freezeModeFlag);
-#include "blue_impl.h"
-extern void BgProcessMessageFreezeMode(threadInfo *, char *);
+#if CMK_BLUEGENE_CHARM && CMK_CHARMDEBUG
+void CpdBlueGeneInit();
 #endif
 void CpdBreakPointInit();
 
@@ -1143,23 +1137,11 @@ void _initCharm(int unused_argc, char **argv)
         CmiInitCPUTopology(argv);
     }
 
-#if CMK_BLUEGENE_CHARM
-        // Register the BG handler for CCS. Notice that this is put into a variable shared by
-        // the whole real processor. This because converse needs to find it. We check that all
-        // virtual processors register the same index for this handler.
-        int bgCcsHandlerIdx = CkRegisterHandler((CmiHandler)req_fw_handler);
-        if (CpvAccess(_bgCcsHandlerIdx) == 0) CpvAccess(_bgCcsHandlerIdx) = bgCcsHandlerIdx;
-        CkAssert(CpvAccess(_bgCcsHandlerIdx)==bgCcsHandlerIdx);
-        CpvAccess(_bgCcsAck) ++;
-        CcsReleaseMessages();
-        
-        CkpvInitialize(int, freezeModeFlag);
-        CkpvAccess(freezeModeFlag) = 0;
-
-        CkpvInitialize(void *, debugQueue);
-        CkpvAccess(debugQueue) = CdsFifo_Create();
-        
-        BgProcessMessage = BgProcessMessageFreezeMode;
+#if CMK_BLUEGENE_CHARM && CMK_CHARMDEBUG
+      // Register the BG handler for CCS. Notice that this is put into a variable shared by
+      // the whole real processor. This because converse needs to find it. We check that all
+      // virtual processors register the same index for this handler.
+    CpdBlueGeneInit();
 #endif
 
        if (faultFunc) {
@@ -1247,7 +1229,7 @@ void _initCharm(int unused_argc, char **argv)
                                         CkpvAccess(_coreState));
         }
 
-#if CMK_CCS_AVAILABLE
+#if CMK_CHARMDEBUG
         // Should not use CpdFreeze inside a thread (since this processor is really a user-level thread)
        if (CpvAccess(cpdSuspendStartup))
        { 
index 353cebd765d86471eef007801c5346bb80146895..d16381d27241bf27d69615302d883f043cc8dcff 100644 (file)
@@ -203,6 +203,7 @@ extern void CpdCharmInit(void);
 
 void _registerDone(void)
 {
+#if CMK_CHARMDEBUG
   CpdListRegister(new CpdSimpleListAccessor("charm/entries",_entryTable.size(),pupEntry));
   CpdListRegister(new CpdSimpleListAccessor("charm/messages",_msgTable.size(),pupMsg));
   CpdListRegister(new CpdSimpleListAccessor("charm/chares",_chareTable.size(),pupChare));
@@ -210,7 +211,6 @@ void _registerDone(void)
   CpdListRegister(new CpdSimpleListAccessor("charm/readonly",_readonlyTable.size(),pupReadonly));
   CpdListRegister(new CpdSimpleListAccessor("charm/readonlyMsg",_readonlyMsgs.size(),pupReadonlyMsg));
 
-#if CMK_CCS_AVAILABLE
   CpdCharmInit();
 #endif
 }
index 22a0701aa3894a3650941891a21749b8b966702e..f513a05e1f7e2870a75fc0a8fc96a90fddc007fa 100644 (file)
@@ -68,6 +68,7 @@
 #define CMK_64BIT                1
 #endif
 
+
 /* set up what production/non-production means */
 #ifdef CMK_OPTIMIZE
 /*
 #define CMK_REPLAYSYSTEM            0
 #endif
 
+#if ! CMK_CCS_AVAILABLE
+#define  CMK_CHARMDEBUG             0
+#endif
+
 #ifndef CMK_TRACE_DISABLED
 #define CMK_TRACE_DISABLED          0
 #endif
index 3679dcba4a2e74efef40ea3db399d5a0eda72290..b0eeb95699c9be04f24df6067177409125d3bf39 100644 (file)
@@ -1412,6 +1412,7 @@ CmiStartFn bgMain(int argc, char **argv)
   int i;
   char *configFile = NULL;
 
+  BgProcessMessage = BgProcessMessageDefault;
 #if CMK_CONDS_USE_SPECIAL_CODE
   // overwrite possible implementation in machine.c
   CmiSwitchToPE = CmiSwitchToPEFn;