skip the time cost in tracing bigsim
authorGengbin Zheng <gzheng@illinois.edu>
Mon, 3 Aug 2009 03:32:22 +0000 (03:32 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Mon, 3 Aug 2009 03:32:22 +0000 (03:32 +0000)
src/ck-perf/trace-bluegene.C
src/ck-perf/trace-bluegene.h
src/ck-perf/trace.h

index 15b2254e5b5894d29a71801381c792f82abf4f39..b21e7a317baa056bb7ec0d6d64c0a2aae0d6264a 100644 (file)
@@ -110,8 +110,6 @@ void TraceBluegene::bgBeginExec(char* msg, char *name)
   if (!genTimeLog) return;
   BgTimeLog* newLog = new BgTimeLog(msg, name);
   tTIMELINEREC.logEntryStart(newLog);
-  // bypass
-  resetVTime();
 }
 
 // mark a new log, which depends on log
@@ -206,11 +204,9 @@ void TraceBluegene::getForwardDepForAll(void** logs1, void** logs2, int logsize,
 void TraceBluegene::addBackwardDep(void *log)
 {
   if(!genTimeLog || log==NULL) return;
-  double curT = BgGetTime();
   BgTimeLog  *parentLogPtr = BgLastLog(tTIMELINEREC);
   CmiAssert(parentLogPtr);
   BgAddBackwardDep(parentLogPtr, (BgTimeLog*)log);
-  resetVTime();     // bypass this time
 }
 
 void TraceBluegene::userBracketEvent(const char* name, double bt, double et, void** parentLogPtr){
@@ -249,8 +245,6 @@ void TraceBluegene::bgPrint(const char* str){
   if (genTimeLog)
     bgAddProjEvent(strdup(str), -1, curT, writeData, this, BG_EVENT_PRINT);
   CmiPrintf(str, curT);
-  // bypass
-  resetVTime();
   if (CmiMemoryIs(CMI_MEMORY_IS_ISOMALLOC)) isomalloc_pop();
 }
 
@@ -263,8 +257,6 @@ void TraceBluegene::bgMark(char* str){
   double curT = BgGetTime();
   if (genTimeLog)
     bgAddProjEvent(strdup(str), -1, curT, writeData, this, BG_EVENT_MARK);
-  // bypass
-  resetVTime();
 }
 
 extern "C" void BgMark(char *str)
index 435743ff4b588b3e881d349126e831b05108bcd2..fbb37be4a2933c31ef83bb21963cb62bb841eae4 100644 (file)
@@ -53,7 +53,7 @@ CkpvExtern(TraceBluegene*, _tracebg);
 extern int traceBluegeneLinked;
 
 #ifndef CMK_OPTIMIZE
-#  define _TRACE_BG_ONLY(code) do{if(traceBluegeneLinked && CpvAccess(traceOn)){ code; }} while(0)
+#  define _TRACE_BG_ONLY(code) do{ BgGetTime(); if(traceBluegeneLinked && CpvAccess(traceOn)){ code; } resetVTime(); } while(0)
 #else
 #  define _TRACE_BG_ONLY(code) /*empty*/
 #endif
@@ -78,7 +78,7 @@ extern int traceBluegeneLinked;
 
 # define TRACE_BG_AMPI_SUSPEND()     \
        _TRACE_BG_END_EXECUTE(1); \
-        if(CpvAccess(traceOn)) traceSuspend();
+        /* if(CpvAccess(traceOn)) traceSuspend(); */
 
 # define TRACE_BG_AMPI_START(t, str)  { \
         void* _bgParentLog = NULL;      \
@@ -92,7 +92,9 @@ extern int traceBluegeneLinked;
        void *curLog;    /* store current log in timeline */    \
        _TRACE_BG_TLINE_END(&curLog);   \
        TRACE_BG_AMPI_SUSPEND();        \
-        TRACE_BG_AMPI_START(t, str);    \
+        /* TRACE_BG_AMPI_START(t, str);  */  \
+       void * _bgParentLog = NULL;      \
+         _TRACE_BG_BEGIN_EXECUTE_NOMSG(str, &_bgParentLog, 1);  \
         for(int i=0;i<count;i++) {      \
                 _TRACE_BG_ADD_BACKWARD_DEP(((void**)event)[i]);      \
         }      \
index 82d68cf06899d75ec72e8a8241677b054105811c..d5de47863a9fb62e1bac36dcf0c76c1dc8559203 100644 (file)
@@ -269,7 +269,12 @@ public:
 CkpvExtern(TraceArray*, _traces);
 
 #ifndef CMK_OPTIMIZE
+#if CMK_BLUEGENE_CHARM
+extern void    resetVTime();
+#  define _TRACE_ONLY(code) do{ BgGetTime(); if(CpvAccess(traceOn) && CkpvAccess(_traces)->length()>0) { code; }  resetVTime(); } while(0)
+#else
 #  define _TRACE_ONLY(code) do{if(CpvAccess(traceOn) && CkpvAccess(_traces)->length()>0) { code; }} while(0)
+#endif
 #  define _TRACE_ALWAYS(code) do{ code; } while(0)
 #else
 #  define _TRACE_ONLY(code) /*empty*/