Logo ROOT  
Reference Guide
TProofBench.cxx
Go to the documentation of this file.
1 // @(#)root/proof:$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  \defgroup proofbench PROOF benchmark utilities
13  \ingroup proof
14 
15  Set of utilities to benchmark a PROOF facility.
16  See also https://root.cern.ch/proof-benchmark-framework-tproofbench .
17 
18 */
19 
20 /** \class TProofBench
21 \ingroup proofbench
22 
23  Steering class for PROOF benchmarks
24 
25 */
26 
27 #include "RConfigure.h"
28 
29 #include "TProofBench.h"
30 #include "Getline.h"
31 #include "TProofBenchRunCPU.h"
32 #include "TProofBenchRunDataRead.h"
33 #include "TProofBenchDataSet.h"
34 #include "TProofNodes.h"
35 #include "TClass.h"
36 #include "TFile.h"
37 #include "TFileCollection.h"
38 #include "TFileInfo.h"
39 #include "THashList.h"
40 #include "TKey.h"
41 #include "TMap.h"
42 #include "TObjString.h"
43 #include "TProof.h"
44 #include "TROOT.h"
45 #include "TSortedList.h"
46 #include "TTimeStamp.h"
47 #include "TUrl.h"
48 
49 #include "TCanvas.h"
50 #include "TF1.h"
51 #include "TGraphErrors.h"
52 #include "TH1F.h"
53 #include "TMath.h"
54 #include "TProfile.h"
55 #include "TStyle.h"
56 #include "TLegend.h"
57 #ifdef WIN32
58 #include <io.h>
59 #endif
60 
62 
63 // Functions for fitting
64 
73 static Int_t gFioVn0 = -1; // Number of real cores for fgFioV
74 static Int_t gFioVn1 = -1; // Number of real+hyper cores for fgFioV
75 
77 
78 ////////////////////////////////////////////////////////////////////////////////
79 /// Simple polynomial 1st degree
80 
82 {
83  Double_t res = par[0] + par[1] * xx[0];
84  return res;
85 }
86 
87 ////////////////////////////////////////////////////////////////////////////////
88 /// Simple polynomial 2nd degree
89 
91 {
92  Double_t res = par[0] + par[1] * xx[0] + par[2] * xx[0] * xx[0];
93  return res;
94 }
95 
96 ////////////////////////////////////////////////////////////////////////////////
97 /// Normalized 1st degree
98 
100 {
101  Double_t res = par[0] / xx[0] + par[1];
102  return res;
103 }
104 
105 ////////////////////////////////////////////////////////////////////////////////
106 /// Normalized 2nd degree
107 
109 {
110  Double_t res = par[0] / xx[0] + par[1] + par[2] * xx[0];
111  return res;
112 }
113 
114 ////////////////////////////////////////////////////////////////////////////////
115 /// I/O saturated rate function
116 
118 {
119  Double_t sat = par[0] / par[1] * (xx[0] * par[1] / par[2] - 1.);
120  if (xx[0] < par[2] / par[1]) sat = 0.;
121  Double_t res = par[0] * xx[0] / (1. + sat);
122  return res;
123 }
124 
125 ////////////////////////////////////////////////////////////////////////////////
126 /// I/O saturated rate function with varying Rcpu
127 
129 {
130  // par[0] = rio
131  // par[1] = b1
132  // par[2] = b2
133  // par[3] = nc
134  // par[4] = ri
135 
136  Double_t rio = par[0] / par[3] * xx[0];
137  if (xx[0] > par[3]) rio = par[0];
138 
139  Double_t rcpu = par[1] * xx[0];
140  if (xx[0] > gFioVn0) rcpu = par[1]*gFioVn0 + par[2]*(xx[0] - gFioVn0);
141  if (xx[0] > gFioVn1) rcpu = par[1]*gFioVn0 + par[2]*(gFioVn1 - gFioVn0);
142 
143  Double_t res = 1. / (1./par[4] + 1./rio + 1./rcpu);
144 
145  return res;
146 }
147 
148 ////////////////////////////////////////////////////////////////////////////////
149 /// Function with varying Rcpu
150 
152 {
153  // par[0] = offset
154  // par[1] = rate contribution from real cores
155  // par[2] = rate contribution from hyper cores
156 
157  Double_t n = (xx[0] - par[0]);
158  Double_t rcpu = par[1] * n;
159  if (xx[0] > gFioVn0) rcpu = par[1]*gFioVn0 + par[2]*(n - gFioVn0);
160  if (xx[0] > gFioVn1) rcpu = par[1]*gFioVn0 + par[2]*(gFioVn1 - gFioVn0);
161 
162  return rcpu;
163 }
164 
165 ////////////////////////////////////////////////////////////////////////////////
166 /// Function with varying Rcpu normalized
167 
169 {
170  // par[0] = offset
171  // par[1] = rate contribution from real cores
172  // par[2] = rate contribution from hyper cores
173 
174  Double_t n = (xx[0] - par[0]);
175  Double_t rcpu = par[1] * n;
176  if (xx[0] > gFioVn0) rcpu = par[1]*gFioVn0 + par[2]*(n - gFioVn0);
177  if (xx[0] > gFioVn1) rcpu = par[1]*gFioVn0 + par[2]*(gFioVn1 - gFioVn0);
178 
179  return rcpu / xx[0];
180 }
181 
182 ////////////////////////////////////////////////////////////////////////////////
183 /// Constructor: check PROOF and load selectors PAR
184 
185 TProofBench::TProofBench(const char *url, const char *outfile, const char *proofopt)
186  : fUnlinkOutfile(kFALSE), fProofDS(0), fOutFile(0),
187  fNtries(4), fHistType(0), fNHist(16), fReadType(0),
188  fDataSet("BenchDataSet"), fNFilesWrk(2), fReleaseCache(kTRUE),
189  fDataGenSel(kPROOF_BenchSelDataGenDef),
190  fRunCPU(0), fRunDS(0), fDS(0), fDebug(kFALSE), fDescription(0)
191 {
193  if (!url) {
194  Error("TProofBench", "specifying a PROOF master url is mandatory - cannot continue");
195  return;
196  }
197  if (!(fProof = TProof::Open(url, proofopt)) || (fProof && !fProof->IsValid())) {
198  Error("TProofBench", "could not open a valid PROOF session - cannot continue");
199  return;
200  }
201  // Get the size of the cluster
204  // It must be passed as PROOF option 'workers=N' and recorded in the envs vars
205  TNamed *n = (TNamed *) TProof::GetEnvVars()->FindObject("PROOF_NWORKERS");
206  if (!n) {
207  Error("TProofBench", "dynamic mode: you must specify the max number of workers");
208  fProof->Close();
210  return;
211  }
212  TString sn(n->GetTitle());
213  if (sn.IsDigit()) fNumWrkMax = sn.Atoi();
214  if (!sn.IsDigit()) {
215  Error("TProofBench", "dynamic mode: wrong specification of the max number of"
216  " workers ('%s')", n->GetTitle());
217  fProof->Close();
219  return;
220  }
221  }
222  if (fNumWrkMax <= 0) {
223  Error("TProofBench", "wrong max number of workers ('%d')", fNumWrkMax);
224  fProof->Close();
226  return;
227  }
228  // By default we use the same instance for dataset actions
229  fProofDS = fProof;
230  // The object is now valid
232  // Identifying string
233  TUrl u(url);
234  TString host(TString::Format("PROOF at %s", u.GetHost()));
235  if (!strcmp(u.GetProtocol(), "lite")) host.Form("PROOF-Lite on %s", gSystem->HostName());
236  fDescription = new TNamed("PB_description",
237  TString::Format("%s, %d workers", host.Data(), fNumWrkMax).Data());
238  Printf(" Run description: %s", fDescription->GetTitle());
239  // Set output file
240  if (SetOutFile(outfile, kFALSE) != 0)
241  Warning("TProofBench", "problems opening '%s' - ignoring: use SetOutFile to try"
242  " again or with another file", outfile);
243 }
244 
245 ////////////////////////////////////////////////////////////////////////////////
246 /// Destructor
247 
249 {
250  CloseOutFile();
256 }
257 
258 ////////////////////////////////////////////////////////////////////////////////
259 /// Set the otuput file
260 /// Return 0 on success, -1 on error
261 
263 {
264  // Remove any bad file
266 
267  Int_t rc = 0;
268  if (!fOutFile && fOutFileName.Length() > 0) {
269  const char *mode = 0;
270  if (wrt)
271  mode = gSystem->AccessPathName(fOutFileName) ? "RECREATE" : "UPDATE";
272  else
273  mode = "READ";
274  if (!(fOutFile = TFile::Open(fOutFileName, mode)) || (fOutFile && fOutFile->IsZombie())) {
275  if (verbose)
276  Warning("OpenOutFile", "problems opening '%s' - ignoring: use SetOutFile to try"
277  " again or with another file", fOutFileName.Data());
278  rc = -1;
279  }
280  if (fOutFile) {
281  gROOT->GetListOfFiles()->Remove(fOutFile);
282  if (!strcmp(mode, "RECREATE")) {
283  // Save the description string
284  fOutFile->cd();
285  fDescription->Write();
286  }
287  }
288  }
289  return rc;
290 }
291 
292 ////////////////////////////////////////////////////////////////////////////////
293 /// Set the output file
294 /// Return 0 on success, -1 on error
295 
297 {
298  Int_t rc = 0;
299  // Close existing file, if any
300  if (fOutFile) {
301  if (!fOutFile->IsZombie()) fOutFile->Close();
303  }
304 
305  fOutFileName = outfile;
306  if (fOutFileName == "<default>") {
307  // Default output file: proofbench-<master>-<DayMonthYear-hhmm>.root
308  TDatime dat;
309  const char *lite = (fProof->IsLite()) ? "-lite" : "";
310  fOutFileName.Form("proofbench-%s%s-%dw-%d-%.2d%.2d.root",
311  fProof->GetMaster(), lite, fNumWrkMax,
312  dat.GetDate(), dat.GetHour(), dat.GetMinute());
313  Info("SetOutFile", "using default output file: '%s'", fOutFileName.Data());
315  }
316  if (!fOutFileName.IsNull()) {
317  if ((rc = OpenOutFile(kTRUE, kFALSE)) != 0 && verbose)
318  Warning("SetOutFile", "problems opening '%s' - ignoring: use SetOutFile to try"
319  " again or with another file", outfile);
320  }
321  return rc;
322 }
323 
324 ////////////////////////////////////////////////////////////////////////////////
325 /// Close output file
326 
328 {
329  if (SetOutFile(0) != 0)
330  Warning("CloseOutFile", "problems closing '%s'", fOutFileName.Data());
331 }
332 
333 ////////////////////////////////////////////////////////////////////////////////
334 /// Perform the CPU run
335 /// Return 0 on success, -1 on error
336 
337 Int_t TProofBench::RunCPU(Long64_t nevents, Int_t start, Int_t stop, Int_t step)
338 {
339  // Open the file for the results
340  if (OpenOutFile(kTRUE) != 0) {
341  Error("RunCPU", "problems opening '%s' to save the result", fOutFileName.Data());
342  return -1;
343  }
345 
347  TPBHistType *htype = new TPBHistType(TPBHistType::kHist1D); // Owned by the input list
348  fRunCPU = new TProofBenchRunCPU(htype, fNHist, fOutFile);
352  fRunCPU->Run(nevents, start, stop, step, fNtries, fDebug, -1);
353 
354  // Close the file
355  if (SetOutFile(0) != 0)
356  Warning("RunCPU", "problems closing '%s'", fOutFileName.Data());
357 
358  // Done
359  return 0;
360 }
361 
362 ////////////////////////////////////////////////////////////////////////////////
363 /// Perform the CPU run scanning over the number of workers per node
364 /// Return 0 on success, -1 on error
365 
367 {
368  // Open the file for the results
369  if (OpenOutFile(kTRUE) != 0) {
370  Error("RunCPUx", "problems opening '%s' to save the result", fOutFileName.Data());
371  return -1;
372  }
374 
376  TPBHistType *htype = new TPBHistType(TPBHistType::kHist1D); // Owned by the input list
377  fRunCPU = new TProofBenchRunCPU(htype, fNHist, fOutFile);
381  fRunCPU->Run(nevents, start, stop, -2, fNtries, fDebug, -1);
382 
383  // Close the file
384  if (SetOutFile(0) != 0)
385  Warning("RunCPUx", "problems closing '%s'", fOutFileName.Data());
386 
387  // Done
388  return 0;
389 }
390 
391 ////////////////////////////////////////////////////////////////////////////////
392 /// Draw the CPU speedup plot.
393 /// opt = 'typewhat', e.g. 'std:max:'
394 /// type = 'std:' draw standard evt/s plot
395 /// 'stdx:' draw standard evt/s plot, 1 worker per node
396 /// 'norm:' draw normalized plot
397 /// 'normx:' draw normalized plot, 1 worker per node
398 /// what = 'max:' draw max rate
399 /// 'avg:' draw average rate
400 /// 'all:' draw max and average rate on same plot (default)
401 /// dofit = 0 no fit
402 /// 1 fit with the relevant '1st degree related' function
403 /// 2 fit with the relevant '2nd degree related' function
404 /// 3 fit with varying rcpu function
405 /// n0 = for dofit == 3, number of real cores
406 /// n1 = for dofit == 3, number of total cores (real + hyperthreaded)
407 ///
408 
409 void TProofBench::DrawCPU(const char *outfile, const char *opt, Bool_t verbose,
410  Int_t dofit, Int_t n0, Int_t n1)
411 {
412  // Get the TProfile an create the graphs
413  TFile *fout = TFile::Open(outfile, "READ");
414  if (!fout || (fout && fout->IsZombie())) {
415  ::Error("DrawCPU", "could not open file '%s' ...", outfile);
416  return;
417  }
418 
419  // Get description
420  TString description("<not available>");
421  TNamed *nmdesc = (TNamed *) fout->Get("PB_description");
422  if (nmdesc) description = nmdesc->GetTitle();
423 
424  // Parse option
425  TString oo(opt);
426  Bool_t isNorm = (oo.Contains("norm")) ? kTRUE : kFALSE;
427  Bool_t isX = (oo.Contains("stdx:") || oo.Contains("normx:")) ? kTRUE : kFALSE;
428  Bool_t doAvg = kTRUE, doMax = kTRUE;
429  if (oo.Contains("avg:")) doMax = kFALSE;
430  if (oo.Contains("max:")) doAvg = kFALSE;
431 
432  const char *dirn = (isX) ? "RunCPUx" : "RunCPU";
433  TDirectory *d = (TDirectory *) fout->Get(dirn);
434  if (!d) {
435  ::Error("DrawCPU", "could not find directory '%s' ...", dirn);
436  fout->Close();
437  delete fout;
438  return;
439  }
440  d->cd();
441 
442  TString hprofn, hmaxn;
443  const char *lx = (isX) ? "_x" : "";
444  const char *ln = (isNorm) ? "Norm" : "Prof";
445  hprofn.Form("%s%s_CPU_QR_Evts", ln, lx);
446  hmaxn.Form("%s%s_CPU_PS_MaxEvts", ln, lx);
447 
448  Double_t xmin = -1., xmax = -1.;
449  Double_t ami = -1., amx = -1., mmi = -1., mmx = -1.;
450  Int_t kamx = -1, kmmx = -1, nbins = -1;
451  Double_t ymx = -1., ymi = -1.;
452 
453  TProfile *pf = 0;
454  Int_t kmx = -1;
455 
456  TProfile *pfav = 0;
457  TGraphErrors *grav = 0;
458  if (doAvg) {
459  if (!(grav = GetGraph(d, hprofn, nbins, xmin, xmax, ami, amx, kamx, pfav))) {
460  ::Error("DrawCPU", "could not find '%s' ...", hprofn.Data());
461  fout->Close();
462  delete fout;
463  return;
464  }
465  ymx = amx;
466  ymi = ami;
467  pf = pfav;
468  kmx = kamx;
469  }
470  TProfile *pfmx = 0;
471  TGraphErrors *grmx = 0;
472  if (doMax) {
473  if (!(grmx = GetGraph(d, hmaxn, nbins, xmin, xmax, mmi, mmx, kmmx, pfmx))) {
474  ::Warning("DrawCPU", "could not find '%s': feature added in 5.34/11", hmaxn.Data());
475  if (!grav) {
476  // Nothing to do if not asked for the average
477  fout->Close();
478  delete fout;
479  return;
480  }
481  doMax = kFALSE;
482  }
483  if (mmx > ymx) ymx = mmx;
484  if ((ymi > 0 && mmi < ymi) || (ymi < 0.)) ymi = mmi;
485  pf = pfmx;
486  kmx = kmmx;
487  }
488 
489  // Create the canvas
490  TCanvas *cpu = new TCanvas("cpu", "Rate vs wrks",204,69,1050,502);
491  cpu->Range(-3.106332,0.7490716,28.1362,1.249867);
492 
493  TH1F *hgr = new TH1F("Graph-CPU"," CPU speed-up", nbins*4, xmin, xmax);
494  hgr->SetMaximum(ymx + (ymx-ymi)*0.2);
495  hgr->SetMinimum(0);
496  if (isNorm) hgr->SetMaximum(ymx*1.2);
497  hgr->SetDirectory(0);
498  hgr->SetStats(0);
499  hgr->GetXaxis()->SetTitle(pf->GetXaxis()->GetTitle());
500  hgr->GetXaxis()->CenterTitle(true);
501  hgr->GetXaxis()->SetLabelSize(0.05);
502  hgr->GetXaxis()->SetTitleSize(0.06);
503  hgr->GetXaxis()->SetTitleOffset(0.62);
504  hgr->GetYaxis()->SetTitleSize(0.08);
505  hgr->GetYaxis()->SetTitleOffset(0.52);
506  hgr->GetYaxis()->SetTitle("Rate (events/s)");
507 
508  TLegend *leg = 0;
509  if (isNorm) {
510  leg = new TLegend(0.7, 0.8, 0.9, 0.9);
511  } else {
512  leg = new TLegend(0.1, 0.8, 0.3, 0.9);
513  }
514 
515  gStyle->SetOptTitle(0);
516  TGraphErrors *gr = 0;
517  if (doAvg) {
518  grav->SetFillColor(1);
519  grav->SetLineColor(13);
520  grav->SetMarkerColor(4);
521  grav->SetMarkerStyle(21);
522  grav->SetMarkerSize(1.2);
523  grav->SetHistogram(hgr);
524 
525  if (verbose) grav->Print();
526  grav->Draw("alp");
527  leg->AddEntry(grav, "Average", "P");
528  gr = grav;
529  }
530  if (doMax) {
531  grmx->SetFillColor(1);
532  grmx->SetLineColor(13);
533  grmx->SetMarkerColor(2);
534  grmx->SetMarkerStyle(29);
535  grmx->SetMarkerSize(1.8);
536  grmx->SetHistogram(hgr);
537 
538  if (verbose) grmx->Print();
539  if (doAvg) {
540  grmx->Draw("lpSAME");
541  } else {
542  grmx->Draw("alp");
543  }
544  leg->AddEntry(grmx, "Maximum", "P");
545  gr = grmx;
546  }
547  leg->Draw();
548  gPad->Update();
549 
550  if (dofit > 0) {
551  // Make sure the fitting functions are defined
552  Double_t xmi = 0.9;
553  if (nbins > 5) xmi = 1.5;
554  AssertFittingFun(xmi, nbins + .1);
555 
556  // Starting point for the parameters and fit
557  Double_t normrate = -1.;
558  if (dofit == 1) {
559  if (isNorm) {
560  fgFp1n->SetParameter(0, pf->GetBinContent(1));
561  fgFp1n->SetParameter(1, pf->GetBinContent(nbins-1));
562  gr->Fit(fgFp1n);
563  if (verbose) fgFp1n->Print();
564  normrate = fgFp1n->GetParameter(1);
565  } else {
566  fgFp1->SetParameter(0, 0.);
567  fgFp1->SetParameter(1, pf->GetBinContent(1));
568  gr->Fit(fgFp1);
569  if (verbose) fgFp1->Print();
570  normrate = fgFp1->Derivative(1.);
571  }
572  } else if (dofit == 2) {
573  if (isNorm) {
574  fgFp2n->SetParameter(0, pf->GetBinContent(1));
575  fgFp2n->SetParameter(1, pf->GetBinContent(nbins-1));
576  fgFp2n->SetParameter(2, 0.);
577  gr->Fit(fgFp2n);
578  if (verbose) fgFp2n->Print();
579  normrate = fgFp2n->GetParameter(1);
580  } else {
581  fgFp2->SetParameter(0, 0.);
582  fgFp2->SetParameter(1, pf->GetBinContent(1));
583  fgFp2->SetParameter(2, 0.);
584  gr->Fit(fgFp2);
585  if (verbose) fgFp2->Print();
586  normrate = fgFp2->Derivative(1.);
587  }
588  } else {
589  // Starting point for the parameters and fit
590  gFioVn0 = (n0 > 0) ? n0 : (Int_t) (nbins + .1)/2.;
591  gFioVn1 = (n1 > 0) ? n1 : (Int_t) (nbins + .1);
592  if (isNorm) {
593  fgFp3n->SetParameter(0, 0.);
594  fgFp3n->SetParameter(1, pf->GetBinContent(1));
595  fgFp3n->SetParameter(2, pf->GetBinContent(nbins-1));
596  gr->Fit(fgFp3n);
597  if (verbose) fgFp3n->Print();
598  normrate = pf->GetBinContent(1);
599  } else {
600  fgFp3->SetParameter(0, 0.);
601  fgFp3->SetParameter(1, 0.);
602  fgFp3->SetParameter(2, pf->GetBinContent(1));
603  gr->Fit(fgFp3);
604  if (verbose) fgFp3->Print();
605  normrate = fgFp3->Derivative(1.);
606  }
607  }
608 
609  // Notify the cluster performance parameters
610  if (!isNorm) {
611  printf("* ************************************************************ *\n");
612  printf("* *\r");
613  printf("* Cluster: %s\n", description.Data());
614  printf("* Performance measurement from scalability plot: *\n");
615  printf("* *\r");
616  printf("* rate max: %.3f\tmegaRNGPS (@ %d workers)\n", ymx/1000000, kmx);
617  printf("* *\r");
618  printf("* per-worker rate: %.3f\tmegaRNGPS \n", normrate/1000000);
619  printf("* ************************************************************ *\n");
620  } else {
621  printf("* ************************************************************ *\n");
622  printf("* *\r");
623  printf("* Cluster: %s\n", description.Data());
624  printf("* *\r");
625  printf("* Per-worker rate from normalized plot: %.3f\tmegaRNGPS\n", normrate/1000000);
626  printf("* ************************************************************ *\n");
627  }
628  }
629  // Close the file
630  fout->Close();
631  if (grav) fgGraphs->Add(grav);
632  if (grmx) fgGraphs->Add(grmx);
633 }
634 
635 ////////////////////////////////////////////////////////////////////////////////
636 /// Get from TDirectory 'd' the TProfile named 'pfn' and create the graph.
637 /// Return also the max y in mx.
638 
640  Double_t &xmi, Double_t &xmx,
641  Double_t &ymi, Double_t &ymx, Int_t &kmx, TProfile *&pf)
642 {
643  // Sanity checks
644  if (!d || !pfn || (pfn && strlen(pfn) <= 0)) {
645  ::Error("TProofBench::GetGraph", "directory or name not defined!");
646  return (TGraphErrors *)0;
647  }
648 
649  TList *keylist = d->GetListOfKeys();
650  TKey *key = 0;
651  TIter nxk(keylist);
652  while ((key = (TKey *) nxk())) {
653  if (TString(key->GetName()).BeginsWith(pfn)) {
654  pf = (TProfile *) d->Get(key->GetName());
655  break;
656  }
657  }
658  // Sanity checks
659  if (!pf) {
660  ::Error("TProofBench::GetGraph", "TProfile for '%s' not found in directory '%s'", pfn, d->GetName());
661  return (TGraphErrors *)0;
662  }
663 
664  nb = pf->GetNbinsX();
665  TGraphErrors *gr = new TGraphErrors(nb);
666  gr->SetName(TString::Format("Graph_%s", pfn));
667  Double_t xx, ex, yy, ey;
668  ymi = pf->GetBinContent(1);
669  ymx = ymi;
670  xmi = pf->GetBinCenter(1) - pf->GetBinWidth(1)/2. ;
671  xmx = pf->GetBinCenter(nb) + pf->GetBinWidth(nb)/2. ;
672  kmx = -1;
673  for (Int_t k = 1;k <= nb; k++) {
674  xx = pf->GetBinCenter(k);
675  ex = pf->GetBinWidth(k) * .001;
676  yy = pf->GetBinContent(k);
677  ey = pf->GetBinError(k);
678  if (k == 1) {
679  ymi = yy;
680  ymx = yy;
681  kmx = k;
682  } else {
683  if (yy < ymi) ymi = yy;
684  if (yy > ymx) { ymx = yy; kmx = k; }
685  }
686  gr->SetPoint(k-1, xx, yy);
687  gr->SetPointError(k-1, ex, ey);
688  }
689 
690  // Done
691  return gr;
692 }
693 
694 ////////////////////////////////////////////////////////////////////////////////
695 /// Make sure that the fitting functions are defined
696 
698 {
699  if (!fgFp1) {
700  fgFp1 = new TF1("funp1", funp1, mi, mx, 2);
701  fgFp1->SetParNames("offset", "slope");
702  }
703 
704  if (!fgFp1n) {
705  fgFp1n = new TF1("funp1n", funp1n, mi, mx, 2);
706  fgFp1n->SetParNames("decay", "norm rate");
707  }
708 
709  if (!fgFp2) {
710  fgFp2 = new TF1("funp2", funp2, mi, mx, 3);
711  fgFp2->SetParNames("offset", "slope", "deviation");
712  }
713 
714  if (!fgFp2n) {
715  fgFp2n = new TF1("funp2n", funp2n, mi, mx, 3);
716  fgFp2n->SetParNames("decay", "norm rate", "deviation");
717  }
718 
719  if (!fgFp3) {
720  fgFp3 = new TF1("funcpuv", funcpuv, mi, mx, 3);
721  fgFp3->SetParNames("offset", "slope real", "slope hyper");
722  }
723 
724  if (!fgFp3n) {
725  fgFp3n = new TF1("funcpuvn", funcpuvn, mi, mx, 3);
726  fgFp3n->SetParNames("offset", "slope real", "slope hyper");
727  }
728 
729  if (!fgFio) {
730  fgFio = new TF1("funio", funio, mi, mx, 3);
731  fgFio->SetParNames("R1", "RIO", "TotIO");
732  }
733  if (!fgFioV) {
734  fgFioV = new TF1("funiov", funiov, mi, mx, 5);
735  fgFioV->SetParNames("rio", "b1", "b2", "nc", "ri");
736  }
737 
738 }
739 
740 ////////////////////////////////////////////////////////////////////////////////
741 
742 class fileDesc : public TNamed {
743 public:
744  Long_t fMtime; // Modification time
745  TString fDesc; // Test description string, if any
746  fileDesc(const char *n, const char *o,
747  Long_t t, const char *d) : TNamed(n, o), fMtime(t), fDesc(d) { }
748  Int_t Compare(const TObject *o) const {
749  const fileDesc *fd = static_cast<const fileDesc *>(o);
750  if (!fd || (fd && fd->fMtime == fMtime)) return 0;
751  if (fMtime < fd->fMtime) return -1;
752  return 1;
753  }
754 };
755 
756 ////////////////////////////////////////////////////////////////////////////////
757 /// Get performance specs. Check file 'path', or files in directory 'path'
758 /// (default current directory).
759 /// The degree of the polynomial used for the fit is 'degfit' (default 1).
760 
761 void TProofBench::GetPerfSpecs(const char *path, Int_t degfit)
762 {
763  // Locate the file (ask if many)
764  TString pp(path), fn, oo;
765  if (pp.IsNull()) pp = gSystem->WorkingDirectory();
766  FileStat_t st;
767  if (gSystem->GetPathInfo(pp.Data(), st) != 0) {
768  ::Error("TProofBench::GetPerfSpecs", "path '%s' could not be stat'ed - abort", pp.Data());
769  return;
770  }
771  TSortedList filels;
772  if (R_ISDIR(st.fMode)) {
773  // Scan the directory
774  void *dirp = gSystem->OpenDirectory(pp.Data());
775  if (!dirp) {
776  ::Error("TProofBench::GetPerfSpecs", "directory path '%s' could nto be open - abort", pp.Data());
777  return;
778  }
779  const char *ent = 0;
780  while ((ent = gSystem->GetDirEntry(dirp))) {
781  if (!strcmp(ent, ".") || !strcmp(ent, "..")) continue;
782  fn.Form("%s/%s", pp.Data(), ent);
783  if (gSystem->GetPathInfo(fn.Data(), st) != 0) continue;
784  if (!R_ISREG(st.fMode)) continue;
785  fn += "?filetype=raw";
786  TFile *f = TFile::Open(fn);
787  if (!f) continue;
788  char rr[5] = {0};
789  if (!f->ReadBuffer(rr, 4)) {
790  if (!strncmp(rr, "root", 4)) {
791  SafeDelete(f);
792  fn.ReplaceAll("?filetype=raw", "");
793  if ((f = TFile::Open(fn))) {
794  TString desc("<no decription>");
795  TNamed *nmdesc = (TNamed *) f->Get("PB_description");
796  if (nmdesc) desc = nmdesc->GetTitle();
797  if (f->GetListOfKeys()->FindObject("RunCPU"))
798  filels.Add(new fileDesc(fn, "std:", st.fMtime, desc.Data()));
799  if (f->GetListOfKeys()->FindObject("RunCPUx"))
800  filels.Add(new fileDesc(fn, "stdx:", st.fMtime, desc.Data()));
801  } else {
802  ::Warning("TProofBench::GetPerfSpecs", "problems opening '%s'", fn.Data());
803  }
804  }
805  }
806  SafeDelete(f);
807  }
808  } else if (!R_ISREG(st.fMode)) {
809  ::Error("TProofBench::GetPerfSpecs",
810  "path '%s' not a regular file nor a directory - abort", pp.Data());
811  return;
812  } else {
813  // This is the file
814  fn = pp;
815  // Check it
816  TString emsg;
817  Bool_t isOk = kFALSE;
818  if (gSystem->GetPathInfo(fn.Data(), st) == 0) {
819  fn += "?filetype=raw";
820  TFile *f = TFile::Open(fn);
821  if (f) {
822  char rr[5] = {0};
823  if (!(f->ReadBuffer(rr, 4))) {
824  if (!strncmp(rr, "root", 4)) {
825  fn.ReplaceAll("?filetype=raw", "");
826  if ((f = TFile::Open(fn))) {
827  if (f->GetListOfKeys()->FindObject("RunCPU")) oo = "std:";
828  if (f->GetListOfKeys()->FindObject("RunCPUx")) oo = "stdx:";
829  SafeDelete(f);
830  if (!oo.IsNull()) {
831  isOk = kTRUE;
832  } else {
833  emsg.Form("path '%s' does not contain the relevant dirs - abort", fn.Data());
834  }
835  } else {
836  emsg.Form("path '%s' cannot be open - abort", fn.Data());
837  }
838  } else {
839  emsg.Form("'%s' is not a ROOT file - abort", fn.Data());
840  }
841  } else {
842  emsg.Form("could not read first 4 bytes from '%s' - abort", fn.Data());
843  }
844  SafeDelete(f);
845  } else {
846  emsg.Form("path '%s' cannot be open in raw mode - abort", fn.Data());
847  }
848  } else {
849  emsg.Form("path '%s' cannot be stated - abort", fn.Data());
850  }
851  if (!isOk) {
852  ::Error("TProofBench::GetPerfSpecs", "%s", emsg.Data());
853  return;
854  }
855  }
856 
857  fileDesc *nm = 0;
858  // Ask the user, if more then 1
859  if (filels.GetSize() == 1) {
860  nm = (fileDesc *) filels.First();
861  fn = nm->GetName();
862  oo = nm->GetTitle();
863  } else if (filels.GetSize() > 1) {
864  TIter nxf(&filels);
865  Int_t idx = 0;
866  Printf("Several possible files found:");
867  while ((nm = (fileDesc *) nxf())) {
868  Printf(" %d\t%s\t%s\t%s (file: %s)", idx++, nm->GetTitle(),
869  TTimeStamp(nm->fMtime).AsString("s"), nm->fDesc.Data(), nm->GetName());
870  }
871  TString a(Getline(TString::Format("Make your choice [%d] ", idx-1)));
872  if (a.IsNull() || a[0] == '\n') a.Form("%d", idx-1);
873  idx = a.Atoi();
874  if ((nm = (fileDesc *) filels.At(idx))) {
875  fn = nm->GetName();
876  oo = nm->GetTitle();
877  } else {
878  ::Error("TProofBench::GetPerfSpecs", "chosen index '%d' does not exist - abort", idx);
879  return;
880  }
881  } else {
882  if (fn.IsNull()) {
883  ::Error("TProofBench::GetPerfSpecs",
884  "path '%s' is a directory but no ROOT file found in it - abort", pp.Data());
885  return;
886  }
887  }
888 
889  // Now get the specs
890  TProofBench::DrawCPU(fn.Data(), oo.Data(), kFALSE, degfit);
891 }
892 
893 ////////////////////////////////////////////////////////////////////////////////
894 /// Perform a test using dataset 'dset'
895 /// Return 0 on success, -1 on error
896 /// Open the file for the results
897 
899  Int_t start, Int_t stop, Int_t step)
900 {
901  if (OpenOutFile(kTRUE) != 0) {
902  Error("RunDataSet", "problems opening '%s' to save the result", fOutFileName.Data());
903  return -1;
904  }
906 
907  if (fReleaseCache) ReleaseCache(dset);
909  TPBReadType *readType = fReadType;
910  if (!readType) readType = new TPBReadType(TPBReadType::kReadOpt);
911  fRunDS = new TProofBenchRunDataRead(fDS, readType, fOutFile);
916  fRunDS->Run(dset, start, stop, step, fNtries, fDebug, -1);
917  SafeDelete(readType);
918 
919  // Close the file
920  if (SetOutFile(0) != 0)
921  Warning("RunDataSet", "problems closing '%s'", fOutFileName.Data());
922 
923  // Done
924  return 0;
925 }
926 
927 ////////////////////////////////////////////////////////////////////////////////
928 /// Perform a test using dataset 'dset' scanning over the number of workers
929 /// per node.
930 /// Return 0 on success, -1 on error
931 /// Open the file for the results
932 
933 Int_t TProofBench::RunDataSetx(const char *dset, Int_t start, Int_t stop)
934 {
935  if (OpenOutFile(kTRUE) != 0) {
936  Error("RunDataSetx", "problems opening '%s' to save the result", fOutFileName.Data());
937  return -1;
938  }
940 
941  ReleaseCache(dset);
943  TPBReadType *readType = fReadType;
944  if (!readType) readType = new TPBReadType(TPBReadType::kReadOpt);
945  fRunDS = new TProofBenchRunDataRead(fDS, readType, fOutFile);
949  fRunDS->Run(dset, start, stop, -2, fNtries, fDebug, -1);
950  SafeDelete(readType);
951 
952  // Close the file
953  if (SetOutFile(0) != 0)
954  Warning("RunDataSetx", "problems closing '%s'", fOutFileName.Data());
955 
956  // Done
957  return 0;
958 }
959 
960 ////////////////////////////////////////////////////////////////////////////////
961 /// Draw the CPU speedup plot.
962 /// opt = 'typewhat', e.g. 'std:max:'
963 /// type = 'std:' draw standard plot
964 /// 'stdx:' draw standard plot, 1 worker per node
965 /// 'norm:' draw normalized plot
966 /// 'normx:' draw normalized plot, 1 worker per node
967 /// what = 'max:' draw max rate
968 /// 'avg:' draw average rate
969 /// 'all:' draw max and average rate on same plot (default)
970 /// type = 'mbs' MB/s scaling plots (default)
971 /// 'evts' Event/s scaling plots
972 /// dofit = 0 no fit
973 /// 1 fit with default 3 parameter saturated I/O formula
974 /// 2 fit with 4 parameter saturated I/O formula (varying Rcpu)
975 /// n0 = for dofit == 2, number of real cores
976 /// n1 = for dofit == 2, number of total cores (real + hyperthreaded)
977 ///
978 
979 void TProofBench::DrawDataSet(const char *outfile,
980  const char *opt, const char *type, Bool_t verbose,
981  Int_t dofit, Int_t n0, Int_t n1)
982 {
983  // Get the TProfile an create the graphs
984  TFile *fout = TFile::Open(outfile, "READ");
985  if (!fout || (fout && fout->IsZombie())) {
986  ::Error("DrawDataSet", "could not open file '%s' ...", outfile);
987  return;
988  }
989 
990  // Get description
991  TString description("<not available>");
992  TNamed *nmdesc = (TNamed *) fout->Get("PB_description");
993  if (nmdesc) description = nmdesc->GetTitle();
994 
995  // Parse option
996  TString oo(opt);
997  Bool_t isNorm = (oo.Contains("norm")) ? kTRUE : kFALSE;
998  Bool_t isX = (oo.Contains("stdx:") || oo.Contains("normx:")) ? kTRUE : kFALSE;
999  Bool_t doAvg = (oo.Contains("all:") || oo.Contains("avg:")) ? kTRUE : kFALSE;
1000  Bool_t doMax = (oo.Contains("all:") || oo.Contains("max:")) ? kTRUE : kFALSE;
1001 
1002  const char *dirn = (isX) ? "RunDataReadx" : "RunDataRead";
1003  TDirectory *d = (TDirectory *) fout->Get(dirn);
1004  if (!d) {
1005  ::Error("DrawCPU", "could not find directory '%s' ...", dirn);
1006  fout->Close();
1007  delete fout;
1008  return;
1009  }
1010  d->cd();
1011 
1012  TString hprofn, hmaxn;
1013  const char *lx = (isX) ? "_x" : "";
1014  const char *ln = (isNorm) ? "Norm" : "Prof";
1015  Bool_t isIO = kTRUE;
1016  if (type && !strcmp(type, "evts")) {
1017  hprofn.Form("%s%s_DataRead_QR_Evts", ln, lx);
1018  hmaxn.Form("%s%s_DataRead_PS_MaxEvts", ln, lx);
1019  isIO = kFALSE;
1020  } else {
1021  hprofn.Form("%s%s_DataRead_QR_IO", ln, lx);
1022  hmaxn.Form("%s%s_DataRead_PS_MaxIO", ln, lx);
1023  }
1024 
1025  Double_t xmin = -1., xmax = -1.;
1026  Double_t ami = -1., amx = -1., mmi = -1., mmx = -1.;
1027  Int_t kamx = -1, kmmx = -1, nbins = -1;
1028  Double_t ymx = -1., ymi = -1.;
1029 
1030  TProfile *pf = 0;
1031  Int_t kmx = -1;
1032 
1033  TProfile *pfav = 0;
1034  TGraphErrors *grav = 0;
1035  if (doAvg) {
1036  if (!(grav = GetGraph(d, hprofn, nbins, xmin, xmax, ami, amx, kamx, pfav))) {
1037  ::Error("DrawCPU", "could not find '%s' ...", hprofn.Data());
1038  fout->Close();
1039  delete fout;
1040  return;
1041  }
1042  ymx = amx;
1043  ymi = ami;
1044  pf = pfav;
1045  kmx = kamx;
1046  }
1047 
1048  TProfile *pfmx = 0;
1049  TGraphErrors *grmx = 0;
1050  if (doMax) {
1051  if (!(grmx = GetGraph(d, hmaxn, nbins, xmin, xmax, mmi, mmx, kmmx, pfmx))) {
1052  ::Warning("DrawCPU", "could not find '%s': feature added in 5.34/11", hmaxn.Data());
1053  if (!grav) {
1054  // Nothing to do if not asked for the average
1055  fout->Close();
1056  delete fout;
1057  return;
1058  }
1059  doMax = kFALSE;
1060  }
1061  if (mmx > ymx) ymx = mmx;
1062  if ((ymi > 0 && mmi < ymi) || (ymi < 0.)) ymi = mmi;
1063  pf = pfmx;
1064  kmx = kmmx;
1065  }
1066 
1067  // Create the canvas
1068  TCanvas *cpu = new TCanvas("dataset", "Rate vs wrks",204,69,1050,502);
1069  cpu->Range(-3.106332,0.7490716,28.1362,1.249867);
1070 
1071  TH1F *hgr = new TH1F("Graph-DataSet"," Data Read speed-up", nbins*4, xmin, xmax);
1072  hgr->SetMaximum(ymx + (ymx-ymi)*0.2);
1073  hgr->SetMinimum(0);
1074  if (isNorm) hgr->SetMaximum(ymx*1.2);
1075  hgr->SetDirectory(0);
1076  hgr->SetStats(0);
1077  hgr->GetXaxis()->SetTitle(pf->GetXaxis()->GetTitle());
1078  hgr->GetXaxis()->CenterTitle(true);
1079  hgr->GetXaxis()->SetLabelSize(0.05);
1080  hgr->GetXaxis()->SetTitleSize(0.06);
1081  hgr->GetXaxis()->SetTitleOffset(0.62);
1082  hgr->GetYaxis()->SetLabelSize(0.06);
1083  hgr->GetYaxis()->SetTitleSize(0.08);
1084  hgr->GetYaxis()->SetTitleOffset(0.52);
1085  if (isIO) {
1086  hgr->GetYaxis()->SetTitle("Rate (MB/s)");
1087  } else {
1088  hgr->GetYaxis()->SetTitle("Rate (events/s)");
1089  }
1090 
1091  TLegend *leg = 0;
1092  if (isNorm) {
1093  leg = new TLegend(0.7, 0.8, 0.9, 0.9);
1094  } else {
1095  leg = new TLegend(0.1, 0.8, 0.3, 0.9);
1096  }
1097 
1098  TGraphErrors *gr = 0;
1099  if (doAvg) {
1100  grav->SetFillColor(1);
1101  grav->SetLineColor(13);
1102  grav->SetMarkerColor(4);
1103  grav->SetMarkerStyle(21);
1104  grav->SetMarkerSize(1.2);
1105  grav->SetHistogram(hgr);
1106 
1107  if (verbose) grav->Print();
1108  grav->Draw("alp");
1109  leg->AddEntry(grav, "Average", "P");
1110  gr = grav;
1111  }
1112  if (doMax) {
1113  grmx->SetFillColor(1);
1114  grmx->SetLineColor(13);
1115  grmx->SetMarkerColor(2);
1116  grmx->SetMarkerStyle(29);
1117  grmx->SetMarkerSize(1.8);
1118  grmx->SetHistogram(hgr);
1119 
1120  if (verbose) grmx->Print();
1121  if (doAvg) {
1122  grmx->Draw("lpSAME");
1123  } else {
1124  grmx->Draw("alp");
1125  }
1126  leg->AddEntry(grmx, "Maximum", "P");
1127  gr = grmx;
1128  }
1129  leg->Draw();
1130  gPad->Update();
1131 
1132  Double_t normrate = -1.;
1133  if (dofit > 0) {
1134  // Make sure the fitting functions are defined
1135  Double_t xmi = 0.9;
1136  if (nbins > 5) xmi = 1.5;
1137  AssertFittingFun(xmi, nbins + .1);
1138 
1139  if (dofit == 1) {
1140  // Starting point for the parameters and fit
1141  fgFio->SetParameter(0, pf->GetBinContent(1));
1142  fgFio->SetParameter(1, pf->GetBinContent(nbins-1));
1143  fgFio->SetParameter(2, pf->GetBinContent(nbins-1));
1144  gr->Fit(fgFio);
1145  if (verbose) fgFio->Print();
1146  normrate = fgFio->Derivative(1.);
1147  } else if (dofit > 1) {
1148  // Starting point for the parameters and fit
1149  gFioVn0 = (n0 > 0) ? n0 : (Int_t) (nbins + .1)/2.;
1150  gFioVn1 = (n1 > 0) ? n1 : (Int_t) (nbins + .1);
1151  fgFioV->SetParameter(0, 20.);
1152  fgFioV->SetParameter(1, pf->GetBinContent(1));
1153  fgFioV->SetParameter(2, pf->GetBinContent(1));
1154  fgFioV->SetParameter(3, 4.);
1155  fgFioV->SetParameter(4, 1000.);
1156 
1157  gr->Fit(fgFioV);
1158  if (verbose) fgFio->Print();
1159  normrate = fgFioV->Derivative(1.);
1160  }
1161  }
1162 
1163  // Notify the cluster performance parameters
1164  if (!isNorm) {
1165  printf("* ************************************************************ *\n");
1166  printf("* *\r");
1167  printf("* Cluster: %s\n", description.Data());
1168  printf("* Performance measurement from scalability plot: *\n");
1169  printf("* *\r");
1170  if (isIO) {
1171  printf("* rate max: %.3f\tMB/s (@ %d workers)\n", ymx, kmx);
1172  printf("* *\r");
1173  printf("* per-worker rate: %.3f\tMB/s \n", normrate);
1174  } else {
1175  printf("* rate max: %.3f\tevts/s (@ %d workers)\n", ymx, kmx);
1176  }
1177  printf("* ************************************************************ *\n");
1178  }
1179  // Close the file
1180  fout->Close();
1181  if (grav) fgGraphs->Add(grav);
1182  if (grmx) fgGraphs->Add(grmx);
1183 }
1184 
1185 ////////////////////////////////////////////////////////////////////////////////
1186 /// Draw the efficiency plot.
1187 /// opt = 'cpu' or 'data' (default the first found)
1188 ///
1189 
1190 void TProofBench::DrawEfficiency(const char *outfile,
1191  const char *opt, Bool_t verbose)
1192 {
1193  // Get the TProfile an create the graphs
1194  TFile *fout = TFile::Open(outfile, "READ");
1195  if (!fout || (fout && fout->IsZombie())) {
1196  ::Error("DrawEfficiency", "could not open file '%s' ...", outfile);
1197  return;
1198  }
1199 
1200  // Get description
1201  TString description("<not available>");
1202  TNamed *nmdesc = (TNamed *) fout->Get("PB_description");
1203  if (nmdesc) description = nmdesc->GetTitle();
1204 
1205  // Parse option
1206  TString oo(opt), ln("CPU");
1207  const char *dirs[4] = { "RunCPU", "RunCPUx", "RunDataRead", "RunDataReadx"};
1208  const char *labs[4] = { "CPU", "CPU", "DataRead", "DataRead"};
1209  Int_t fst = 0, lst = 3;
1210  if (oo == "cpu") {
1211  lst = 0;
1212  } else if (oo == "cpux") {
1213  fst = 1;
1214  lst = 1;
1215  } else if (oo.BeginsWith("data")) {
1216  if (oo.EndsWith("x")) {
1217  fst = 3;
1218  lst = 3;
1219  } else {
1220  fst = 2;
1221  lst = 2;
1222  }
1223  }
1224  const char *dirn = 0;
1225  TDirectory *d = 0;
1226  for (Int_t i = fst; i <= lst; i++) {
1227  if ((d = (TDirectory *) fout->Get(dirs[i]))) {
1228  dirn = dirs[i];
1229  ln = labs[i];
1230  break;
1231  }
1232  }
1233  if (!d && !dirn) {
1234  ::Error("DrawEfficiency", "could not find directory ...");
1235  fout->Close();
1236  delete fout;
1237  return;
1238  }
1239  d->cd();
1240 
1241  TString hprof;
1242  hprof.Form("Prof_%s_CPU_eff", ln.Data());
1243 
1244  Double_t xmin = -1., xmax = -1.;
1245  Int_t kmx = -1, nbins = -1;
1246  Double_t ymx = -1., ymi = -1.;
1247 
1248  TProfile *pf = 0;
1249  TGraphErrors *gr = 0;
1250  if (!(gr = GetGraph(d, hprof, nbins, xmin, xmax, ymi, ymx, kmx, pf))) {
1251  ::Error("DrawEfficiency", "could not find '%s' ...", hprof.Data());
1252  fout->Close();
1253  delete fout;
1254  return;
1255  }
1256 
1257  // Create the canvas
1258  TCanvas *cpu = new TCanvas("efficiency", "efficiency vs wrks",204,69,1050,502);
1259  cpu->Range(-3.106332,0.7490716,28.1362,1.249867);
1260 
1261  TH1F *hgr = new TH1F("Graph-Efficiency","CPU effectiveness", nbins*4, xmin, xmax);
1262  hgr->SetMaximum(1.2);
1263  hgr->SetMinimum(0);
1264  hgr->SetDirectory(0);
1265  hgr->SetStats(0);
1266  hgr->GetXaxis()->SetTitle(pf->GetXaxis()->GetTitle());
1267  hgr->GetXaxis()->CenterTitle(true);
1268  hgr->GetXaxis()->SetLabelSize(0.05);
1269  hgr->GetXaxis()->SetTitleSize(0.06);
1270  hgr->GetXaxis()->SetTitleOffset(0.62);
1271  hgr->GetYaxis()->SetLabelSize(0.06);
1272  hgr->GetYaxis()->SetTitleSize(0.08);
1273  hgr->GetYaxis()->SetTitleOffset(0.52);
1274  hgr->GetYaxis()->SetTitle("CPU effectiveness");
1275 
1276  gr->SetFillColor(1);
1277  gr->SetLineColor(13);
1278  gr->SetMarkerColor(4);
1279  gr->SetMarkerStyle(21);
1280  gr->SetMarkerSize(1.2);
1281  gr->SetHistogram(hgr);
1282 
1283  if (verbose) gr->Print();
1284  gr->Draw("alp");
1285 
1286  // Notify the cluster performance parameters
1287  printf("* ************************************************************ *\n");
1288  printf("* *\r");
1289  printf("* Cluster: %s\n", description.Data());
1290  printf("* CPU effectiveness measurement: *\n");
1291  printf("* *\r");
1292  printf("* effectiveness max: %.3f (@ %d workers)\n", ymx, kmx);
1293  printf("* *\r");
1294  printf("* ************************************************************ *\n");
1295  // Close the file
1296  fout->Close();
1297  if (gr) fgGraphs->Add(gr);
1298 }
1299 
1300 ////////////////////////////////////////////////////////////////////////////////
1301 /// Release memory cache for dataset 'dset'
1302 /// Return 0 on success, -1 on error
1303 
1305 {
1306  // Do it via the dataset handler
1307  if (!fDS) fDS = new TProofBenchDataSet(fProofDS);
1308  return fDS ? fDS->ReleaseCache(dset) : -1;
1309 }
1310 
1311 ////////////////////////////////////////////////////////////////////////////////
1312 /// Physically remove the dataset 'dset', i.e. remove the dataset and the files
1313 /// it describes
1314 /// Return 0 on success, -1 on error
1315 
1317 {
1318  // Do it via the dataset handler
1319  if (!fDS) fDS = new TProofBenchDataSet(fProofDS);
1320  return fDS ? fDS->RemoveFiles(dset) : -1;
1321 }
1322 
1323 ////////////////////////////////////////////////////////////////////////////////
1324 /// Create the largest dataset for the run.
1325 /// Defaults for
1326 /// dataset name, filename root
1327 /// are
1328 /// "BenchDataSet", "event"
1329 /// respectively.
1330 /// These can be changed via dset and fnroot, respectively.
1331 /// The string 'fnroot' defines the location of the files, interpreted as an URL.
1332 /// Examples:
1333 /// fnroot files
1334 /// 'event' <datadir>/event_<ord>_<#>.root
1335 /// '/mss/event' /mss/event_<ord>_<#>.root
1336 /// 'root://srv//mss/event?remote=1'
1337 /// root://srv//mss/event_<ord>_<#>?remote=1.root
1338 /// Default selector is TSelEventGen. Use SetDataGenSel and SetDataGenPar to change it
1339 /// and to pass the list of PARs defining the alternative selector.
1340 /// The argument 'nevt' controls the number of events per file (-1 for the default,
1341 /// which is 30000).
1342 /// Return 0 on success, -1 on error
1343 
1344 Int_t TProofBench::MakeDataSet(const char *dset, Long64_t nevt, const char *fnroot,
1345  Bool_t regenerate)
1346 {
1347  if (dset && strlen(dset) > 0) fDataSet = dset;
1348 
1349  // Load the selector, if needed
1350  if (!TClass::GetClass(fDataGenSel)) {
1351  // Is it the default selector?
1353  // Load the parfile
1355  Info("MakeDataSet", "uploading '%s' ...", par.Data());
1356  if (fProof->UploadPackage(par) != 0) {
1357  Error("MakeDataSet", "problems uploading '%s' - cannot continue", par.Data());
1358  return -1;
1359  }
1360  Info("MakeDataSet", "enabling '%s' ...", kPROOF_BenchDataSelPar);
1362  Error("MakeDataSet", "problems enabling '%s' - cannot continue", kPROOF_BenchDataSelPar);
1363  return -1;
1364  }
1365  } else {
1366  if (fDataGenPar.IsNull()) {
1367  Error("MakeDataSet", "you should load the class '%s' before running the benchmark", fDataGenSel.Data());
1368  return -1;
1369  }
1370  }
1371  // Load additional PAR files, if any or required by the alternative selector
1372  TString par;
1373  Int_t from = 0;
1374  while (fDataGenPar.Tokenize(par, from, ",")) {
1375  Info("MakeDataSet", "Uploading '%s' ...", par.Data());
1376  if (fProof->UploadPackage(par) != 0) {
1377  Error("MakeDataSet", "problems uploading '%s' - cannot continue", par.Data());
1378  return -1;
1379  }
1380  Info("MakeDataSet", "Enabling '%s' ...", par.Data());
1381  if (fProof->EnablePackage(par) != 0) {
1382  Error("MakeDataSet", "problems enabling '%s' - cannot continue", par.Data());
1383  return -1;
1384  }
1385  }
1386  // Check
1387  if (!TClass::GetClass(fDataGenSel)) {
1388  Error("MakeDataSet", "failed to load '%s'", fDataGenSel.Data());
1389  return -1;
1390  }
1391  }
1392 
1393  // For files, 30000 evst each (about 600 MB total) per worker
1394  TString fn, fnr("event");
1395  Bool_t remote = kFALSE;
1396  if (fnroot && strlen(fnroot) > 0) {
1397  TUrl ur(fnroot, kTRUE);
1398  if (!strcmp(ur.GetProtocol(), "file") &&
1400  fnr = fnroot;
1401  } else {
1402  fnr = gSystem->BaseName(ur.GetFile());
1403  // We need to set the basedir
1404  TString bdir = gSystem->GetDirName(fnroot);
1405  bdir += "/<fn>";
1406  fProof->SetParameter("PROOF_BenchmarkBaseDir", bdir.Data());
1407  // Flag as remote, if so
1408  if (strcmp(ur.GetProtocol(), "file")) remote = kTRUE;
1409  }
1410  }
1411  TProofNodes pn(fProof);
1412  TMap *filesmap = new TMap;
1413  TMap *nodesmap = pn.GetMapOfNodes();
1414  TIter nxnd(nodesmap);
1415  TList *wli = 0;
1416  TObject *obj = 0;
1417  Int_t kf = 1;
1418  while ((obj = nxnd()) != 0) {
1419  if ((wli = dynamic_cast<TList *>(nodesmap->GetValue(obj)))) {
1420  THashList *fli = new THashList;
1421  Int_t nf = wli->GetSize() * fNFilesWrk;
1422  TSlaveInfo *wi = (TSlaveInfo *) wli->First();
1423  while (nf--) {
1424  fn.Form("%s-%s-%d.root", fnr.Data(), wi->GetName(), kf++);
1425  // Add to the node list for generation
1426  fli->Add(new TObjString(fn));
1427  }
1428  filesmap->Add(new TObjString(obj->GetName()), fli);
1429  }
1430  }
1431  filesmap->Print();
1432  // Prepare for file generation ... add map in the input list
1433  filesmap->SetName("PROOF_FilesToProcess");
1434  fProof->AddInput(filesmap);
1435 
1436  // Set parameters for processing
1437  TString oldpack;
1438  if (TProof::GetParameter(fProof->GetInputList(), "PROOF_Packetizer", oldpack) != 0) oldpack = "";
1439  fProof->SetParameter("PROOF_Packetizer", "TPacketizerFile");
1440  Int_t oldnotass = -1;
1441  if (TProof::GetParameter(fProof->GetInputList(), "PROOF_ProcessNotAssigned", oldnotass) != 0) oldnotass = -1;
1442  fProof->SetParameter("PROOF_ProcessNotAssigned", (Int_t)0);
1443 
1444  // Process
1445  Long64_t ne = (nevt > 0) ? nevt : 30000;
1446  fProof->SetParameter("PROOF_BenchmarkNEvents", ne);
1447  fProof->SetParameter("PROOF_BenchmarkRegenerate", Int_t(regenerate));
1449  fProof->DeleteParameters("PROOF_BenchmarkNEvents");
1450  fProof->DeleteParameters("PROOF_BenchmarkRegenerate");
1451  fProof->DeleteParameters("PROOF_BenchmarkBaseDir");
1452 
1453  // Restore parameters
1454  if (!oldpack.IsNull())
1455  fProof->SetParameter("PROOF_Packetizer", oldpack);
1456  else
1457  fProof->DeleteParameters("PROOF_Packetizer");
1458  if (oldnotass != -1)
1459  fProof->SetParameter("PROOF_ProcessNotAssigned", oldnotass);
1460  else
1461  fProof->DeleteParameters("PROOF_ProcessNotAssigned");
1462 
1463  // Cleanup
1464  if (fProof->GetInputList()) fProof->GetInputList()->Remove(filesmap);
1465  filesmap->SetOwner(kTRUE);
1466  delete filesmap;
1467 
1468  // The dataset to be registered in the end with proper port
1469  TFileCollection *fc = new TFileCollection("dum", "dum");
1470 
1471  if (fProof->GetOutputList()) {
1472  fProof->GetOutputList()->Print();
1473  TIter nxout(fProof->GetOutputList());
1474  while ((obj = nxout())) {
1475  TList *fli = dynamic_cast<TList *>(obj);
1476  if (fli && TString(fli->GetName()).BeginsWith("PROOF_FilesGenerated_")) {
1477  TIter nxfg(fli);
1478  TFileInfo *fi = 0;
1479  while ((fi = (TFileInfo *) nxfg()))
1480  fc->Add(fi);
1481  fli->SetOwner(kFALSE);
1482  }
1483  }
1484  // Register the new dataset, overwriting any existing dataset wth the same name
1485  // trusting the existing information
1486  fc->Update();
1487  if (fc->GetNFiles() > 0) {
1488  if (remote) fc->SetBit(TFileCollection::kRemoteCollection);
1489  if (!(fProof->RegisterDataSet(fDataSet, fc, "OT")))
1490  Warning("MakeDataSet", "problems registering '%s'", dset);
1491  } else {
1492  Warning("MakeDataSet", "dataset '%s' is empty!", dset);
1493  }
1494  } else {
1495  Warning("MakeDataSet", "PROOF output list is empty!");
1496  }
1497 
1498  SafeDelete(fc);
1499 
1500  // Get updated information
1502  if (fc) {
1503  fc->Print("F");
1504  } else {
1505  Warning("MakeDataSet", "dataset '%s' was not generated!", fDataSet.Data());
1506  }
1507 
1508  SafeDelete(fc);
1509 
1510  // Done
1511  return 0;
1512 }
1513 
1514 ////////////////////////////////////////////////////////////////////////////////
1515 /// Copy the files of dataset 'dset' to 'destdir' and create a new dataset named 'dsetdst'
1516 /// decribing them.
1517 /// Return 0 on success, -1 on error
1518 
1519 Int_t TProofBench::CopyDataSet(const char *dset, const char *dsetdst, const char *destdir)
1520 {
1521  // Make some checks
1522  if (!fProof) {
1523  Error("CopyDataSet", "no PROOF found - cannot continue");
1524  return -1;
1525  }
1526  if (!dset || (dset && !fProof->ExistsDataSet(dset))) {
1527  Error("CopyDataSet", "dataset '%s' does not exist", dset);
1528  return -1;
1529  }
1530  if (!dsetdst || (dsetdst && fProof->ExistsDataSet(dsetdst))) {
1531  if (isatty(0) != 0 && isatty(1) != 0) {
1532  Printf("Target dataset '%s' exists already:"
1533  " do you want to remove it first?", dsetdst);
1534  const char *a = Getline("[Y,n] ");
1535  Printf("a: %s", a);
1536  if (a[0] == 'Y' || a[0] == 'y' || a[0] == '\n') {
1537  Info("CopyDataSet", "removing dataset '%s' ...", dsetdst);
1538  RemoveDataSet(dsetdst);
1539  } else {
1540  return -1;
1541  }
1542  } else {
1543  Error("CopyDataSet", "destination dataset '%s' does already exist: remove it first", dsetdst);
1544  return -1;
1545  }
1546  }
1547 
1548  // The TFileCollection object for the new dataset
1549  TFileCollection *fc = fProof->GetDataSet(dset);
1550  if (!fc) {
1551  Error("CopyDataSet", "problems retrieving TFileCollection for dataset '%s'", dset);
1552  return -1;
1553  }
1554  TFileCollection *fcn = new TFileCollection(dsetdst, "");
1555  TString fn;
1556  TFileInfo *fi = 0;
1557  TIter nxfi(fc->GetList());
1558  while ((fi = (TFileInfo *) nxfi())) {
1559  fn.Form("%s/%s", destdir, gSystem->BaseName(fi->GetCurrentUrl()->GetFile()));
1560  Info("CopyDataSet", "adding info for file '%s'", fn.Data());
1561  fcn->Add(new TFileInfo(fn));
1562  }
1563  delete fc;
1564 
1565  // Do it via the dataset handler
1566  if (!fDS) fDS = new TProofBenchDataSet(fProofDS);
1567  if (fDS->CopyFiles(dset, destdir) != 0) {
1568  Error("CopyDataSet", "problems copying files of dataset '%s' to dest dir '%s'", dset, destdir);
1569  delete fcn;
1570  return -1;
1571  }
1572 
1573  // Register the new dataset, overwriting any existing dataset wth the same name
1574  // trusting the existing information
1575  Int_t rc = 0;
1576  if (!(fProof->RegisterDataSet(dsetdst, fcn, "OT"))) {
1577  Error("CopyDataSet", "problems registering and verifying '%s'", dsetdst);
1578  rc = -1;
1579  }
1580  delete fcn;
1581 
1582  // Done
1583  return rc;
1584 }
1585 
1586 ////////////////////////////////////////////////////////////////////////////////
1587 /// Set the PROOF instance to be used for dataset operations, like releasing
1588 /// cache ...
1589 /// Use SetProofDS(0) to reset and using the default PROOF
1590 
1592 {
1593  if (pds && !pds->IsValid()) {
1594  Error("SetProofDS", "trying to set an invalid PROOF instance");
1595  return;
1596  }
1597  fProofDS = pds ? pds : fProof;
1598  if (fProofDS) {
1599  SafeDelete(fDS);
1601  }
1602  // Done
1603  return;
1604 }
1605 
TProofBenchDataSet::ReleaseCache
Int_t ReleaseCache(const char *dset)
Release memory cache for dataset 'dset' Return 0 on success, -1 on error.
Definition: TProofBenchDataSet.cxx:46
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
TAttMarker::SetMarkerSize
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
ex
Double_t ex[n]
Definition: legend1.C:17
TSystem::Unlink
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1379
n
const Int_t n
Definition: legend1.C:16
TSystem::GetPathInfo
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1396
TProofBench::fProof
TProof * fProof
Definition: TProofBench.h:44
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
TFileInfo
Class describing a generic file including meta information.
Definition: TFileInfo.h:39
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TH1F.h
TCollection::Print
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
Definition: TCollection.cxx:476
TProofBench::fSelOption
TString fSelOption
Definition: TProofBench.h:63
TDatime::GetHour
Int_t GetHour() const
Definition: TDatime.h:69
TGraph::Draw
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
Definition: TGraph.cxx:760
TFileInfo::GetCurrentUrl
TUrl * GetCurrentUrl() const
Return the current url.
Definition: TFileInfo.cxx:249
TProofBench::fCPUSel
TString fCPUSel
Definition: TProofBench.h:57
f
#define f(i)
Definition: RSha256.hxx:104
TProofNodes.h
TProofNodes
PROOF worker node information
Definition: TProofNodes.h:28
TProfile::GetBinError
virtual Double_t GetBinError(Int_t bin) const
Return bin error of a Profile histogram.
Definition: TProfile.cxx:884
TProof::UseDynamicStartup
Bool_t UseDynamicStartup() const
Definition: TProof.h:921
TNamed::Compare
virtual Int_t Compare(const TObject *obj) const
Compare two TNamed objects.
Definition: TNamed.cxx:85
TPad::Range
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Set world coordinate system for the pad.
Definition: TPad.cxx:5196
TString::Atoi
Int_t Atoi() const
Return integer value of string.
Definition: TString.cxx:1921
funio
Double_t funio(Double_t *xx, Double_t *par)
I/O saturated rate function.
Definition: TProofBench.cxx:117
TH1::SetMinimum
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:399
funiov
Double_t funiov(Double_t *xx, Double_t *par)
I/O saturated rate function with varying Rcpu.
Definition: TProofBench.cxx:128
TProofBench::fRunCPU
TProofBenchRunCPU * fRunCPU
Definition: TProofBench.h:65
fc
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:3728
TSystem::BaseName
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:933
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:578
TTimeStamp.h
TProofBench::fgFioV
static TF1 * fgFioV
Definition: TProofBench.h:85
TString::Data
const char * Data() const
Definition: TString.h:369
TProofBench::fgFp1n
static TF1 * fgFp1n
Definition: TProofBench.h:78
TSystem::IsAbsoluteFileName
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Definition: TSystem.cxx:950
TFileCollection::kRemoteCollection
@ kRemoteCollection
Definition: TFileCollection.h:60
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
TObjString.h
FileStat_t
Definition: TSystem.h:124
FileStat_t::fMtime
Long_t fMtime
Definition: TSystem.h:131
TProofBench::RemoveDataSet
Int_t RemoveDataSet(const char *dset)
Physically remove the dataset 'dset', i.e.
Definition: TProofBench.cxx:1316
TF1::SetParNames
virtual void SetParNames(const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
Set up to 10 parameter names.
Definition: TF1.cxx:3479
xmax
float xmax
Definition: THbookFile.cxx:95
TObject::Info
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:864
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TLegend.h
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TSlaveInfo
Definition: TProof.h:212
TDatime::GetDate
Int_t GetDate() const
Return date in form of 19971224 (i.e. 24/12/1997)
Definition: TDatime.cxx:248
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
TMap::GetValue
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:236
TStyle.h
TFile::Open
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3994
funcpuvn
Double_t funcpuvn(Double_t *xx, Double_t *par)
Function with varying Rcpu normalized.
Definition: TProofBench.cxx:168
Int_t
int Int_t
Definition: RtypesCore.h:45
TDirectoryFile::cd
Bool_t cd(const char *path=nullptr) override
Change current directory to "this" directory.
Definition: TDirectoryFile.cxx:340
TProofBenchRunCPU::Run
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.
Definition: TProofBenchRunCPU.cxx:242
TProofBench::DrawEfficiency
static void DrawEfficiency(const char *outfile, const char *opt="", Bool_t verbose=kFALSE)
Draw the efficiency plot.
Definition: TProofBench.cxx:1190
TH1::GetBinWidth
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
Definition: TH1.cxx:8929
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TProofBench::fDataSel
TString fDataSel
Definition: TProofBench.h:59
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:543
TProofBench::fDescription
TNamed * fDescription
Definition: TProofBench.h:71
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
kPROOF_BenchDataSelPar
const char *const kPROOF_BenchDataSelPar
Definition: TProofBenchTypes.h:25
TClass.h
TProof::ExistsDataSet
virtual Bool_t ExistsDataSet(const char *dataset)
Returns kTRUE if 'dataset' exists, kFALSE otherwise.
Definition: TProof.cxx:10858
TProof::EnablePackage
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
Definition: TProof.cxx:8165
TProofBench::fNFilesWrk
Int_t fNFilesWrk
Definition: TProofBench.h:53
TAttLine::SetLineColor
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
TAxis::CenterTitle
void CenterTitle(Bool_t center=kTRUE)
Center axis title.
Definition: TAxis.h:184
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
TCanvas.h
TProof::SetParameter
void SetParameter(const char *par, const char *value)
Set input list parameter.
Definition: TProof.cxx:9812
TMap::Add
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition: TMap.cxx:54
TProfile.h
TProof::GetEnvVars
static const TList * GetEnvVars()
Get environemnt variables.
Definition: TProof.cxx:11741
TProof::GetDataSet
virtual TFileCollection * GetDataSet(const char *dataset, const char *optStr="")
Get a list of TFileInfo objects describing the files of the specified dataset.
Definition: TProof.cxx:10927
TString
Basic string class.
Definition: TString.h:136
TProofBench::fUnlinkOutfile
Bool_t fUnlinkOutfile
Definition: TProofBench.h:40
TSystem::AccessPathName
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1294
TProof::UploadPackage
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition: TProof.cxx:8431
R_ISREG
Bool_t R_ISREG(Int_t mode)
Definition: TSystem.h:118
TProofBenchRun::SetSelName
virtual void SetSelName(const char *sel)
Definition: TProofBenchRun.h:47
TProofBench::fgFp2n
static TF1 * fgFp2n
Definition: TProofBench.h:80
TFile.h
TSystem::GetDirName
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1030
bool
TSystem::WorkingDirectory
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:870
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
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TProofBenchRunCPU
CPU-intensive PROOF benchmark test generates events and fill 1, 2, or 3-D histograms.
Definition: TProofBenchRunCPU.h:41
TProof::GetOutputList
TList * GetOutputList()
Get list with all object created during processing (see Process()).
Definition: TProof.cxx:9798
TAttAxis::SetTitleSize
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title.
Definition: TAttAxis.cxx:303
TAxis::GetTitle
const char * GetTitle() const
Returns title of object.
Definition: TAxis.h:129
TDatime::GetMinute
Int_t GetMinute() const
Definition: TDatime.h:70
TROOT.h
TF1::SetParameter
virtual void SetParameter(Int_t param, Double_t value)
Definition: TF1.h:633
TSortedList.h
TObjString
Collectable string class.
Definition: TObjString.h:28
funp1
Double_t funp1(Double_t *xx, Double_t *par)
Simple polynomial 1st degree.
Definition: TProofBench.cxx:81
kPROOF_BenchParDir
const char *const kPROOF_BenchParDir
Definition: TProofBenchTypes.h:26
TGraphErrors::Print
virtual void Print(Option_t *chopt="") const
Print graph and errors values.
Definition: TGraphErrors.cxx:702
TProofBenchRunDataRead::Run
void Run(Long64_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
Definition: TProofBenchRunDataRead.h:107
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TList::At
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:357
TProofBench::fgFp3
static TF1 * fgFp3
Definition: TProofBench.h:81
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
TProofBench::GetPerfSpecs
static void GetPerfSpecs(const char *path=".", Int_t degfit=1)
Get performance specs.
Definition: TProofBench.cxx:761
TAttAxis::SetLabelSize
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition: TAttAxis.cxx:203
TString::Tokenize
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2197
TDirectoryFile::Get
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Definition: TDirectoryFile.cxx:909
TProofBenchDataSet
Handle operations on datasets used by ProofBench.
Definition: TProofBenchDataSet.h:27
TProofBench::fOutFile
TFile * fOutFile
Definition: TProofBench.h:46
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:171
TProof::AddInput
void AddInput(TObject *obj)
Add objects that might be needed during the processing of the selector (see Process()).
Definition: TProof.cxx:9724
TH1::GetYaxis
TAxis * GetYaxis()
Definition: TH1.h:321
TProof::IsLite
Bool_t IsLite() const
Definition: TProof.h:933
TFileInfo.h
TPBHistType
Definition: TProofBenchTypes.h:57
funp1n
Double_t funp1n(Double_t *xx, Double_t *par)
Normalized 1st degree.
Definition: TProofBench.cxx:99
xmin
float xmin
Definition: THbookFile.cxx:95
TProofNodes::GetMapOfNodes
TMap * GetMapOfNodes() const
Definition: TProofNodes.h:53
THashList
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:34
TGraph::SetName
virtual void SetName(const char *name="")
Set graph name.
Definition: TGraph.cxx:2313
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
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
FileStat_t::fMode
Int_t fMode
Definition: TSystem.h:127
TSortedList
A sorted doubly linked list.
Definition: TSortedList.h:28
TProof::GetMaster
const char * GetMaster() const
Definition: TProof.h:903
gr
TGraphErrors * gr
Definition: legend1.C:25
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
TProof::GetInputList
TList * GetInputList()
Get input list.
Definition: TProof.cxx:9743
funp2n
Double_t funp2n(Double_t *xx, Double_t *par)
Normalized 2nd degree.
Definition: TProofBench.cxx:108
TAttMarker::SetMarkerColor
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
a
auto * a
Definition: textangle.C:12
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
TProof.h
TProofBenchRunCPU.h
TH1::GetBinCenter
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition: TH1.cxx:8907
funcpuv
Double_t funcpuv(Double_t *xx, Double_t *par)
Function with varying Rcpu.
Definition: TProofBench.cxx:151
gFioVn0
static Int_t gFioVn0
Definition: TProofBench.cxx:73
Long_t
long Long_t
Definition: RtypesCore.h:54
TProofBenchDataSet::CopyFiles
Int_t CopyFiles(const char *dset, const char *destdir)
Copy the files of dataset 'dset' to another directory Return 0 on success, -1 on error.
Definition: TProofBenchDataSet.cxx:84
TProofBench::fgFp3n
static TF1 * fgFp3n
Definition: TProofBench.h:82
TH1::SetMaximum
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:398
TProofBench.h
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
TFileCollection.h
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
TTimeStamp::AsString
const char * AsString(const Option_t *option="") const
Return the date & time as a string.
Definition: TTimeStamp.cxx:271
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
TPBHistType::kHist1D
@ kHist1D
Definition: TProofBenchTypes.h:61
TH1::SetDirectory
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
Definition: TH1.cxx:8703
TClass::GetClass
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.
Definition: TClass.cxx:2938
TSystem::HostName
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:304
TProofBenchRun::SetSelOption
virtual void SetSelOption(const char *opt)
Definition: TProofBenchRun.h:49
ey
Double_t ey[n]
Definition: legend1.C:17
TProof::Open
static TProof * Open(const char *url=0, const char *conffile=0, const char *confdir=0, Int_t loglevel=0)
Start a PROOF session on a specific cluster.
Definition: TProof.cxx:11573
funp2
Double_t funp2(Double_t *xx, Double_t *par)
Simple polynomial 2nd degree.
Definition: TProofBench.cxx:90
TPBReadType::kReadOpt
@ kReadOpt
Definition: TProofBenchTypes.h:38
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TH1::SetStats
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition: TH1.cxx:8756
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TUrl
This class represents a WWW compatible URL.
Definition: TUrl.h:33
TString::IsDigit
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Definition: TString.cxx:1763
TStyle::SetOptTitle
void SetOptTitle(Int_t tit=1)
Definition: TStyle.h:318
TFile
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TFileCollection::Add
Int_t Add(TFileInfo *info)
Add TFileInfo to the collection.
Definition: TFileCollection.cxx:73
TGraph::SetPoint
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition: TGraph.cxx:2274
TObject::kInvalidObject
@ kInvalidObject
if object ctor succeeded but object should not be used
Definition: TObject.h:68
TGraph::SetHistogram
virtual void SetHistogram(TH1F *h)
Definition: TGraph.h:176
gFioVn1
static Int_t gFioVn1
Definition: TProofBench.cxx:74
THashList.h
TUrl::GetFile
const char * GetFile() const
Definition: TUrl.h:69
TROOT::GetEtcDir
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
Definition: TROOT.cxx:2964
Printf
void Printf(const char *fmt,...)
TUrl::GetProtocol
const char * GetProtocol() const
Definition: TUrl.h:64
TProfile
Profile Histogram.
Definition: TProfile.h:32
TObject::IsZombie
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:134
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TKey
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
TProofBench::fDataGenSel
TString fDataGenSel
Definition: TProofBench.h:61
TProofBench::fgGraphs
static TList * fgGraphs
Definition: TProofBench.h:87
TGraphErrors::SetPointError
virtual void SetPointError(Double_t ex, Double_t ey)
Set ex and ey values for point pointed by the mouse.
Definition: TGraphErrors.cxx:792
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
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
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
kPROOF_BenchSelDataGenDef
const char *const kPROOF_BenchSelDataGenDef
Definition: TProofBenchTypes.h:31
TProofBenchRunDataRead.h
TProof::IsValid
Bool_t IsValid() const
Definition: TProof.h:937
TSystem::OpenDirectory
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:835
TGraphErrors
A TGraphErrors is a TGraph with error bars.
Definition: TGraphErrors.h:26
TF1.h
TCanvas
The Canvas class.
Definition: TCanvas.h:23
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:822
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TSortedList::Add
void Add(TObject *obj)
Add object in sorted list.
Definition: TSortedList.cxx:27
R_ISDIR
Bool_t R_ISDIR(Int_t mode)
Definition: TSystem.h:115
TProof::Process
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...
Definition: TProof.cxx:5293
TProofBench::fProofDS
TProof * fProofDS
Definition: TProofBench.h:45
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
TProofBench::fDS
TProofBenchDataSet * fDS
Definition: TProofBench.h:67
TCollection::SetName
void SetName(const char *name)
Definition: TCollection.h:204
TAttFill::SetFillColor
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
TSlaveInfo::GetName
const char * GetName() const
Returns name of object.
Definition: TProof.h:231
TObject::Write
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:795
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TSystem::GetDirEntry
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:852
TUrl::GetHost
const char * GetHost() const
Definition: TUrl.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
TFile::Close
void Close(Option_t *option="") override
Close a file.
Definition: TFile.cxx:876
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
TGraph::Fit
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Fit this graph with function with name fname.
Definition: TGraph.cxx:1064
TProofBench::fNtries
Int_t fNtries
Definition: TProofBench.h:48
TF1::Derivative
virtual Double_t Derivative(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the first derivative of the function at point x, computed by Richardson's extrapolation metho...
Definition: TF1.cxx:1118
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
TMap.h
leg
leg
Definition: legend1.C:34
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
TProofBenchRunDataRead::SetReleaseCache
void SetReleaseCache(Bool_t on=kTRUE)
Definition: TProofBenchRunDataRead.h:126
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
gPad
#define gPad
Definition: TVirtualPad.h:287
TIter
Definition: TCollection.h:233
TProof::Close
void Close(Option_t *option="")
Close all open slave servers.
Definition: TProof.cxx:1788
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
TDatime
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:37
TProofBenchDataSet.h
TProof::DeleteParameters
void DeleteParameters(const char *wildcard)
Delete the input list parameters specified by a wildcard (e.g.
Definition: TProof.cxx:9923
TLegend
This class displays a legend box (TPaveText) containing several legend entries.
Definition: TLegend.h:23
TAttMarker::SetMarkerStyle
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
TProofBench::fgFio
static TF1 * fgFio
Definition: TProofBench.h:84
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TProofBench::fDataSet
TString fDataSet
Definition: TProofBench.h:52
type
int type
Definition: TGX11.cxx:121
TGraphErrors.h
TTimeStamp
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:71
TAttAxis::SetTitleOffset
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
Definition: TAttAxis.cxx:293
TKey.h
TGeant4Unit::nm
static constexpr double nm
Definition: TGeant4SystemOfUnits.h:105
TF1
1-Dim function class
Definition: TF1.h:213
TPBReadType
Definition: TProofBenchTypes.h:33
TH1::GetXaxis
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:320
TProofBench::fReleaseCache
Bool_t fReleaseCache
Definition: TProofBench.h:55
TProofBench::fNHist
Int_t fNHist
Definition: TProofBench.h:50
TProofBenchDataSet::RemoveFiles
Int_t RemoveFiles(const char *dset)
Physically remove the dataset 'dset', i.e.
Definition: TProofBenchDataSet.cxx:63
TF1::GetParameter
virtual Double_t GetParameter(Int_t ipar) const
Definition: TF1.h:511
TProofBench::fOutFileName
TString fOutFileName
Definition: TProofBench.h:47
TProofBench::fDataPar
TString fDataPar
Definition: TProofBench.h:60
TCollection::GetName
virtual const char * GetName() const
Return name of this collection.
Definition: TCollection.cxx:351
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
TProofBenchRun::SetParList
virtual void SetParList(const char *pars)
Definition: TProofBenchRun.h:48
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
TProof::RegisterDataSet
virtual Bool_t RegisterDataSet(const char *name, TFileCollection *dataset, const char *optStr="")
Register the 'dataSet' on the cluster under the current user, group and the given 'dataSetName'.
Definition: TProof.cxx:10697
TProof::GetParameter
TObject * GetParameter(const char *par) const
Get specified parameter.
Definition: TProof.cxx:9908
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
TProof::GetParallel
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition: TProof.cxx:2294
TProfile::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return bin content of a Profile histogram.
Definition: TProfile.cxx:820
TUrl.h
TList
A doubly linked list.
Definition: TList.h:44
TMath.h
TH1::GetNbinsX
virtual Int_t GetNbinsX() const
Definition: TH1.h:296
gROOT
#define gROOT
Definition: TROOT.h:406
int
TF1::Print
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TF1.cxx:2885
TFileCollection
Class that contains a list of TFileInfo's and accumulated meta data information about its entries.
Definition: TFileCollection.h:39
TMap
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40