a better tracing scheme that starts/stops timer uniformly and skips time spent in...
authorGengbin Zheng <gzheng@illinois.edu>
Fri, 25 Aug 2006 18:57:25 +0000 (18:57 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Fri, 25 Aug 2006 18:57:25 +0000 (18:57 +0000)
src/ck-perf/trace-bluegene.C
src/ck-perf/trace-bluegene.h

index 89259d9e5801ccaf39c3e5816d9017f20af6ea07..901938dbfbec4b44d6be03cef97f03c4ba698ca7 100644 (file)
@@ -81,8 +81,8 @@ void TraceBluegene::tlineEnd(void** parentLogPtr){
 
 void TraceBluegene::bgDummyBeginExec(char* name,void** parentLogPtr)
 {
-  if (!genTimeLog) return;
   startVTimer();
+  if (!genTimeLog) return;
   double startTime = BgGetCurTime();
   BgTimeLog* newLog = BgStartLogByName(tTIMELINEREC, _threadEP, name, startTime, *(BgTimeLog**)parentLogPtr);
   // if event's mesgID is (-1:-1) and there is no backward dependence
@@ -93,17 +93,19 @@ void TraceBluegene::bgDummyBeginExec(char* name,void** parentLogPtr)
 
 void TraceBluegene::bgBeginExec(char* msg, char *name)
 {
-  if (!genTimeLog) return;
   startVTimer();
+  if (!genTimeLog) return;
   BgTimeLog* newLog = new BgTimeLog(msg, name);
   tTIMELINEREC.logEntryStart(newLog);
+  // bypass
+  resetVTime();
 }
 
 // create a new log, which depends on log
 void TraceBluegene::bgAmpiBeginExec(char *msg, char *name, void *log)
 {
-  if (!genTimeLog) return;
   startVTimer();
+  if (!genTimeLog) return;
   BgTimeLog* newLog = new BgTimeLog(_threadEP,name,BgGetCurTime());
   tTIMELINEREC.logEntryStart(newLog);
   newLog->addBackwardDep((BgTimeLog*)log);
@@ -112,12 +114,12 @@ void TraceBluegene::bgAmpiBeginExec(char *msg, char *name, void *log)
 
 void TraceBluegene::bgEndExec(int commit)
 {
+  stopVTimer();
   if (!genTimeLog) return;
   if (commit) 
     BgLogEntryCommit(tTIMELINEREC);
   else
     BgEndLastLog(tTIMELINEREC);
-  stopVTimer();
 }
 
 
@@ -190,6 +192,8 @@ void TraceBluegene::bgPrint(char* str){
   if (genTimeLog)
     bgAddProjEvent(strdup(str), -1, curT, writeData, this, BG_EVENT_PRINT);
   CmiPrintf(str, curT);
+  // bypass
+  resetVTime();
 }
 
 extern "C" void BgPrintf(char *str)
index f677cbb60114dcee5f9529115187732d41431e91..79ebb2e6efa187abafd4548cb9e4fc3795943b08 100644 (file)
@@ -90,9 +90,10 @@ extern int traceBluegeneLinked;
        }
 #define TRACE_BG_AMPI_WAITALL(reqs)    \
         {      \
-       TRACE_BG_AMPI_SUSPEND();        \
+       /* TRACE_BG_AMPI_SUSPEND(); */  \
        CthThread th = getAmpiInstance(MPI_COMM_WORLD)->getThread();    \
        TRACE_BG_AMPI_START(th, "AMPI_WAITALL") \
+       _TRACE_BG_ADD_BACKWARD_DEP(curLog);     \
        for(int i=0;i<count;i++) {      \
          if (request[i] == MPI_REQUEST_NULL) continue; \
          void *log = (*reqs)[request[i]]->event;       \