00001 #include "ckcallback-ccs.h"
00002 #include "TraceSummary.decl.h"
00003 #include <deque>
00004
00005 extern CkGroupID traceSummaryGID;
00006 extern bool summaryCcsStreaming;
00007
00008 class TraceSummaryInit : public Chare {
00009 public:
00010 TraceSummaryInit(CkArgMsg *m) {
00011 delete m;
00012 traceSummaryGID = CProxy_TraceSummaryBOC::ckNew();
00013
00014
00015 summaryCcsStreaming = false;
00016 }
00017 TraceSummaryInit(CkMigrateMessage *m):Chare(m) {}
00018 };
00019
00020 class TraceSummaryBOC : public CBase_TraceSummaryBOC {
00021 private:
00022 int count;
00023 BinEntry *bins;
00024 int nBins;
00025 int nTracedPEs;
00026
00027 bool firstTime;
00028 double _maxBinSize;
00029 public:
00030
00031 int lastRequestedIndexBlock;
00032 int indicesPerBlock;
00033 double collectionGranularity;
00034 int nBufferedBins;
00035 CkVec<double> *ccsBufferedData;
00036 int nextBinIndexCcs;
00037
00038 public:
00039 TraceSummaryBOC(void): count(0), bins(NULL), nBins(0),
00040 nTracedPEs(0), firstTime(true), nextBinIndexCcs(0) {}
00041 TraceSummaryBOC(CkMigrateMessage *m):CBase_TraceSummaryBOC(m) {}
00042 void startSumOnly();
00043 void askSummary(int size);
00044 void sendSummaryBOC(double *results, int n);
00045
00046
00047 void initCCS();
00048 void ccsRequestSummaryDouble(CkCcsRequestMsg *m);
00049 void ccsRequestSummaryUnsignedChar(CkCcsRequestMsg *m);
00050
00051 void collectSummaryData(double startTime, double binSize, int numBins);
00052 void summaryDataCollected(double *recvData, int numBins);
00053
00054 void traceSummaryParallelShutdown(int pe);
00055 void maxBinSize(double _maxBinSize);
00056 void shrink(double _maxBinSize);
00057
00058 void sumData(double *sumData, int totalsize);
00059
00060 private:
00061 void write();
00062 };
00063
00064 void startCollectData(void *data, double currT);