Merge branch 'charm' of charmgit:charm into charm
authorGengbin Zheng <gzheng@illinois.edu>
Tue, 13 Apr 2010 16:52:14 +0000 (11:52 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Tue, 13 Apr 2010 16:52:14 +0000 (11:52 -0500)
15 files changed:
src/ck-perf/trace-bluegene.h
src/ck-perf/trace-common.C
src/ck-perf/trace-converse.c
src/ck-perf/trace-projections.C
src/ck-perf/trace-projector.C
src/ck-perf/trace-summary.C
src/ck-perf/trace.h
src/conv-core/conv-config.h
src/conv-core/conv-trace.h
src/conv-core/convcore.c
src/conv-core/threads.c
src/conv-perf/traceCore.C
src/conv-perf/traceCoreAPI.h
src/conv-perf/traceCoreCommon.C
src/libs/ck-libs/ampi/ampi.C

index 7063cb11e8c43e6ec396d1b886c5a277460bf7ed..13621da171d04cbaa8d6861ad83c5ab61d86bd21 100644 (file)
@@ -53,14 +53,14 @@ class TraceBluegene : public Trace {
 CkpvExtern(TraceBluegene*, _tracebg);
 extern int traceBluegeneLinked;
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #  define _TRACE_BG_ONLY(code) do{ BgGetTime(); if(traceBluegeneLinked && CpvAccess(traceOn)){ code; } resetVTime(); } while(0)
 #else
 #  define _TRACE_BG_ONLY(code) /*empty*/
 #endif
 
 /* tracing for Blue Gene - before trace projector era */
-#if !defined(CMK_OPTIMIZE) && CMK_TRACE_IN_CHARM
+#if !CMK_TRACE_DISABLED && CMK_TRACE_IN_CHARM
 // for Sdag only
 // fixme - think of better api for tracing sdag code
 #define BgPrint(x)  _TRACE_BG_ONLY(CkpvAccess(_tracebg)->bgPrint(x))
index 7f0c2c7864b945eb37c5fc71ce4b72ea3ad644ea..85afa6e961d6140ddc5fc54dbc2c395393f726ed 100644 (file)
@@ -38,9 +38,9 @@
 
 CpvCExtern(int, _traceCoreOn);   // projector
 
-#ifdef CMK_OPTIMIZE
+#if CMK_TRACE_DISABLED
 static int warned = 0;
-#define OPTIMIZE_WARNING if (!warned) { warned=1;  CmiPrintf("\n\n!!!! Warning: tracing not available with CMK_OPTIMIZE!\n");  return;  }
+#define OPTIMIZE_WARNING if (!warned) { warned=1;  CmiPrintf("\n\n!!!! Warning: tracing not available with CMK_TRACE_DISABLED!\n");  return;  }
 #else
 #define OPTIMIZE_WARNING /*empty*/
 #endif
@@ -265,7 +265,7 @@ void TraceArray::traceEndOnCommThread() {
 
 /*Install the beginIdle/endIdle condition handlers.*/
 extern "C" void traceBegin(void) {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   DEBUGF(("[%d] traceBegin called with %d at %f\n", CkMyPe(), CpvAccess(traceOn), TraceTimer()));
   
 #if CMK_SMP_TRACE_COMMTHREAD
@@ -285,7 +285,7 @@ extern "C" void traceBegin(void) {
 
 /*Cancel the beginIdle/endIdle condition handlers.*/
 extern "C" void traceEnd(void) {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   DEBUGF(("[%d] traceEnd called with %d at %f\n", CkMyPe(), CpvAccess(traceOn), TraceTimer()));
 
 #if CMK_SMP_TRACE_COMMTHREAD
@@ -301,7 +301,7 @@ if(CmiMyRank()==0){
        
   if (CpvAccess(traceOn)==0) return;
   if (CkpvAccess(_traces) == NULL) {
-    CmiPrintf("Warning: did you mix compilation with and without -DCMK_OPTIMIZE? \n");
+    CmiPrintf("Warning: did you mix compilation with and without -DCMK_TRACE_DISABLED? \n");
   }
   CkpvAccess(_traces)->traceEnd();
   CpvAccess(traceOn) = 0;
@@ -392,7 +392,7 @@ extern "C" void traceCharmInit(char **argv)
 #endif
 }
 
-// CMK_OPTIMIZE is already guarded in convcore.c
+// CMK_TRACE_DISABLED is already guarded in convcore.c
 extern "C"
 void traceMessageRecv(char *msg, int pe)
 {
@@ -401,7 +401,7 @@ void traceMessageRecv(char *msg, int pe)
 #endif
 }
 
-// CMK_OPTIMIZE is already guarded in convcore.c
+// CMK_TRACE_DISABLED is already guarded in convcore.c
 // converse thread tracing is not supported in blue gene simulator
 // in BigSim, threads need to be traced manually (because virtual processors
 // themselves are implemented as threads and we don't want them to be traced
@@ -429,7 +429,7 @@ void traceAwaken(CthThread t)
 extern "C"
 void traceUserEvent(int e)
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   if (CpvAccess(traceOn))
     CkpvAccess(_traces)->userEvent(e);
 #endif
@@ -438,7 +438,7 @@ void traceUserEvent(int e)
 extern "C"
 void traceUserBracketEvent(int e, double beginT, double endT)
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   if (CpvAccess(traceOn) && CkpvAccess(_traces))
     CkpvAccess(_traces)->userBracketEvent(e, beginT, endT);
 #endif
@@ -447,7 +447,7 @@ void traceUserBracketEvent(int e, double beginT, double endT)
 extern "C"
 void traceUserSuppliedData(int d)
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   if (CpvAccess(traceOn) && CkpvAccess(_traces))
     CkpvAccess(_traces)->userSuppliedData(d);
 #endif
@@ -456,7 +456,7 @@ void traceUserSuppliedData(int d)
 extern "C"
 void traceUserSuppliedNote(char * note)
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   if (CpvAccess(traceOn) && CkpvAccess(_traces))
     CkpvAccess(_traces)->userSuppliedNote(note);
 #endif
@@ -467,7 +467,7 @@ extern "C"
 void traceUserSuppliedBracketedNote(char *note, int eventID, double bt, double et)
 {
   //CkPrintf("traceUserSuppliedBracketedNote(char *note, int eventID, double bt, double et)\n");
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   if (CpvAccess(traceOn) && CkpvAccess(_traces))
     CkpvAccess(_traces)->userSuppliedBracketedNote(note, eventID, bt, et);
 #endif
@@ -477,7 +477,7 @@ void traceUserSuppliedBracketedNote(char *note, int eventID, double bt, double e
 extern "C"
 void traceMemoryUsage()
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   double d = CmiMemoryUsage()*1.0;
 
   if (CpvAccess(traceOn) && CkpvAccess(_traces))
@@ -510,7 +510,7 @@ void (*registerMachineUserEvents())() {
 extern "C"
 int traceRegisterUserEvent(const char*x, int e)
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   return CkpvAccess(_traces)->traceRegisterUserEvent(x, e);
 #else
   return 0;
@@ -594,7 +594,7 @@ int CkIsCharmMessage(char *msg)
 // return 1 if any one of tracing modules is linked.
 int  traceAvailable()
 {
-#ifdef CMK_OPTIMIZE
+#if CMK_TRACE_DISABLED
   return 0;
 #else
   return CkpvAccess(_traces)->length()>0;
@@ -628,7 +628,7 @@ void registerFunction(char *name){
 
 extern "C"
 int traceRegisterFunction(const char* name, int idx) {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   if(idx==-999){
     CkpvAccess(_traces)->regFunc(name, idx);
   } else {
index 05b9233e31ba0badef27d9cd402abb4663d70f4f..28a4b8f63a7d314761574f697962dbbf504652ea 100644 (file)
@@ -18,7 +18,7 @@ int traceBluegeneLinked = 0;
 void traceInit(char **argv) {
   CpvInitialize(int, traceOn);
   CpvAccess(traceOn)=0;
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   CpvInitialize(int, _traceCoreOn); 
   CpvAccess(_traceCoreOn)=0; 
   /* initTraceCore(argv); */
index 6c1b79cafc99f58f6612b950bba06a2e18ca4536..eda872b38fc031a6e9ffbc1fe245068d468dc283 100644 (file)
@@ -82,14 +82,14 @@ void flushTraceLog()
   CkpvAccess(_trace)->traceFlushLog();
 }
 
-#ifdef CMK_OPTIMIZE
+#if CMK_TRACE_DISABLED
 static int warned=0;
 #define OPTIMIZED_VERSION      \
        if (!warned) { warned=1;        \
        CmiPrintf("\n\n!!!! Warning: traceUserEvent not available in optimized version!!!!\n\n\n"); }
 #else
 #define OPTIMIZED_VERSION /*empty*/
-#endif // CMK_OPTIMIZE
+#endif // CMK_TRACE_DISABLED
 
 /*
 On T3E, we need to have file number control by open/close files only when needed.
@@ -125,6 +125,7 @@ void _createTraceprojections(char **argv)
   CkpvInitialize(TraceProjections*, _trace);
   CkpvAccess(_trace) = new  TraceProjections(argv);
   CkpvAccess(_traces)->addTrace(CkpvAccess(_trace));
+  if (CkMyPe()==0) CkPrintf("Charm++: Tracemode Projections enabled.\n");
 }
  
 /* ****** CW TEMPORARY LOCATION ***** Support for thread listeners */
@@ -170,7 +171,7 @@ void traceThreadListener_free(struct CthThreadListener *l)
 
 void TraceProjections::traceAddThreadListeners(CthThread tid, envelope *e)
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   /* strip essential information from the envelope */
   TraceThreadListener *a= new TraceThreadListener;
   
@@ -1666,7 +1667,7 @@ void registerOutlierReduction() {
 // FIXME: WHY extern "C"???
 extern "C" void TraceProjectionsExitHandler()
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   // CkPrintf("[%d] TraceProjectionsExitHandler called!\n", CkMyPe());
   CProxy_TraceProjectionsBOC bocProxy(traceProjectionsGID);
   bocProxy.traceProjectionsParallelShutdown(CkMyPe());
index b87ea0ae3906e328a5d7209779c3565b6fedc7a8..4b41a7f167890de679ef01ec8b56accdf3ea0018 100644 (file)
@@ -17,7 +17,7 @@ typedef CkVec<UsrEvent *>   UsrEventVec;
 CkpvStaticDeclare(UsrEventVec, usrEvents);
 
 
-#ifdef CMK_OPTIMIZE
+#if CMK_TRACE_DISABLED
 static int warned=0;
 #define OPTIMIZED_VERSION      \
        if (!warned) { warned=1;        \
index 66976d0d2ea91550eb34e00ab102737a9e11fe33..7a9f6b8e8ea55646e88b8f287cdd8d5d8e074a4d 100644 (file)
@@ -173,6 +173,7 @@ void _createTracesummary(char **argv)
   CkpvAccess(previouslySentBins) = 0;
   CkpvAccess(_trace) = new  TraceSummary(argv);
   CkpvAccess(_traces)->addTrace(CkpvAccess(_trace));
+  if (CkMyPe()==0) CkPrintf("Charm++: Tracemode Summary enabled.\n");
 }
 
 
@@ -1165,7 +1166,7 @@ void TraceSummaryBOC::write(void)
 
 extern "C" void CombineSummary()
 {
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   CmiPrintf("[%d] CombineSummary called!\n", CkMyPe());
   if (sumonly) {
     CmiPrintf("[%d] Sum Only start!\n", CkMyPe());
index e5654c351aa9b50605757283f387f1a2991dcd61..50d2fcb4b80ca0e7c563df900d9286209f7f0efb 100644 (file)
@@ -284,7 +284,7 @@ public:
 
 CkpvExtern(TraceArray*, _traces);
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #if CMK_BLUEGENE_CHARM
 extern void    resetVTime();
 #  define _TRACE_ONLY(code) do{ BgGetTime(); if(CpvAccess(traceOn) && CkpvAccess(_traces)->length()>0) { code; }  resetVTime(); } while(0)
index e2d4a97bd09929f79c21b954dbf11ce98fef974a..79157164f50787a04c66fa2f394b24b112b9ea0a 100644 (file)
 #endif
 #endif
 
+#endif    /* CMK_OPTIMIZE */
+
+#ifndef CMK_TRACE_DISABLED
+#define CMK_TRACE_DISABLED          0
 #endif
 
 #endif
index 68dd7459e8feea2aeccba306b0ae6c4844654c5a..2069fdb8e62b625fa4be7c67d42fd1aa0a724d14 100644 (file)
@@ -53,7 +53,7 @@ void traceEnd(void);
 void traceWriteSts(void);
 void traceFlushLog(void);
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 CpvExtern(int, traceOn);
 #define traceIsOn()  (CpvAccess(traceOn))
 #else 
index f8c0dbf125bf73778de6d53ba5b96816971e4fd8..3975294c770812e6fcec89dfba464f74cf094dc1 100644 (file)
@@ -1745,7 +1745,7 @@ void CthResumeNormalThread(CthThreadToken* token)
     free(token);
     return;
   }
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #if ! CMK_TRACE_IN_CHARM
   if(CpvAccess(traceOn))
     CthTraceResume(t);
@@ -1773,7 +1773,7 @@ void CthResumeSchedulingThread(CthThreadToken  *token)
     CpvAccess(CthSleepingStandins) = me;
   }
   CpvAccess(CthSchedulingThread) = t;
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #if ! CMK_TRACE_IN_CHARM
   if(CpvAccess(traceOn))
     CthTraceResume(t);
@@ -3231,7 +3231,7 @@ void ConverseCommonInit(char **argv)
    }
 #endif
        
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   traceInit(argv);
 /*initTraceCore(argv);*/ /* projector */
 #endif
@@ -3280,7 +3280,7 @@ void ConverseCommonExit(void)
 {
   CcsImpl_kill();
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
   traceClose();
 /*closeTraceCore();*/ /* projector */
 #endif
index ef8eb862fb1771ffe1cb9362213dc543b7e0da59..031a67569ffbcbac744c895a80fb07621b53edd5 100644 (file)
@@ -673,7 +673,7 @@ void CthSuspend(void)
     CmiAbort("A thread's scheduler should not be less than 0!\n");
 #endif    
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #if !CMK_TRACE_IN_CHARM
   if(CpvAccess(traceOn))
     traceSuspend();
@@ -692,7 +692,7 @@ void CthAwaken(CthThread th)
     return;
   } */
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #if ! CMK_TRACE_IN_CHARM
   if(CpvAccess(traceOn))
     traceAwaken(th);
@@ -713,7 +713,7 @@ void CthYield()
 void CthAwakenPrio(CthThread th, int s, int pb, unsigned int *prio)
 {
   if (B(th)->awakenfn == 0) CthNoStrategy();
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
 #if ! CMK_TRACE_IN_CHARM
   if(CpvAccess(traceOn))
     traceAwaken(th);
index 672e1f0b1ff7396579fb14ca8f8a89c0082bef10..23c194f2679c11dcf4cfd07b4898b4877828d977 100644 (file)
@@ -185,7 +185,7 @@ void TraceCore::LogEvent(int lID, int eID, int iLen, const int* iData,double t){
                return;
        }
        CmiPrintf("TraceCore LogEvent called \n");
-#ifndef CMK_OPTIMIZE   
+#if ! CMK_TRACE_DISABLED       
        int *iDataalloc;
        if(iLen != 0){
                iDataalloc = (int *)malloc(iLen*sizeof(int));
@@ -216,7 +216,7 @@ void TraceCore::LogEvent(int lID, int eID, int iLen, const int* iData, int sLen,
        }
                
 
-#ifndef CMK_OPTIMIZE
+#if ! CMK_TRACE_DISABLED
        int *iDataalloc;
        char *sDataalloc;
        if(iLen != 0){
index 61072a1da843190f99c3fe45ea7d1824487ce59e..4d317bc8d443a6f705e6318b19ef21a059ad3c2d 100644 (file)
@@ -7,7 +7,7 @@ CpvCExtern(int,_traceCoreOn);
 extern "C" {
 #endif
 /* Tracing API */
-#if CMK_TRACE_IN_CHARM || defined(CMK_OPTIMIZE)
+#if CMK_TRACE_IN_CHARM || CMK_TRACE_DISABLED
 #define LOGCONDITIONAL(x) 
 #else 
 #define LOGCONDITIONAL(x) do { if(CpvAccess(_traceCoreOn)!=0){ \
index fb8d757fda292145820e33d2d770ee64a292b5e5..9feadbed80ffbd63e6f06c2992e1b00a834b1093 100644 (file)
@@ -85,7 +85,7 @@ extern "C" void RegisterLanguage(int lID, const char* ln)
 extern "C" void RegisterEvent(int lID, int eID)
 { LOGCONDITIONAL(CpvAccess(_traceCore)->RegisterEvent(lID, eID)); }
 
-/* These Log routines will segfault if called under CMK_OPTIMIZE;
+/* These Log routines will segfault if called under CMK_TRACE_DISABLED;
    the solution is to surround their callers with LOGCONDITIONAL. */
 extern "C" void LogEvent(int lID, int eID)
 { CpvAccess(_traceCore)->LogEvent(lID, eID); }
index b9a385ebea221894fd6f483e3443fdcd67b6ab9d..423f9255a748832a8b0e17a5ae231b25b2be9f0a 100644 (file)
@@ -1875,11 +1875,13 @@ ampi::delesend(int t, int sRank, const void* buf, int count, int type,  int rank
 
   arrproxy[destIdx].generic(makeAmpiMsg(destIdx,t,sRank,buf,count,type,destcomm,sync));
 
-#ifndef CMK_OPTIMIZE
+#if 0
+#if ! CMK_TRACE_DISABLED
   int size=0;
   MPI_Type_size(type,&size);
   _LOG_E_AMPI_MSG_SEND(t,destIdx,count,size)
 #endif
+#endif
 }
 
 int