Removing CCS tracing code from trace-summary. The working, good version is in trace...
[charm.git] / src / ck-perf / trace-summaryBOC.h
1 #include "ckcallback-ccs.h"
2 #include "TraceSummary.decl.h"
3 #include <deque>
4
5 extern CkGroupID traceSummaryGID;
6 extern bool summaryCcsStreaming;
7
8 class TraceSummaryInit : public Chare {
9  public:
10   TraceSummaryInit(CkArgMsg *m) {
11     traceSummaryGID = CProxy_TraceSummaryBOC::ckNew();
12     CProxy_TraceSummaryBOC sumProxy(traceSummaryGID);
13
14     CkCallback *cb = new CkCallback(CkIndex_TraceSummaryBOC::sendSummaryBOC(NULL), 0, sumProxy);
15     CProxy_TraceSummaryBOC(traceSummaryGID).ckSetReductionClient(cb);
16
17     // No CCS Streaming support until user-code requires it.
18     summaryCcsStreaming = CmiFalse;
19   }
20   TraceSummaryInit(CkMigrateMessage *m):Chare(m) {}
21 };
22
23 class TraceSummaryBOC : public CBase_TraceSummaryBOC {
24 private:
25   int count;
26   BinEntry *bins;
27   int  nBins;
28   int nTracedPEs;
29
30   bool firstTime; // used to make sure traceEnableCCS only has an effect the first time.
31
32 public:
33   /* CCS support variables */
34   int lastRequestedIndexBlock;
35   int indicesPerBlock;
36   double collectionGranularity; /* time in seconds */
37   int nBufferedBins;
38   CkVec<double> *ccsBufferedData;
39   int nextBinIndexCcs;
40
41 public:
42   TraceSummaryBOC(void): count(0), bins(NULL), nBins(0), 
43     nTracedPEs(0), nextBinIndexCcs(0), firstTime(true) {};
44   TraceSummaryBOC(CkMigrateMessage *m):CBase_TraceSummaryBOC(m) {};
45   void startSumOnly();
46   void askSummary(int size);
47   void sendSummaryBOC(CkReductionMsg *);
48
49   /* CCS support methods/entry methods */
50   void initCCS();
51   void ccsRequestSummaryDouble(CkCcsRequestMsg *m);
52   void ccsRequestSummaryUnsignedChar(CkCcsRequestMsg *m);
53
54   void collectSummaryData(double startTime, double binSize, int numBins);
55   void summaryDataCollected(CkReductionMsg *);
56
57 private:
58   void write();
59 };
60
61 void startCollectData(void *data, double currT);