In light of Eric's problems with Projections tracing, I've decided to put
authorChee Wai Lee <cheelee@illinois.edu>
Mon, 12 Mar 2007 22:13:59 +0000 (22:13 +0000)
committerChee Wai Lee <cheelee@illinois.edu>
Mon, 12 Mar 2007 22:13:59 +0000 (22:13 +0000)
a big #ifdef around my code to protect others from any strange changes to
the runtime while allowing me to work on my thesis unharassed.

I suspect I'll continue to be harassed for some of the failures for a while.

src/ck-perf/trace-projections.C
src/ck-perf/trace-projectionsBOC.h

index 27148906059db8bbde930059e0a1a67d78d16633..3d65d40bec3d661eeddd6a85aad8baadcc593a1f 100644 (file)
@@ -893,6 +893,7 @@ void TraceProjections::traceWriteSts(void)
 // trace module will un-register itself from TraceArray if it did.
 void TraceProjections::traceClose(void)
 {
+#ifdef PROJ_ANALYSIS
   // CkPrintf("CkExit was not called on shutdown on [%d]\n", CkMyPe());
   // sets the flag that tells the code not to make the CkExit call later
   converseExit = 1;
@@ -900,6 +901,20 @@ void TraceProjections::traceClose(void)
     CProxy_TraceProjectionsBOC bocProxy(traceProjectionsGID);
     bocProxy.shutdownAnalysis();
   }
+#else
+  // we've already deleted the logpool, so multiple calls to traceClose
+  // are tolerated.
+  if (_logPool == NULL) {
+    return;
+  }
+  if(CkMyPe()==0){
+    _logPool->writeSts(this);
+  }
+  CkpvAccess(_trace)->endComputation();
+  delete _logPool;              // will write
+  // remove myself from traceArray so that no tracing will be called.
+  CkpvAccess(_traces)->removeTrace(this);
+#endif
 }
 
 // This is meant to be called internally rather than by converse.
@@ -1328,6 +1343,7 @@ void toProjectionsGZFile::bytes(void *p,int n,size_t itemSize,dataType t)
 }
 #endif
 
+#ifdef PROJ_ANALYSIS
 void TraceProjectionsBOC::shutdownAnalysis() {
   if (CkMyPe() == 0) {
     analysisStartTime = CmiWallTimer();
@@ -1655,5 +1671,6 @@ void initTraceProjectionsBOC()
   }
 
 #include "TraceProjections.def.h"
+#endif
 
 /*@}*/
index 021a68c54a246c7f9fe32e2b570c0628c5820ddb..f1fa5ecc72211428ec1179737a37b5ffe15b5b3c 100644 (file)
@@ -2,6 +2,11 @@
 #include "register.h"
 #include "trace-common.h"
 
+#ifndef PROJ_ANALYSIS
+void _registerTraceProjections() {
+  // faked call that does nothing.
+}
+#else
 #include "TraceProjections.decl.h"
 
 extern CkGroupID traceProjectionsGID;
@@ -57,5 +62,4 @@ public:
   void shutdownAnalysis(void);
   void closeTrace(void);
 };
-
-
+#endif