Adding a ControlPointsNoTrace module that provides the control point interface but...
authorIsaac Dooley <idooley2@illinois.edu>
Mon, 5 Apr 2010 20:20:43 +0000 (15:20 -0500)
committerIsaac Dooley <idooley2@illinois.edu>
Mon, 5 Apr 2010 20:20:43 +0000 (15:20 -0500)
src/ck-cp/arrayRedistributor.C
src/ck-cp/arrayRedistributor.h
src/ck-cp/controlPoints.C
src/ck-cp/controlPoints.h
src/ck-cp/controlPointsNoTrace.ci [new file with mode: 0644]
src/scripts/Makefile

index 920eb6f6bf2e34e9b56397610cf30dee02c1f7a5..a24eda993a55c7b14902ca98a9c0878c0fd74f0e 100644 (file)
@@ -13,7 +13,7 @@
 //#include <sys/time.h>
 #include <float.h>
 
-#include "ControlPoints.decl.h"
+//#include "ControlPoints.decl.h"
 #include "trace-controlPoints.h"
 #include "LBDatabase.h"
 #include "controlPoints.h"
index 28f9f47a3051f8ef00116bf01388c9258cfa4d17..faf2a76f99e0c30dd1210e799eeea828ad240397 100644 (file)
@@ -11,7 +11,7 @@
 #include <list>
 #include <map>
 #include <cmath>
-#include "ControlPoints.decl.h"
+//#include "ControlPoints.decl.h"
 
 #include<pup_stl.h>
 
index 4ad77b5b3697314926021b6cffd3cf9e6cbf701f..975d8370b96487837c4706502353244216444c9d 100644 (file)
@@ -1,4 +1,8 @@
 #include <charm++.h>
+
+// This file is compiled twice to make a version that is capable of not needing the tracing to be turned on. 
+// The Makefile will have -DCP_DISABLE_TRACING
+
 #include "controlPoints.h"
 #include "trace-controlPoints.h"
 #include "LBDatabase.h"
@@ -614,6 +618,7 @@ controlPointManager::controlPointManager() {
   /// Called by either the application or the Control Point Framework to advance to the next phase  
   void controlPointManager::gotoNextPhase(){
     
+#ifndef CP_DISABLE_TRACING
     CkPrintf("gotoNextPhase shouldGatherAll=%d\n", (int)shouldGatherAll);
     fflush(stdout);
 
@@ -642,12 +647,12 @@ controlPointManager::controlPointManager() {
     }
     
 
+#endif
 
 
 
-    LBDatabase * myLBdatabase = LBDatabaseObj();
-
 #if CMK_LBDB_ON && 0
+    LBDatabase * myLBdatabase = LBDatabaseObj();
     LBDB * myLBDB = myLBdatabase->getLBDB();       // LBDB is Defined in LBDBManager.h
     const CkVec<LBObj*> objs = myLBDB->getObjs();
     const int objCount = myLBDB->getObjCount();
@@ -709,6 +714,7 @@ controlPointManager::controlPointManager() {
   
   /// Entry method called on all PEs to request CPU utilization statistics
   void controlPointManager::requestIdleTime(CkCallback cb){
+#ifndef CP_DISABLE_TRACING
     double i = localControlPointTracingInstance()->idleRatio();
     double idle[3];
     idle[0] = i;
@@ -720,10 +726,14 @@ controlPointManager::controlPointManager() {
     localControlPointTracingInstance()->resetTimings();
 
     contribute(3*sizeof(double),idle,idleTimeReductionType, cb);
+#else
+    CkAbort("Should not get here\n");
+#endif
   }
   
   /// All processors reduce their memory usages in requestIdleTime() to this method
   void controlPointManager::gatherIdleTime(CkReductionMsg *msg){
+#ifndef CP_DISABLE_TRACING
     int size=msg->getSize() / sizeof(double);
     CkAssert(size==3);
     double *r=(double *) msg->getData();
@@ -742,6 +752,9 @@ controlPointManager::controlPointManager() {
     alreadyRequestedIdleTime = false;
     checkForShutdown();
     delete msg;
+#else
+    CkAbort("Should not get here\n");
+#endif
   }
 
 
@@ -751,6 +764,7 @@ controlPointManager::controlPointManager() {
 
   /// Entry method called on all PEs to request CPU utilization statistics and memory usage
   void controlPointManager::requestAll(CkCallback cb){
+#ifndef CP_DISABLE_TRACING
     TraceControlPoints *t = localControlPointTracingInstance();
 
     double data[ALL_REDUCTION_SIZE];
@@ -784,10 +798,14 @@ controlPointManager::controlPointManager() {
     localControlPointTracingInstance()->resetAll();
 
     contribute(ALL_REDUCTION_SIZE*sizeof(double),data,allMeasuresReductionType, cb);
+#else
+    CkAbort("Should not get here\n");
+#endif
   }
   
   /// All processors reduce their memory usages in requestIdleTime() to this method
   void controlPointManager::gatherAll(CkReductionMsg *msg){
+#ifndef CP_DISABLE_TRACING
     CkAssert(msg->getSize()==ALL_REDUCTION_SIZE*sizeof(double));
     int size=msg->getSize() / sizeof(double);
     double *data=(double *) msg->getData();
@@ -846,6 +864,9 @@ controlPointManager::controlPointManager() {
     alreadyRequestedAll = false;
     checkForShutdown();
     delete msg;
+#else
+    CkAbort("Should not get here\n");
+#endif
   }
 
 
@@ -2280,5 +2301,8 @@ void ControlPointWriteOutputToDisk(){
 
 /*! @} */
 
-
+#ifdef CP_DISABLE_TRACING
+#include "ControlPointsNoTrace.def.h"
+#else
 #include "ControlPoints.def.h"
+#endif
index 4f8015177fc1fa0160743bf4c85d9051f1d87898..4ab96fe86bc02956f72d2d644849628527f3268b 100644 (file)
@@ -4,14 +4,21 @@
     to the dynamic optimization framework.
 
 */
+
+
 #ifndef __CONTROLPOINTS_H__
 #define __CONTROLPOINTS_H__
 
+
+#ifdef CP_DISABLE_TRACING
+#include "ControlPointsNoTrace.decl.h"
+#else
+#include "ControlPoints.decl.h"
+#endif
+
 #include <vector>
 #include <map>
 #include <cmath>
-#include "ControlPoints.decl.h"
-
 #include <pup_stl.h>
 #include <string>
 #include <set>
diff --git a/src/ck-cp/controlPointsNoTrace.ci b/src/ck-cp/controlPointsNoTrace.ci
new file mode 100644 (file)
index 0000000..b0ab5ae
--- /dev/null
@@ -0,0 +1,63 @@
+module ControlPointsNoTrace {
+
+  readonly CProxy_controlPointManager controlPointManagerProxy;
+  readonly int random_seed;
+  readonly long controlPointSamplePeriod;
+  readonly int whichTuningScheme;
+  readonly bool shouldGatherMemoryUsage;
+  readonly bool shouldGatherUtilization;
+  readonly bool shouldGatherAll;
+  readonly char CPDataFilename[512];
+
+  readonly bool shouldFilterOutputData;
+  readonly bool writeDataFileAtShutdown;
+
+  initproc void registerCPReductions(void);    
+
+
+ message controlPointMsg { 
+        char data[];
+ };
+
+
+ message redistributor2DMsg {  
+       double data[]; 
+ }; 
+
+  mainchare controlPointMain {
+    entry controlPointMain(CkArgMsg*);
+  };
+
+ initnode void controlPointInitNode();
+
+ group  [migratable]  controlPointManager {
+    entry controlPointManager();
+
+    entry [expedited] void requestMemoryUsage(CkCallback cb);
+    entry [expedited] void gatherMemoryUsage(CkReductionMsg *msg);
+
+    entry [expedited] void requestIdleTime(CkCallback cb);
+    entry [expedited] void gatherIdleTime(CkReductionMsg *msg);
+
+    entry [expedited] void requestAll(CkCallback cb);
+    entry [expedited] void gatherAll(CkReductionMsg *msg);
+  
+ }   
+
+
+  array [2D] redistributor2D {
+   entry redistributor2D(void);
+
+   entry void startup();       
+   
+    entry void resizeGranules(int, int);
+    entry void receiveTransposeData(redistributor2DMsg *msg);
+
+  } 
+
+
+
+
+};
index ba0cef475537d777943abe6be83c3c8dd79ee414..f42eadc111a76908ef2510dbccd5d79c86013c04 100644 (file)
@@ -899,11 +899,21 @@ ControlPoints.def.h: ControlPoints.decl.h
 ControlPoints.decl.h : controlPoints.ci charmxi
        $(CHARMXI) controlPoints.ci
 
-controlPoints_objs: $(L)/libmoduleControlPoints.a
+ControlPointsNoTrace.def.h: ControlPointsNoTrace.decl.h
+
+ControlPointsNoTrace.decl.h : ControlPointsNoTrace.ci charmxi
+       $(CHARMXI) ControlPointsNoTrace.ci
+
+controlPoints_objs: $(L)/libmoduleControlPoints.a $(L)/libmoduleControlPointsNoTrace.a
 
 $(L)/libmoduleControlPoints.a: $(CONTROLPOINTS_OBJS)
        $(CHARMC) -o $(L)/libmoduleControlPoints.a $(CONTROLPOINTS_OBJS)
 
+$(L)/libmoduleControlPointsNoTrace.a: controlPointsNoTrace.o arrayRedistributor.o cp_effects.o
+       $(CHARMC) -o $(L)/libmoduleControlPointsNoTrace.a controlPointsNoTrace.o arrayRedistributor.o cp_effects.o
+
+controlPointsNoTrace.o: controlPoints.C controlPoints.h ControlPointsNoTrace.decl.h
+       $(CHARMC) -c controlPoints.C -o controlPointsNoTrace.o -DCP_DISABLE_TRACING $(OPTS)
 
 ######################################################################
 #