Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TProofBenchRunDataRead.h
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Sangsu Ryu 22/06/2010
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TProofBenchRunDataRead
13 #define ROOT_TProofBenchRunDataRead
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TProofBenchRunDataRead //
18 // //
19 // I/O-intensive PROOF benchmark test reads in event files distributed //
20 // on the cluster. Number of events processed per second and size of //
21 // events processed per second are plotted against number of active //
22 // workers. Performance rate for unit packets and performance rate //
23 // for query are plotted. //
24 // //
25 //////////////////////////////////////////////////////////////////////////
26 
27 #include "TString.h"
28 
29 #include "TProofBenchRun.h"
30 
31 class TProof;
32 class TCanvas;
33 class TH2;
34 class TProfile;
35 class TLegend;
36 class TTree;
37 class TFileCollection;
38 
39 class TProofBenchMode;
40 class TProofBenchDataSet;
41 class TProofNodes;
42 class TPBReadType;
43 
44 class TProofBenchRunDataRead : public TProofBenchRun {
45 
46 private:
47  TProof* fProof; //pointer to proof
48 
49  TPBReadType *fReadType; //read type
50  TProofBenchDataSet *fDS; //dataset operations handler
51 
52  Long64_t fNEvents; //number of events per file
53  Int_t fNTries; //number of tries
54  Int_t fStart; //start number of workers
55  Int_t fStop; //stop number of workers
56  Int_t fStep; //test to be performed every fStep workers
57  Int_t fDebug; //debug switch
58  Int_t fFilesPerWrk; //# of files to be processed per worker
59  Bool_t fReleaseCache; // Release cache for data reads between runs
60 
61  TDirectory *fDirProofBench; //directory for proof outputs
62 
63  TProofNodes *fNodes; //list of nodes information
64 
65  TList *fListPerfPlots; //list of performance plots
66  TProfile *fProfile_perfstat_event;
67  TH2 *fHist_perfstat_event;
68  TProfile *fProfile_perfstat_evtmax;
69  TProfile *fNorm_perfstat_evtmax;
70  TProfile *fProfile_queryresult_event;
71  TProfile *fNorm_queryresult_event;
72  TProfile *fProfile_perfstat_IO;
73  TH2 *fHist_perfstat_IO;
74  TProfile *fProfile_perfstat_IOmax;
75  TProfile *fNorm_perfstat_IOmax;
76  TProfile *fProfile_queryresult_IO;
77  TProfile *fNorm_queryresult_IO;
78  TProfile *fProfile_cpu_eff;
79 
80  TLegend *fProfLegend_evt; // Legend for profiles evts
81  TLegend *fNormLegend_evt; // Legend for norms evts
82  TLegend *fProfLegend_mb; // Legend for profiles mbs
83  TLegend *fNormLegend_mb; // Legend for norms mbs
84 
85  TCanvas *fCPerfProfiles; //canvas for performance profile histograms
86 
87  TString fName; //name of this run
88 
89  void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx);
90 
91 protected:
92 
93  void FillPerfStatProfiles(TTree* t, Int_t nactive);
94 
95  Int_t SetParameters();
96  Int_t DeleteParameters();
97 
98 public:
99 
100  TProofBenchRunDataRead(TProofBenchDataSet *pbds, TPBReadType *readtype = 0,
101  TDirectory* dirproofbench=0, TProof* proof=0, TProofNodes* nodes=0,
102  Long64_t nevents=-1, Int_t ntries=2, Int_t start=1, Int_t stop=-1,
103  Int_t step=1, Int_t debug=0);
104 
105  virtual ~TProofBenchRunDataRead();
106 
107  void Run(Long64_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t) { }
108  void Run(const char *dset, Int_t start, Int_t stop, Int_t step, Int_t ntries,
109  Int_t debug, Int_t);
110 
111  TFileCollection *GetDataSet(const char *dset, Int_t nact, Bool_t nx);
112 
113  void DrawPerfProfiles();
114 
115  void Print(Option_t* option="") const;
116 
117  void SetReadType(TPBReadType *readtype) { fReadType = readtype; }
118  void SetNEvents(Long64_t nevents) { fNEvents = nevents; }
119  void SetNTries(Int_t ntries) { fNTries = ntries; }
120  void SetStart(Int_t start) { fStart = start; }
121  void SetStop(Int_t stop) { fStop = stop; }
122  void SetStep(Int_t step) { fStep = step; }
123  void SetDebug(Int_t debug) { fDebug = debug; }
124  void SetDirProofBench(TDirectory* dir) { fDirProofBench = dir; }
125  void SetFilesPerWrk(Int_t fpw) { fFilesPerWrk = fpw; }
126  void SetReleaseCache(Bool_t on = kTRUE) { fReleaseCache = on; }
127 
128  TPBReadType *GetReadType() const { return fReadType; }
129  Long64_t GetNEvents() const { return fNEvents; }
130  Int_t GetNTries() const { return fNTries; }
131  Int_t GetStart() const { return fStart; }
132  Int_t GetStop() const { return fStop; }
133  Int_t GetStep() const { return fStep; }
134  Int_t GetDebug() const { return fDebug; }
135  TDirectory* GetDirProofBench() const { return fDirProofBench; }
136  TCanvas* GetCPerfProfiles() const { return fCPerfProfiles; }
137  const char* GetName() const { return fName; }
138 
139  TString GetNameStem() const;
140 
141  ClassDef(TProofBenchRunDataRead,0) //IO-intensive PROOF benchmark
142 };
143 
144 #endif