20#include "RConfigure.h"
69 Error(
"TProofBenchRunCPU",
"problems validating PROOF session or enabling selector PAR");
77 if (stop == -1)
fStop =
fNodes->GetNWorkersCluster();
81 gEnv->SetValue(
"Proof.StatsTrace",1);
105 Int_t quotient = (stop - start) / step;
106 Int_t ndiv = quotient + 1;
108 Double_t ns_max = quotient*step + start + step/2.;
115 axtitle =
"Active Workers/Node";
116 namelab.Form(
"x_%s",
GetName());
124 name.Form(
"Prof_%s_PS_MaxEvts_%s", namelab.Data(), sellab.
Data());
125 title.
Form(
"Profile %s PerfStat Event - %s", namelab.Data(), sellab.
Data());
140 name.Form(
"Prof_%s_PS_Evts_%s", namelab.Data(), sellab.
Data());
141 title.
Form(
"Profile %s PerfStat Event - %s", namelab.Data(), sellab.
Data());
155 name.Form(
"Hist_%s_PS_Evts_%s", namelab.Data(), sellab.
Data());
156 title.
Form(
"Histogram %s PerfStat Event - %s", namelab.Data(), sellab.
Data());
169 name.Form(
"Norm_%s_PS_MaxEvts_%s", namelab.Data(), sellab.
Data());
170 title.
Form(
"Profile %s Normalized PerfStat Event - %s", namelab.Data(), sellab.
Data());
185 name.Form(
"Prof_%s_QR_Evts_%s", namelab.Data(), sellab.
Data());
186 title.
Form(
"Profile %s QueryResult Event - %s", namelab.Data(), sellab.
Data());
199 name.Form(
"Norm_%s_QR_Evts_%s", namelab.Data(), sellab.
Data());
200 title.
Form(
"Profile %s Normalized QueryResult Event - %s", namelab.Data(), sellab.
Data());
214 name.Form(
"Prof_%s_CPU_eff_%s", namelab.Data(), sellab.
Data());
215 title.
Form(
"Profile %s CPU efficiency - %s", namelab.Data(), sellab.
Data());
246 Error(
"Run",
"Proof not set");
250 nevents = (nevents == -1) ?
fNEvents : nevents;
251 start = (start == -1) ?
fStart : start;
252 stop = (stop == -1) ?
fStop : stop;
253 step = (step == -1) ?
fStep : step;
254 ntries = (ntries == -1) ?
fNTries : ntries;
255 debug = (debug == -1) ?
fDebug : debug;
256 draw = (draw == -1) ?
fDraw : draw;
266 Int_t minnworkersanode =
fNodes->GetMinWrksPerNode();
267 if (stop > minnworkersanode) stop = minnworkersanode;
276 Info(
"Run",
"Uploading '%s' ...", par.
Data());
277 if (
fProof->UploadPackage(par) != 0) {
278 Error(
"Run",
"problems uploading '%s' - cannot continue", par.
Data());
288 Error(
"Run",
"you should load the class '%s' before running the benchmark",
fSelName.Data());
293 while (
fParList.Tokenize(par, from,
",")) {
294 Info(
"Run",
"Uploading '%s' ...", par.
Data());
295 if (
fProof->UploadPackage(par) != 0) {
296 Error(
"Run",
"problems uploading '%s' - cannot continue", par.
Data());
299 Info(
"Run",
"Enabling '%s' ...", par.
Data());
300 if (
fProof->EnablePackage(par) != 0) {
301 Error(
"Run",
"problems enabling '%s' - cannot continue", par.
Data());
325 TString perfstats_name =
"PROOF_PerfStats";
330 Info(
"Run",
"Running CPU-bound tests; %d ~ %d active worker(s)/node,"
331 " every %d worker(s)/node.", start, stop, step);
333 Info(
"Run",
"Running CPU-bound tests; %d ~ %d active worker(s),"
334 " every %d worker(s).", start, stop, step);
342 Double_t ymi = -1., ymx = -1., emx = -1.;
343 for (
Int_t nactive = start; nactive <= stop; nactive += step) {
346 Int_t ncoren = (nactive < ncores) ? nactive : ncores;
352 workers.
Form(
"%dx", nactive);
353 nw =
fNodes->ActivateWorkers(workers);
355 nw =
fNodes->ActivateWorkers(nactive);
358 Error(
"Run",
"could not activate the requested number of"
359 " workers/node on the cluster; skipping the test point"
360 " (%d workers/node)", nactive);
364 for (
Int_t j = 0; j < ntries; j++) {
367 Info(
"Run",
"Running CPU-bound tests with %d active worker(s)/node;"
368 " trial %d/%d", nactive, j + 1, ntries);
370 Info(
"Run",
"Running CPU-bound tests with %d active worker(s);"
371 " trial %d/%d", nactive, j + 1, ntries);
376 nevents_all=nevents*nactive*nnodes;
378 nevents_all=nevents*nactive;
388 if (
l) t =
dynamic_cast<TTree*
>(
l->FindObject(perfstats_name.
Data()));
406 Double_t nert = nx ? pf_eventrate/nactive/nnodes : pf_eventrate/nactive;
411 if (dy /
y1 < 0.2) dy =
y1 * 0.2;
412 if (dy >
y1) dy =
y1*.999999;
413 if (ymi < 0.) ymi =
y1 - dy;
416 if (ymx < 0.) ymx =
y1 + dy;
432 TString dirn = nx ?
"RunCPUx" :
"RunCPU";
440 Warning(
"Run",
"cannot cd to subdirectory '%s' to store the results!", dirn.
Data());
447 Warning(
"Run",
"%s: tree not found", perfstats_name.
Data());
449 Error(
"Run",
"PROOF output list is empty!");
454 const char *drawopt = t ?
"LSAME" :
"L";
457 queryresult->
Print(
"F");
466 if (qr_eventrate > emx) emx = qr_eventrate;
471 qr_cpu_eff = queryresult->
GetUsedCPU() / ncoren / qr_proc ;
473 Printf(
"cpu_eff: %f", qr_cpu_eff);
483 Double_t nert = nx ? qr_eventrate/nactive/nnodes : qr_eventrate/nactive;
489 if (dy /
y1 < 0.2) dy =
y1 * 0.2;
490 if (dy >
y1) dy =
y1*.999999;
491 if (ymi < 0.) ymi =
y1 - dy;
494 if (ymx < 0.) ymx =
y1 + dy;
504 Warning(
"Run",
"TQueryResult not found!");
526 TString dirn = nx ?
"RunCPUx" :
"RunCPU";
534 Warning(
"Run",
"cannot cd to subdirectory '%s' to store the results!", dirn.
Data());
554 Error(
"FillPerfStatPerfPlots",
"no perfstat profile found");
560 Error(
"FillPerfStatPerfPlots",
"no perfstat histogram found");
572 for (
Long64_t k=0; k<entries; k++) {
595 Printf(
"+++ TProofBenchRunCPU +++++++++++++++++++++++++++++++++++++++++");
612 Printf(
"Performance Canvas: Name = %s Title = %s",
614 Printf(
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
633 nside = (nside*nside<nprofiles)?nside+1:nside;
640 while ((profile=(
TProfile*)(nxt()))){
662 TString namestem(
"+++undef+++");
675 namestem =
"HistAll";
690 Error(
"SetParameters",
"proof not set; Doing nothing");
707 Error(
"DeleteParameters",
"proof not set; Doing nothing");
710 if (
fProof->GetInputList()) {
714 fProof->DeleteParameters(
"PROOF_BenchmarkNHists");
715 fProof->DeleteParameters(
"PROOF_BenchmarkDraw");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char y1
const char *const kPROOF_BenchCPUSelPar
const char *const kPROOF_BenchSelCPUDef
const char *const kPROOF_BenchParDir
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TStyle * gStyle
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.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Describe directory structure in memory.
virtual Bool_t cd()
Change current directory to "this" directory.
void Draw(Option_t *option="") override
Draw this histogram with options.
2-D histogram with a double per channel (see TH1 documentation)
This class displays a legend box (TPaveText) containing several legend entries.
const char * GetName() const override
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
@ kOverwrite
overwrite existing object with same name
TObject()
TObject constructor.
@ kInvalidObject
if object ctor succeeded but object should not be used
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TVirtualPerfStats::EEventType fType
Long64_t fEventsProcessed
CPU-intensive PROOF benchmark test generates events and fill 1, 2, or 3-D histograms.
TH2 * fHist_perfstat_event
TString GetNameStem() const
Get name for this run.
void FillPerfStatPerfPlots(TTree *t, Int_t nactive)
TDirectory * fDirProofBench
Int_t DeleteParameters()
Delete parameters set for this run.
const char * GetName() const override
Returns name of object.
Int_t SetParameters()
Set parameters.
TProfile * fProfile_queryresult_event
void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx)
Build histograms, profiles and graphs needed for this run.
TProfile * fNorm_queryresult_event
TProfile * fProfile_perfstat_evtmax
~TProofBenchRunCPU() override
Destructor.
TProfile * fNorm_perfstat_evtmax
TProfile * fProfile_cpu_eff
void DrawPerfPlots()
Draw Performance plots.
void Print(Option_t *option="") const override
Show settings.
TProfile * fProfile_perfstat_event
void Run(Long64_t nevents, Int_t start, Int_t stop, Int_t step, Int_t ntries, Int_t debug, Int_t draw) override
Run benchmark Input parameters nevents: Number of events to run per file.
void SetHistType(TPBHistType *histtype)
Set histogram type.
TProofBenchRunCPU(TPBHistType *histtype=0, Int_t nhists=16, TDirectory *dirproofbench=0, TProof *proof=0, TProofNodes *nodes=0, Long64_t nevents=1000000, Int_t ntries=2, Int_t start=1, Int_t stop=-1, Int_t step=1, Int_t draw=0, Int_t debug=0)
Default constructor.
TProofBenchRun(TProof *proof=0, const char *sel=0)
Constructor: check PROOF and load selectors PAR.
virtual const char * GetSelName()
PROOF worker node information.
Set of tools to analyse the performance tree.
Double_t GetEvtRateAvgMax() const
This class controls a Parallel ROOT Facility, PROOF, cluster.
A container class for query results.
Long64_t GetEntries() const
TDatime GetEndTime() const
TDatime GetStartTime() const
Float_t GetProcTime() const
void Print(Option_t *opt="") const override
Print query content. Use opt = "F" for a full listing.
Float_t GetUsedCPU() const
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
virtual Long64_t GetEntries() const
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
void SetName(const char *name) override
Change the name of this tree.
Double_t Sqrt(Double_t x)
Returns the square root of x.