Logo ROOT  
Reference Guide
TProofBench.h
Go to the documentation of this file.
1 // @(#)root/proofx:$Id$
2 // Author: G.Ganis, S.Ryu Feb 2011
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_TProofBench
13 #define ROOT_TProofBench
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TProofBench //
18 // //
19 // Steering class for PROOF benchmarks //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TObject.h"
24 #include "TProofBenchTypes.h"
25 #include "TString.h"
26 
27 
28 class TF1;
29 class TFile;
30 class TGraphErrors;
31 class TProfile;
32 class TProof;
33 class TProofBenchRunCPU;
35 class TProofBenchDataSet;
36 
37 class TProofBench : public TObject {
38 
39 private:
40  Bool_t fUnlinkOutfile; // Whether to remove empty output files
41 
42 protected:
43 
44  TProof* fProof; // Proof
45  TProof* fProofDS; // Proof to be used for dataset actions
46  TFile *fOutFile; // Output file
47  TString fOutFileName; // Name of the output file
48  Int_t fNtries; // Number of times a measurement is repeated
49  TPBHistType *fHistType; // Type of histograms for CPU runs
50  Int_t fNHist; // Number of histograms to be created in default CPU runs
51  TPBReadType *fReadType; // Type of read (partial, full)
52  TString fDataSet; // Name of the dataset
53  Int_t fNFilesWrk; // Number of files generated files per worker
54  Int_t fNumWrkMax; // Max number of workers (required for dynamic setups)
55  Bool_t fReleaseCache; // Release cache for data reads between runs
56 
57  TString fCPUSel; // Selector to be used for CPU benchmarks
58  TString fCPUPar; // List of par files to be loaded for CPU benchmarks
59  TString fDataSel; // Selector to be used for data benchmarks
60  TString fDataPar; // List of par files to be loaded for data benchmarks
61  TString fDataGenSel; // Selector to be used for generate data for benchmarks
62  TString fDataGenPar; // List of par files to be loaded to generate data for benchmarks
63  TString fSelOption; // Option field for processing the selector
64 
65  TProofBenchRunCPU *fRunCPU; // Instance to run CPU scans
66  TProofBenchRunDataRead *fRunDS; // Instance to run data-read scans
67  TProofBenchDataSet *fDS; // Instance to handle datasets operations
68 
69  Bool_t fDebug; // Debug switch
70 
71  TNamed *fDescription; // Strings describing the cluster for this test (saved in the output file)
72 
73  static TGraphErrors *GetGraph(TDirectory *d, const char *pfn,
74  Int_t &nb, Double_t &xmi, Double_t &xmx,
75  Double_t &ymi, Double_t &ymx, Int_t &kmx, TProfile *&pf);
76 
77  static TF1 *fgFp1; // Simple 1st degree polynomial
78  static TF1 *fgFp1n; // Normalized 1st degree
79  static TF1 *fgFp2; // Simple 2nd degree polynomial
80  static TF1 *fgFp2n; // Normalized 2nd degree
81  static TF1 *fgFp3; // Function with varying Rcpu
82  static TF1 *fgFp3n; // Normalized Function with varying Rcpu
83 
84  static TF1 *fgFio; // Function used for I/O rate fits
85  static TF1 *fgFioV; // Function used for I/O rate fits with non-constant Rcpu
86 
87  static TList *fgGraphs; // List of TGraphErrors created by Draw actions
88 
89  static void AssertFittingFun(Double_t mi, Double_t mx);
90 
91 public:
92 
93  TProofBench(const char *url, const char *outfile = "<default>", const char *proofopt = 0);
94 
95  virtual ~TProofBench();
96 
97  Int_t RunCPU(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1, Int_t step=-1);
98  Int_t RunCPUx(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1);
99  Int_t RunDataSet(const char *dset = "BenchDataSet",
100  Int_t start = 1, Int_t stop = -1, Int_t step = 1);
101  Int_t RunDataSetx(const char *dset = "BenchDataSet", Int_t start = 1, Int_t stop = -1);
102 
103  Int_t CopyDataSet(const char *dset, const char *dsetdst, const char *destdir);
104  Int_t MakeDataSet(const char *dset = 0, Long64_t nevt = -1, const char *fnroot = "event",
105  Bool_t regenerate = kFALSE);
106  Int_t ReleaseCache(const char *dset);
107  Int_t RemoveDataSet(const char *dset);
108 
109  void CloseOutFile();
111  Int_t SetOutFile(const char *outfile, Bool_t verbose = kTRUE);
112  const char *GetOutFileName() const { return fOutFileName; }
113  void SetNFilesWrk(Int_t nf = 0) { fNFilesWrk = (nf > 0) ? nf : 4; }
114  void SetNTries(Int_t nt) { if (nt > 0) fNtries = nt; }
115  void SetHistType(TPBHistType *histtype) { fHistType = histtype; }
116  void SetNHist(Int_t nh) { fNHist = nh; }
117  void SetReadType(TPBReadType *readtype) { fReadType = readtype; }
119 
120  void SetCPUSel(const char *sel) { fCPUSel = sel; }
121  void SetCPUPar(const char *par) { fCPUPar = par; }
122  void SetDataSel(const char *sel) { fDataSel = sel; }
123  void SetDataPar(const char *par) { fDataPar = par; }
124  void SetDataGenSel(const char *sel) { fDataGenSel = sel; }
125  void SetDataGenPar(const char *par) { fDataGenPar = par; }
126  void SetSelOption(const char *opt) { fSelOption = opt; }
127 
128  void SetProofDS(TProof *p);
129 
130  void SetDebug(Bool_t debug = kTRUE) { fDebug = debug; }
131 
132  Bool_t GetDebug() { return fDebug; }
133 
134  static void DrawCPU(const char *outfile, const char *opt = "std:", Bool_t verbose = kFALSE,
135  Int_t dofit = 0, Int_t n0 = -1, Int_t n1 = -1);
136  static void DrawDataSet(const char *outfile, const char *opt = "std:", const char *type = "mbs", Bool_t verbose = kFALSE,
137  Int_t dofit = 0, Int_t n0 = -1, Int_t n1 = -1);
138  static void GetPerfSpecs(const char *path = ".", Int_t degfit = 1);
139  static void DrawEfficiency(const char *outfile, const char *opt = "", Bool_t verbose = kFALSE);
140 
141  static TList *GetGraphs() { return fgGraphs; }
142 
143  ClassDef(TProofBench, 0) // Steering class for PROOF benchmarks
144 };
145 
146 #endif
TProofBenchTypes.h
TProofBench::SetOutFile
Int_t SetOutFile(const char *outfile, Bool_t verbose=kTRUE)
Set the output file Return 0 on success, -1 on error.
Definition: TProofBench.cxx:296
TProofBench::CloseOutFile
void CloseOutFile()
Close output file.
Definition: TProofBench.cxx:327
TProofBench::GetOutFileName
const char * GetOutFileName() const
Definition: TProofBench.h:112
TProofBench::fProof
TProof * fProof
Definition: TProofBench.h:44
TProofBench::SetReadType
void SetReadType(TPBReadType *readtype)
Definition: TProofBench.h:117
TProofBench::SetDataSel
void SetDataSel(const char *sel)
Definition: TProofBench.h:122
TProofBench::CopyDataSet
Int_t CopyDataSet(const char *dset, const char *dsetdst, const char *destdir)
Copy the files of dataset 'dset' to 'destdir' and create a new dataset named 'dsetdst' decribing them...
Definition: TProofBench.cxx:1519
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TProofBench::fSelOption
TString fSelOption
Definition: TProofBench.h:63
TProofBench::fCPUSel
TString fCPUSel
Definition: TProofBench.h:57
TProofBench::fHistType
TPBHistType * fHistType
Definition: TProofBench.h:49
TProofBench::SetSelOption
void SetSelOption(const char *opt)
Definition: TProofBench.h:126
TProofBench::fRunCPU
TProofBenchRunCPU * fRunCPU
Definition: TProofBench.h:65
TProofBench::fgFioV
static TF1 * fgFioV
Definition: TProofBench.h:85
TProofBench::fgFp1n
static TF1 * fgFp1n
Definition: TProofBench.h:78
TProofBench::RemoveDataSet
Int_t RemoveDataSet(const char *dset)
Physically remove the dataset 'dset', i.e.
Definition: TProofBench.cxx:1316
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TProofBench::TProofBench
TProofBench(const char *url, const char *outfile="<default>", const char *proofopt=0)
Constructor: check PROOF and load selectors PAR.
Definition: TProofBench.cxx:185
Int_t
int Int_t
Definition: RtypesCore.h:45
TProofBench::DrawEfficiency
static void DrawEfficiency(const char *outfile, const char *opt="", Bool_t verbose=kFALSE)
Draw the efficiency plot.
Definition: TProofBench.cxx:1190
TProofBench::SetCPUSel
void SetCPUSel(const char *sel)
Definition: TProofBench.h:120
TProofBench::fDataSel
TString fDataSel
Definition: TProofBench.h:59
TProofBench::fDescription
TNamed * fDescription
Definition: TProofBench.h:71
TProofBench::SetNHist
void SetNHist(Int_t nh)
Definition: TProofBench.h:116
TProofBench::fNFilesWrk
Int_t fNFilesWrk
Definition: TProofBench.h:53
TString
Basic string class.
Definition: TString.h:136
TProofBench::fUnlinkOutfile
Bool_t fUnlinkOutfile
Definition: TProofBench.h:40
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TProofBench::SetNTries
void SetNTries(Int_t nt)
Definition: TProofBench.h:114
TString.h
TProofBench::fgFp2n
static TF1 * fgFp2n
Definition: TProofBench.h:80
bool
TProofBench::RunCPUx
Int_t RunCPUx(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1)
Perform the CPU run scanning over the number of workers per node Return 0 on success,...
Definition: TProofBench.cxx:366
TProofBenchRunCPU
CPU-intensive PROOF benchmark test generates events and fill 1, 2, or 3-D histograms.
Definition: TProofBenchRunCPU.h:41
TProofBench::GetGraphs
static TList * GetGraphs()
Definition: TProofBench.h:141
TProofBench::SetDebug
void SetDebug(Bool_t debug=kTRUE)
Definition: TProofBench.h:130
TProofBench::fgFp3
static TF1 * fgFp3
Definition: TProofBench.h:81
TProofBench::GetPerfSpecs
static void GetPerfSpecs(const char *path=".", Int_t degfit=1)
Get performance specs.
Definition: TProofBench.cxx:761
TProofBench::SetNFilesWrk
void SetNFilesWrk(Int_t nf=0)
Definition: TProofBench.h:113
TProofBenchDataSet
Handle operations on datasets used by ProofBench.
Definition: TProofBenchDataSet.h:27
TProofBench::fOutFile
TFile * fOutFile
Definition: TProofBench.h:46
TProofBench::SetHistType
void SetHistType(TPBHistType *histtype)
Definition: TProofBench.h:115
TPBHistType
Definition: TProofBenchTypes.h:57
TProofBench::ReleaseCache
Int_t ReleaseCache(const char *dset)
Release memory cache for dataset 'dset' Return 0 on success, -1 on error.
Definition: TProofBench.cxx:1304
TProofBench::DrawCPU
static void DrawCPU(const char *outfile, const char *opt="std:", Bool_t verbose=kFALSE, Int_t dofit=0, Int_t n0=-1, Int_t n1=-1)
Draw the CPU speedup plot.
Definition: TProofBench.cxx:409
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TProofBench::fgFp3n
static TF1 * fgFp3n
Definition: TProofBench.h:82
TProofBench::RunDataSet
Int_t RunDataSet(const char *dset="BenchDataSet", Int_t start=1, Int_t stop=-1, Int_t step=1)
Perform a test using dataset 'dset' Return 0 on success, -1 on error Open the file for the results.
Definition: TProofBench.cxx:898
TProofBench::fNumWrkMax
Int_t fNumWrkMax
Definition: TProofBench.h:54
TProofBench::fgFp2
static TF1 * fgFp2
Definition: TProofBench.h:79
TProofBench::fDataGenPar
TString fDataGenPar
Definition: TProofBench.h:62
TProofBench::fgFp1
static TF1 * fgFp1
Definition: TProofBench.h:77
TProofBench::GetDebug
Bool_t GetDebug()
Definition: TProofBench.h:132
TProofBench::SetDataPar
void SetDataPar(const char *par)
Definition: TProofBench.h:123
TFile
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TProfile
Profile Histogram.
Definition: TProfile.h:32
TProofBench::fDataGenSel
TString fDataGenSel
Definition: TProofBench.h:61
TProofBench::fgGraphs
static TList * fgGraphs
Definition: TProofBench.h:87
TProofBench::fCPUPar
TString fCPUPar
Definition: TProofBench.h:58
TProofBenchRunDataRead
I/O-intensive PROOF benchmark test reads in event files distributed on the cluster.
Definition: TProofBenchRunDataRead.h:44
Double_t
double Double_t
Definition: RtypesCore.h:59
TProofBench::fDebug
Bool_t fDebug
Definition: TProofBench.h:69
TProofBench::fReadType
TPBReadType * fReadType
Definition: TProofBench.h:51
TGraphErrors
A TGraphErrors is a TGraph with error bars.
Definition: TGraphErrors.h:26
TObject.h
TProofBench::SetDataGenSel
void SetDataGenSel(const char *sel)
Definition: TProofBench.h:124
TProofBench::SetDataGenPar
void SetDataGenPar(const char *par)
Definition: TProofBench.h:125
TProofBench::fProofDS
TProof * fProofDS
Definition: TProofBench.h:45
TProofBench::fDS
TProofBenchDataSet * fDS
Definition: TProofBench.h:67
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TProofBench::SetProofDS
void SetProofDS(TProof *p)
Set the PROOF instance to be used for dataset operations, like releasing cache ...
Definition: TProofBench.cxx:1591
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TProofBench
Steering class for PROOF benchmarks.
Definition: TProofBench.h:37
TProofBench::AssertFittingFun
static void AssertFittingFun(Double_t mi, Double_t mx)
Make sure that the fitting functions are defined.
Definition: TProofBench.cxx:697
TProofBench::fNtries
Int_t fNtries
Definition: TProofBench.h:48
TProofBench::MakeDataSet
Int_t MakeDataSet(const char *dset=0, Long64_t nevt=-1, const char *fnroot="event", Bool_t regenerate=kFALSE)
Create the largest dataset for the run.
Definition: TProofBench.cxx:1344
TProofBench::RunDataSetx
Int_t RunDataSetx(const char *dset="BenchDataSet", Int_t start=1, Int_t stop=-1)
Perform a test using dataset 'dset' scanning over the number of workers per node.
Definition: TProofBench.cxx:933
d
#define d(i)
Definition: RSha256.hxx:102
TDirectory
Describe directory structure in memory.
Definition: TDirectory.h:40
TProofBench::DrawDataSet
static void DrawDataSet(const char *outfile, const char *opt="std:", const char *type="mbs", Bool_t verbose=kFALSE, Int_t dofit=0, Int_t n0=-1, Int_t n1=-1)
Draw the CPU speedup plot.
Definition: TProofBench.cxx:979
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
TProofBench::SetReleaseCache
void SetReleaseCache(Bool_t on=kTRUE)
Definition: TProofBench.h:118
TProofBench::~TProofBench
virtual ~TProofBench()
Destructor.
Definition: TProofBench.cxx:248
TProof
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:316
TProofBench::fRunDS
TProofBenchRunDataRead * fRunDS
Definition: TProofBench.h:66
TProofBench::SetCPUPar
void SetCPUPar(const char *par)
Definition: TProofBench.h:121
TProofBench::fgFio
static TF1 * fgFio
Definition: TProofBench.h:84
TProofBench::fDataSet
TString fDataSet
Definition: TProofBench.h:52
type
int type
Definition: TGX11.cxx:121
TF1
1-Dim function class
Definition: TF1.h:213
TPBReadType
Definition: TProofBenchTypes.h:33
TProofBench::fReleaseCache
Bool_t fReleaseCache
Definition: TProofBench.h:55
TProofBench::fNHist
Int_t fNHist
Definition: TProofBench.h:50
TProofBench::fOutFileName
TString fOutFileName
Definition: TProofBench.h:47
TProofBench::fDataPar
TString fDataPar
Definition: TProofBench.h:60
TProofBench::GetGraph
static TGraphErrors * GetGraph(TDirectory *d, const char *pfn, Int_t &nb, Double_t &xmi, Double_t &xmx, Double_t &ymi, Double_t &ymx, Int_t &kmx, TProfile *&pf)
Get from TDirectory 'd' the TProfile named 'pfn' and create the graph.
Definition: TProofBench.cxx:639
TProofBench::RunCPU
Int_t RunCPU(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1, Int_t step=-1)
Perform the CPU run Return 0 on success, -1 on error.
Definition: TProofBench.cxx:337
TProofBench::OpenOutFile
Int_t OpenOutFile(Bool_t wrt=kFALSE, Bool_t verbose=kTRUE)
Set the otuput file Return 0 on success, -1 on error.
Definition: TProofBench.cxx:262
TList
A doubly linked list.
Definition: TList.h:44
int