added macros and functinos calls to trace ampi applicaiton and generate bluegene...
authorGengbin Zheng <gzheng@illinois.edu>
Wed, 10 Sep 2003 16:30:18 +0000 (16:30 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Wed, 10 Sep 2003 16:30:18 +0000 (16:30 +0000)
src/ck-perf/trace-bluegene.C
src/ck-perf/trace-bluegene.h

index 5596b3e7e7e9c86600d00955f7151d46c911054c..3f74b91d541fb5733a197601e9c4f18ef28a6481 100644 (file)
@@ -150,6 +150,15 @@ void TraceBluegene::getForwardDepForAll(void** logs1, void** logs2, int logsize,
       cLog->addBackwardDep((bgTimeLog*)(logs1[j]));
 }
 
+void TraceBluegene::addBackwardDep(void *log)
+{
+  if(!genTimeLog || log==NULL) return;
+  CmiAssert(tTIMELINE.length() > 0);
+  bgTimeLog  *parentLogPtr = (bgTimeLog*)tTIMELINE[tTIMELINE.length()-1];
+  CmiAssert(parentLogPtr);
+  parentLogPtr->addBackwardDep((bgTimeLog*)log);
+}
+
 void TraceBluegene::userBracketEvent(char* name, double bt, double et, void** parentLogPtr){
 
   if (!genTimeLog) return;
index d7cec83f150bc5d5a858adc96f258215664ef7f4..5b18955dc39c69977552a64427c134970f90d38d 100644 (file)
@@ -34,6 +34,7 @@ class TraceBluegene : public Trace {
     void bgDummyBeginExec(char* name,void** parentLogPtr);
     void bgBeginExec(char* msg);
     void bgEndExec(int);
+    void addBackwardDep(void *log);
     void userBracketEvent(int eventID, double bt, double et) {}        // from trace.h
     void userBracketEvent(char* name, double bt, double et, void** parentLogPtr);
     void userBracketEvent(char* name, double bt, double et, void** parentLogPtr, CkVec<void*> bgLogList);
@@ -61,6 +62,7 @@ extern int traceBluegeneLinked;
 #define _TRACE_BG_END_EXECUTE(commit)   _TRACE_BG_ONLY(CkpvAccess(_tracebg)->bgEndExec(commit))
 #define _TRACE_BG_TLINE_END(pLogPtr) _TRACE_BG_ONLY(CkpvAccess(_tracebg)->tlineEnd(pLogPtr))
 #define _TRACE_BG_FORWARD_DEPS(logs1,logs2,size,fDep)  _TRACE_BG_ONLY(CkpvAccess(_tracebg)->getForwardDepForAll(logs1,logs2, size,fDep))
+#define _TRACE_BG_ADD_BACKWARD_DEP(log)  _TRACE_BG_ONLY(CkpvAccess(_tracebg)->addBackwardDep(log))
 #define _TRACE_BG_USER_EVENT_BRACKET(x,bt,et,pLogPtr) _TRACE_BG_ONLY(CkpvAccess(_tracebg)->userBracketEvent(x,bt,et,pLogPtr))
 #define _TRACE_BGLIST_USER_EVENT_BRACKET(x,bt,et,pLogPtr,bgLogList) _TRACE_BG_ONLY(CkpvAccess(_tracebg)->userBracketEvent(x,bt,et,pLogPtr,bgLogList))
 
@@ -76,10 +78,19 @@ extern int traceBluegeneLinked;
         void* _bgParentLog = NULL;      \
         _TRACE_BG_BEGIN_EXECUTE_NOMSG(str, &_bgParentLog);      \
         if(CpvAccess(traceOn)) CthTraceResume(t);
+# define TRACE_BG_NEWSTART(t, str, event, count)       \
+       TRACE_BG_SUSPEND();     \
+       TRACE_BG_START(t, str); \
+       {       \
+       for(int i=0;i<count;i++) {      \
+                _TRACE_BG_ADD_BACKWARD_DEP(event);     \
+        }      \
+       }
 #else
 # define TRACE_BG_SUSPEND()
 # define TRACE_BG_RESUME(t, msg)
 # define TRACE_BG_START(t, str)
+# define TRACE_BG_NEWSTART(t, str, events, count)
 #endif   /* CMK_TRACE_IN_CHARM */
 
 #endif