In light of Eric's problems with Projections tracing, I've decided to put
[charm.git] / src / ck-perf / trace-projectionsBOC.h
1 #include "envelope.h"
2 #include "register.h"
3 #include "trace-common.h"
4
5 #ifndef PROJ_ANALYSIS
6 void _registerTraceProjections() {
7   // faked call that does nothing.
8 }
9 #else
10 #include "TraceProjections.decl.h"
11
12 extern CkGroupID traceProjectionsGID;
13
14 class TraceProjectionsInit : public Chare {
15   public:
16   TraceProjectionsInit(CkArgMsg*) {
17     traceProjectionsGID = CProxy_TraceProjectionsBOC::ckNew();
18   }
19   TraceProjectionsInit(CkMigrateMessage *m):Chare(m) {}
20 };
21
22 class OutlierStatsMessage : public CMessage_OutlierStatsMessage {
23  public:
24   double *stats;
25 };
26
27 class OutlierWeightMessage : public CMessage_OutlierWeightMessage {
28  public:
29   int sourcePe;
30   double weight;
31 };
32
33 class OutlierThresholdMessage : public CMessage_OutlierThresholdMessage {
34  public:
35   double threshold;
36 };
37
38 class TraceProjectionsBOC : public CBase_TraceProjectionsBOC {
39 private:
40   double dummy;
41   double endTime;
42   double analysisStartTime;
43   double *execTimes;
44   double weight;
45   int encounteredWeights;
46   double *weightArray;
47   int *mapArray;
48
49   FILE *outlierfp;
50   
51 public:
52   TraceProjectionsBOC(void) {};
53   TraceProjectionsBOC(CkMigrateMessage *m):CBase_TraceProjectionsBOC(m) {};
54   void startOutlierAnalysis();
55   void outlierAverageReduction(CkReductionMsg *);
56   void calculateWeights(OutlierStatsMessage *);
57   void determineOutliers(OutlierWeightMessage *);
58   void setOutliers(OutlierThresholdMessage *);
59   void startEndTimeAnalysis();
60   void endTimeReduction(CkReductionMsg *);
61   void finalReduction(CkReductionMsg *);
62   void shutdownAnalysis(void);
63   void closeTrace(void);
64 };
65 #endif