21 #include "RConfigure.h"
62 fHistType(histtype), fNHists(nhists),
63 fNEvents(nevents), fNTries(ntries), fStart(start), fStop(stop),
64 fStep(step), fDraw(draw), fDebug(
debug), fDirProofBench(dirproofbench),
65 fNodes(nodes), fListPerfPlots(0),
66 fCanvas(0), fProfile_perfstat_event(0), fHist_perfstat_event(0),
67 fProfile_perfstat_evtmax(0), fNorm_perfstat_evtmax(0),
68 fProfile_queryresult_event(0), fNorm_queryresult_event(0), fProfile_cpu_eff(0),
69 fProfLegend(0), fNormLegend(0), fName(0)
72 Error(
"TProofBenchRunCPU",
"problems validating PROOF session or enabling selector PAR");
80 if (stop == -1) fStop = fNodes->GetNWorkersCluster();
82 fListPerfPlots =
new TList;
108 Int_t quotient = (stop - start) / step;
109 Int_t ndiv = quotient + 1;
111 Double_t ns_max = quotient*step + start + step/2.;
118 axtitle =
"Active Workers/Node";
119 namelab.Form(
"x_%s",
GetName());
127 name.
Form(
"Prof_%s_PS_MaxEvts_%s", namelab.Data(), sellab.
Data());
128 title.
Form(
"Profile %s PerfStat Event - %s", namelab.Data(), sellab.
Data());
143 name.
Form(
"Prof_%s_PS_Evts_%s", namelab.Data(), sellab.
Data());
144 title.
Form(
"Profile %s PerfStat Event - %s", namelab.Data(), sellab.
Data());
158 name.
Form(
"Hist_%s_PS_Evts_%s", namelab.Data(), sellab.
Data());
159 title.
Form(
"Histogram %s PerfStat Event - %s", namelab.Data(), sellab.
Data());
172 name.
Form(
"Norm_%s_PS_MaxEvts_%s", namelab.Data(), sellab.
Data());
173 title.
Form(
"Profile %s Normalized PerfStat Event - %s", namelab.Data(), sellab.
Data());
188 name.
Form(
"Prof_%s_QR_Evts_%s", namelab.Data(), sellab.
Data());
189 title.
Form(
"Profile %s QueryResult Event - %s", namelab.Data(), sellab.
Data());
202 name.
Form(
"Norm_%s_QR_Evts_%s", namelab.Data(), sellab.
Data());
203 title.
Form(
"Profile %s Normalized QueryResult Event - %s", namelab.Data(), sellab.
Data());
217 name.
Form(
"Prof_%s_CPU_eff_%s", namelab.Data(), sellab.
Data());
218 title.
Form(
"Profile %s CPU efficiency - %s", namelab.Data(), sellab.
Data());
249 Error(
"Run",
"Proof not set");
253 nevents = (nevents == -1) ?
fNEvents : nevents;
254 start = (start == -1) ?
fStart : start;
255 stop = (stop == -1) ?
fStop : stop;
256 step = (step == -1) ?
fStep : step;
257 ntries = (ntries == -1) ?
fNTries : ntries;
258 debug = (debug == -1) ?
fDebug : debug;
259 draw = (draw == -1) ?
fDraw : draw;
270 if (stop > minnworkersanode) stop = minnworkersanode;
278 #ifdef R__HAVE_CONFIG
283 Info(
"Run",
"Uploading '%s' ...", par.
Data());
285 Error(
"Run",
"problems uploading '%s' - cannot continue", par.
Data());
295 Error(
"Run",
"you should load the class '%s' before running the benchmark",
fSelName.
Data());
301 Info(
"Run",
"Uploading '%s' ...", par.
Data());
303 Error(
"Run",
"problems uploading '%s' - cannot continue", par.
Data());
306 Info(
"Run",
"Enabling '%s' ...", par.
Data());
308 Error(
"Run",
"problems enabling '%s' - cannot continue", par.
Data());
332 TString perfstats_name =
"PROOF_PerfStats";
337 Info(
"Run",
"Running CPU-bound tests; %d ~ %d active worker(s)/node,"
338 " every %d worker(s)/node.", start, stop, step);
340 Info(
"Run",
"Running CPU-bound tests; %d ~ %d active worker(s),"
341 " every %d worker(s).", start, stop, step);
349 Double_t ymi = -1., ymx = -1., emx = -1.;
350 for (
Int_t nactive = start; nactive <= stop; nactive += step) {
353 Int_t ncoren = (nactive < ncores) ? nactive : ncores;
359 workers.
Form(
"%dx", nactive);
365 Error(
"Run",
"could not activate the requested number of"
366 " workers/node on the cluster; skipping the test point"
367 " (%d workers/node)", nactive);
371 for (
Int_t j = 0; j < ntries; j++) {
374 Info(
"Run",
"Running CPU-bound tests with %d active worker(s)/node;"
375 " trial %d/%d", nactive, j + 1, ntries);
377 Info(
"Run",
"Running CPU-bound tests with %d active worker(s);"
378 " trial %d/%d", nactive, j + 1, ntries);
383 nevents_all=nevents*nactive*nnodes;
385 nevents_all=nevents*nactive;
413 Double_t nert = nx ? pf_eventrate/nactive/nnodes : pf_eventrate/nactive;
418 if (dy / y1 < 0.2) dy = y1 * 0.2;
419 if (dy > y1) dy = y1*.999999;
420 if (ymi < 0.) ymi = y1 - dy;
423 if (ymx < 0.) ymx = y1 + dy;
439 TString dirn = nx ?
"RunCPUx" :
"RunCPU";
447 Warning(
"Run",
"cannot cd to subdirectory '%s' to store the results!", dirn.
Data());
454 Warning(
"Run",
"%s: tree not found", perfstats_name.
Data());
456 Error(
"Run",
"PROOF output list is empty!");
461 const char *drawopt = t ?
"LSAME" :
"L";
464 queryresult->
Print(
"F");
473 if (qr_eventrate > emx) emx = qr_eventrate;
478 qr_cpu_eff = queryresult->
GetUsedCPU() / ncoren / qr_proc ;
480 Printf(
"cpu_eff: %f", qr_cpu_eff);
490 Double_t nert = nx ? qr_eventrate/nactive/nnodes : qr_eventrate/nactive;
496 if (dy / y1 < 0.2) dy = y1 * 0.2;
497 if (dy > y1) dy = y1*.999999;
498 if (ymi < 0.) ymi = y1 - dy;
501 if (ymx < 0.) ymx = y1 + dy;
511 Warning(
"Run",
"TQueryResult not found!");
533 TString dirn = nx ?
"RunCPUx" :
"RunCPU";
541 Warning(
"Run",
"cannot cd to subdirectory '%s' to store the results!", dirn.
Data());
561 Error(
"FillPerfStatPerfPlots",
"no perfstat profile found");
567 Error(
"FillPerfStatPerfPlots",
"no perfstat histogram found");
579 for (
Long64_t k=0; k<entries; k++) {
602 Printf(
"+++ TProofBenchRunCPU +++++++++++++++++++++++++++++++++++++++++");
619 Printf(
"Performance Canvas: Name = %s Title = %s",
621 Printf(
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
640 nside = (nside*nside<nprofiles)?nside+1:nside;
647 while ((profile=(
TProfile*)(nxt()))){
669 TString namestem(
"+++undef+++");
682 namestem =
"HistAll";
697 Error(
"SetParameters",
"proof not set; Doing nothing");
714 Error(
"DeleteParameters",
"proof not set; Doing nothing");
TVirtualPerfStats::EEventType fType
const char *const kPROOF_BenchCPUSelPar
virtual void SetMaximum(Double_t maximum=-1111)
This class displays a legend box (TPaveText) containing several legend entries.
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
TString GetNameStem() const
Get name for this run.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual void Print(Option_t *option="") const
Print status of PROOF cluster.
R__EXTERN TStyle * gStyle
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
void SetParameter(const char *par, const char *value)
Set input list parameter.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
TList * GetOutputList()
Get list with all object created during processing (see Process()).
Int_t GetMinWrksPerNode() const
TProfile * fProfile_perfstat_event
virtual void SetMinimum(Double_t minimum=-1111)
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
ClassImp(TProofBenchRunCPU) TProofBenchRunCPU
Default constructor.
virtual TDirectory * mkdir(const char *name, const char *title="")
Create a sub-directory and return a pointer to the created directory.
const char *const kPROOF_BenchParDir
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual const char * GetPath() const
Returns the full path of the directory.
Int_t SetParameters()
Set parameters.
void FillPerfStatPerfPlots(TTree *t, Int_t nactive)
void Run(Long64_t nevents, Int_t start, Int_t stop, Int_t step, Int_t ntries, Int_t debug, Int_t draw)
Run benchmark Input parameters nevents: Number of events to run per file.
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=0)
Set the value of a resource or create a new resource.
TProfile * fProfile_queryresult_event
const char * Data() const
void Print(Option_t *option="") const
Description: Print node information.
void Print(Option_t *opt="") const
Print query content. Use opt = "F" for a full listing.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
TProfile * fProfile_perfstat_evtmax
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
virtual const char * GetSelName()
virtual void SetMarkerColor(Color_t mcolor=1)
void Clear(Option_t *option="")
Remove all primitives from the canvas.
void SetHistType(TPBHistType *histtype)
Set histogram type.
std::vector< std::vector< double > > Data
Double_t GetEvtRateAvgMax() const
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'...
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
A container class for query results.
Long64_t GetEntries() const
void Error(const char *location, const char *msgfmt,...)
const char * GetName() const
Returns name of object.
TDirectory * fDirProofBench
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
EHistType GetType() const
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Float_t GetUsedCPU() const
Long64_t fEventsProcessed
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void DrawPerfPlots()
Draw Performance plots.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Int_t Fill(const Double_t *v)
virtual const char * GetName() const
Returns name of object.
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual Long64_t Process(TDSet *dset, const char *selector, Option_t *option="", Long64_t nentries=-1, Long64_t firstentry=0)
Process a data set (TDSet) using the specified selector (.C) file or Tselector object Entry- or event...
void AddInput(TObject *obj)
Add objects that might be needed during the processing of the selector (see Process()).
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual Double_t GetBinError(Int_t bin) const
Return bin error of a Profile histogram.
TDatime GetStartTime() const
virtual ~TProofBenchRunCPU()
Destructor.
void Print(Option_t *option="") const
Show settings.
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
const char * GetTitle() const
Returns title of object.
virtual Double_t GetBinContent(Int_t bin) const
Return bin content of a Profile histogram.
TList * GetInputList()
Get input list.
virtual Int_t GetSize() const
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
void DeleteParameters(const char *wildcard)
Delete the input list parameters specified by a wildcard (e.g.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
TProfile * fNorm_queryresult_event
Int_t ActivateWorkers(Int_t nwrks)
Description: Activate 'nwrks' workers; calls TProof::SetParallel and rebuild the internal lists Input...
TProfile * fNorm_perfstat_evtmax
Describe directory structure in memory.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Int_t DeleteParameters()
Delete parameters set for this run.
Mother of all ROOT objects.
const char Int_t const char TProof * proof
const char *const kPROOF_BenchSelCPUDef
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual void Add(TObject *obj)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Bool_t IsWritable() const
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
TProfile * fProfile_cpu_eff
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.
TH2 * fHist_perfstat_event
Double_t Sqrt(Double_t x)
void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx)
Build histograms, profiles and graphs needed for this run.
Float_t GetProcTime() const
Int_t Fill(Double_t)
Invalid Fill method.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this collection.
TDatime GetEndTime() const
virtual void SetName(const char *name)
Change the name of this tree.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.