forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TProofBench.h
146 lines (113 loc) · 6.75 KB
/
TProofBench.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// @(#)root/proofx:$Id$
// Author: G.Ganis, S.Ryu Feb 2011
/*************************************************************************
* Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TProofBench
#define ROOT_TProofBench
//////////////////////////////////////////////////////////////////////////
// //
// TProofBench //
// //
// Steering class for PROOF benchmarks //
// //
//////////////////////////////////////////////////////////////////////////
#include "TObject.h"
#include "TProofBenchTypes.h"
#include "TString.h"
class TF1;
class TFile;
class TGraphErrors;
class TProfile;
class TProof;
class TProofBenchRunCPU;
class TProofBenchRunDataRead;
class TProofBenchDataSet;
class TProofBench : public TObject {
private:
Bool_t fUnlinkOutfile; // Whether to remove empty output files
protected:
TProof* fProof; // Proof
TProof* fProofDS; // Proof to be used for dataset actions
TFile *fOutFile; // Output file
TString fOutFileName; // Name of the output file
Int_t fNtries; // Number of times a measurement is repeated
TPBHistType *fHistType; // Type of histograms for CPU runs
Int_t fNHist; // Number of histograms to be created in default CPU runs
TPBReadType *fReadType; // Type of read (partial, full)
TString fDataSet; // Name of the dataset
Int_t fNFilesWrk; // Number of files generated files per worker
Int_t fNumWrkMax; // Max number of workers (required for dynamic setups)
Bool_t fReleaseCache; // Release cache for data reads between runs
TString fCPUSel; // Selector to be used for CPU benchmarks
TString fCPUPar; // List of par files to be loaded for CPU benchmarks
TString fDataSel; // Selector to be used for data benchmarks
TString fDataPar; // List of par files to be loaded for data benchmarks
TString fDataGenSel; // Selector to be used for generate data for benchmarks
TString fDataGenPar; // List of par files to be loaded to generate data for benchmarks
TString fSelOption; // Option field for processing the selector
TProofBenchRunCPU *fRunCPU; // Instance to run CPU scans
TProofBenchRunDataRead *fRunDS; // Instance to run data-read scans
TProofBenchDataSet *fDS; // Instance to handle datasets operations
Bool_t fDebug; // Debug switch
TNamed *fDescription; // Strings describing the cluster for this test (saved in the output file)
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);
static TF1 *fgFp1; // Simple 1st degree polynomial
static TF1 *fgFp1n; // Normalized 1st degree
static TF1 *fgFp2; // Simple 2nd degree polynomial
static TF1 *fgFp2n; // Normalized 2nd degree
static TF1 *fgFp3; // Function with varying Rcpu
static TF1 *fgFp3n; // Normalized Function with varying Rcpu
static TF1 *fgFio; // Function used for I/O rate fits
static TF1 *fgFioV; // Function used for I/O rate fits with non-constant Rcpu
static TList *fgGraphs; // List of TGraphErrors created by Draw actions
static void AssertFittingFun(Double_t mi, Double_t mx);
public:
TProofBench(const char *url, const char *outfile = "<default>", const char *proofopt = 0);
virtual ~TProofBench();
Int_t RunCPU(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1, Int_t step=-1);
Int_t RunCPUx(Long64_t nevents=-1, Int_t start=-1, Int_t stop=-1);
Int_t RunDataSet(const char *dset = "BenchDataSet",
Int_t start = 1, Int_t stop = -1, Int_t step = 1);
Int_t RunDataSetx(const char *dset = "BenchDataSet", Int_t start = 1, Int_t stop = -1);
Int_t CopyDataSet(const char *dset, const char *dsetdst, const char *destdir);
Int_t MakeDataSet(const char *dset = 0, Long64_t nevt = -1, const char *fnroot = "event",
Bool_t regenerate = kFALSE);
Int_t ReleaseCache(const char *dset);
Int_t RemoveDataSet(const char *dset);
void CloseOutFile();
Int_t OpenOutFile(Bool_t wrt = kFALSE, Bool_t verbose = kTRUE);
Int_t SetOutFile(const char *outfile, Bool_t verbose = kTRUE);
const char *GetOutFileName() const { return fOutFileName; }
void SetNFilesWrk(Int_t nf = 0) { fNFilesWrk = (nf > 0) ? nf : 4; }
void SetNTries(Int_t nt) { if (nt > 0) fNtries = nt; }
void SetHistType(TPBHistType *histtype) { fHistType = histtype; }
void SetNHist(Int_t nh) { fNHist = nh; }
void SetReadType(TPBReadType *readtype) { fReadType = readtype; }
void SetReleaseCache(Bool_t on = kTRUE) { fReleaseCache = on; }
void SetCPUSel(const char *sel) { fCPUSel = sel; }
void SetCPUPar(const char *par) { fCPUPar = par; }
void SetDataSel(const char *sel) { fDataSel = sel; }
void SetDataPar(const char *par) { fDataPar = par; }
void SetDataGenSel(const char *sel) { fDataGenSel = sel; }
void SetDataGenPar(const char *par) { fDataGenPar = par; }
void SetSelOption(const char *opt) { fSelOption = opt; }
void SetProofDS(TProof *p);
void SetDebug(Bool_t debug = kTRUE) { fDebug = debug; }
Bool_t GetDebug() { return fDebug; }
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);
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);
static void GetPerfSpecs(const char *path = ".", Int_t degfit = 1);
static void DrawEfficiency(const char *outfile, const char *opt = "", Bool_t verbose = kFALSE);
static TList *GetGraphs() { return fgGraphs; }
ClassDef(TProofBench, 0) // Steering class for PROOF benchmarks
};
#endif