Logo ROOT  
Reference Guide
TProofBenchRunCPU.cxx
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Sangsu Ryu 22/06/2010
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 /** \class TProofBenchRunCPU
13 \ingroup proofbench
14 
15 CPU-intensive PROOF benchmark test generates events and fill 1, 2, or 3-D histograms.
16 No I/O activity is involved.
17 
18 */
19 
20 #include "RConfigure.h"
21 
22 #include "TProofBenchRunCPU.h"
23 #include "TProofNodes.h"
24 #include "TProofPerfAnalysis.h"
25 #include "TFileCollection.h"
26 #include "TFileInfo.h"
27 #include "TProof.h"
28 #include "TString.h"
29 #include "Riostream.h"
30 #include "TMap.h"
31 #include "TEnv.h"
32 #include "TTree.h"
33 #include "TLeaf.h"
34 #include "TCanvas.h"
35 #include "TROOT.h"
36 #include "TH2.h"
37 #include "TF1.h"
38 #include "TProfile.h"
39 #include "TLegend.h"
40 #include "TKey.h"
41 #include "TRegexp.h"
42 #include "TPerfStats.h"
43 #include "TQueryResult.h"
44 #include "TMath.h"
45 #include "TStyle.h"
46 #include "TGraphErrors.h"
47 
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Default constructor
52 
54  TDirectory* dirproofbench, TProof* proof,
55  TProofNodes* nodes, Long64_t nevents, Int_t ntries,
56  Int_t start, Int_t stop, Int_t step, Int_t draw,
57  Int_t debug)
59  fHistType(histtype), fNHists(nhists),
60  fNEvents(nevents), fNTries(ntries), fStart(start), fStop(stop),
61  fStep(step), fDraw(draw), fDebug(debug), fDirProofBench(dirproofbench),
62  fNodes(nodes), fListPerfPlots(0),
63  fCanvas(0), fProfile_perfstat_event(0), fHist_perfstat_event(0),
64  fProfile_perfstat_evtmax(0), fNorm_perfstat_evtmax(0),
65  fProfile_queryresult_event(0), fNorm_queryresult_event(0), fProfile_cpu_eff(0),
66  fProfLegend(0), fNormLegend(0), fName(0)
67 {
68  if (TestBit(kInvalidObject)) {
69  Error("TProofBenchRunCPU", "problems validating PROOF session or enabling selector PAR");
70  return;
71  }
72 
73  fName = "CPU";
74 
75  if (!fNodes) fNodes = new TProofNodes(fProof);
76 
77  if (stop == -1) fStop = fNodes->GetNWorkersCluster();
78 
79  fListPerfPlots = new TList;
80 
81  gEnv->SetValue("Proof.StatsTrace",1);
82  gStyle->SetOptStat(0);
83 }
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Destructor
87 
89 {
90  fProof=0;
97 }
98 
99 ////////////////////////////////////////////////////////////////////////////////
100 /// Build histograms, profiles and graphs needed for this run
101 
103 {
104  TObject *o = 0;
105  Int_t quotient = (stop - start) / step;
106  Int_t ndiv = quotient + 1;
107  Double_t ns_min = start - step/2.;
108  Double_t ns_max = quotient*step + start + step/2.;
109 
110  fProfLegend = new TLegend(0.1, 0.8, 0.3, 0.9);
111  fNormLegend = new TLegend(0.7, 0.8, 0.9, 0.9);
112 
113  TString axtitle("Active Workers"), namelab(GetName()), sellab(GetSelName());
114  if (nx) {
115  axtitle = "Active Workers/Node";
116  namelab.Form("x_%s", GetName());
117  }
119  sellab.Form("%s_%s", GetSelName(), GetNameStem().Data());
120 
121  TString name, title;
122 
123  // Book perfstat profile (max evts)
124  name.Form("Prof_%s_PS_MaxEvts_%s", namelab.Data(), sellab.Data());
125  title.Form("Profile %s PerfStat Event - %s", namelab.Data(), sellab.Data());
126  fProfile_perfstat_evtmax = new TProfile(name, title, ndiv, ns_min, ns_max);
128  fProfile_perfstat_evtmax->GetYaxis()->SetTitle("Events/sec");
130  fProfile_perfstat_evtmax->SetMarkerStyle(23);
131  fProfile_perfstat_evtmax->SetMarkerColor(2);
132  if ((o = fListPerfPlots->FindObject(name))) {
134  delete o;
135  }
138 
139  // Book perfstat profile
140  name.Form("Prof_%s_PS_Evts_%s", namelab.Data(), sellab.Data());
141  title.Form("Profile %s PerfStat Event - %s", namelab.Data(), sellab.Data());
142  fProfile_perfstat_event = new TProfile(name, title, ndiv, ns_min, ns_max);
144  fProfile_perfstat_event->GetYaxis()->SetTitle("Events/sec");
146  fProfile_perfstat_event->SetMarkerStyle(21);
147  if ((o = fListPerfPlots->FindObject(name))) {
149  delete o;
150  }
153 
154  // Book perfstat histogram
155  name.Form("Hist_%s_PS_Evts_%s", namelab.Data(), sellab.Data());
156  title.Form("Histogram %s PerfStat Event - %s", namelab.Data(), sellab.Data());
157  fHist_perfstat_event = new TH2D(name, title, ndiv, ns_min, ns_max, 100, 0, 0);
159  fHist_perfstat_event->GetYaxis()->SetTitle("Events/sec");
161  fHist_perfstat_event->SetMarkerStyle(7);
162  if ((o = fListPerfPlots->FindObject(name))) {
164  delete o;
165  }
167 
168  // Book normalized perfstat profile (max evts)
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());
171  fNorm_perfstat_evtmax = new TProfile(name, title, ndiv, ns_min, ns_max);
173  fNorm_perfstat_evtmax->GetYaxis()->SetTitle("Events/sec");
175  fNorm_perfstat_evtmax->SetMarkerStyle(23);
176  fNorm_perfstat_evtmax->SetMarkerColor(2);
177  if ((o = fListPerfPlots->FindObject(name))) {
179  delete o;
180  }
183 
184  // Book queryresult profile
185  name.Form("Prof_%s_QR_Evts_%s", namelab.Data(), sellab.Data());
186  title.Form("Profile %s QueryResult Event - %s", namelab.Data(), sellab.Data());
187  fProfile_queryresult_event = new TProfile(name, title, ndiv, ns_min, ns_max);
189  fProfile_queryresult_event->GetYaxis()->SetTitle("Events/sec");
191  fProfile_queryresult_event->SetMarkerStyle(22);
192  if ((o = fListPerfPlots->FindObject(name))) {
194  delete o;
195  }
197 
198  // Book normalized queryresult profile
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());
201  fNorm_queryresult_event = new TProfile(name, title, ndiv, ns_min, ns_max);
203  fNorm_queryresult_event->GetYaxis()->SetTitle("Events/sec");
205  fNorm_queryresult_event->SetMarkerStyle(22);
206  if ((o = fListPerfPlots->FindObject(name))) {
208  delete o;
209  }
212 
213  // Book CPU efficiency profile
214  name.Form("Prof_%s_CPU_eff_%s", namelab.Data(), sellab.Data());
215  title.Form("Profile %s CPU efficiency - %s", namelab.Data(), sellab.Data());
216  fProfile_cpu_eff = new TProfile(name, title, ndiv, ns_min, ns_max);
218  fProfile_cpu_eff->GetYaxis()->SetTitle("Efficiency");
219  fProfile_cpu_eff->GetXaxis()->SetTitle(axtitle);
220  fProfile_cpu_eff->SetMarkerStyle(22);
221  if ((o = fListPerfPlots->FindObject(name))) {
223  delete o;
224  }
226 }
227 
228 ////////////////////////////////////////////////////////////////////////////////
229 /// Run benchmark
230 /// Input parameters
231 /// nevents: Number of events to run per file. When it is -1, use data member fNEvents.
232 /// start: Start scan with 'start' workers. When it is -1, use data member fStart.
233 /// When 0, the same number of workers are activated on all nodes.
234 /// stop: Stop scan at 'stop' workers. When it is -1 , use data member fStop.
235 /// step: Scan every 'step' workers. When it is -1, use data member fStep.
236 /// ntries: Number of repetitions. When it is -1, use data member fNTries.
237 /// debug: debug switch. When it is -1, use data member fDebug.
238 /// draw: draw switch. When it is -1, use data member fDraw.
239 /// Returns
240 /// Nothing
241 
242 void TProofBenchRunCPU::Run(Long64_t nevents, Int_t start, Int_t stop,
243  Int_t step, Int_t ntries, Int_t debug, Int_t draw)
244 {
245  if (!fProof){
246  Error("Run", "Proof not set");
247  return;
248  }
249 
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;
257 
258  Bool_t nx = kFALSE;
259  if (step == -2){
260  nx = kTRUE;
261  start = fStart;
262  step = 1;
263  }
264 
265  if (nx){
266  Int_t minnworkersanode = fNodes->GetMinWrksPerNode();
267  if (stop > minnworkersanode) stop = minnworkersanode;
268  }
269 
270  // Load the selector, if needed
271  if (!TClass::GetClass(fSelName)) {
272  // Is it the default selector?
274  // Load the parfile
276  Info("Run", "Uploading '%s' ...", par.Data());
277  if (fProof->UploadPackage(par) != 0) {
278  Error("Run", "problems uploading '%s' - cannot continue", par.Data());
279  return;
280  }
281  Info("Run", "Enabling '%s' ...", kPROOF_BenchCPUSelPar);
283  Error("Run", "problems enabling '%s' - cannot continue", kPROOF_BenchCPUSelPar);
284  return;
285  }
286  } else {
287  if (fParList.IsNull()) {
288  Error("Run", "you should load the class '%s' before running the benchmark", fSelName.Data());
289  return;
290  } else {
291  TString par;
292  Int_t from = 0;
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());
297  return;
298  }
299  Info("Run", "Enabling '%s' ...", par.Data());
300  if (fProof->EnablePackage(par) != 0) {
301  Error("Run", "problems enabling '%s' - cannot continue", par.Data());
302  return;
303  }
304  }
305  }
306  }
307  // Check
308  if (!TClass::GetClass(fSelName)) {
309  Error("Run", "failed to load '%s'", fSelName.Data());
310  return;
311  }
312  }
313 
314  // Build histograms, profiles and graphs needed for this run
315  BuildHistos(start, stop, step, nx);
316 
317  // Get pad
318  if (!fCanvas) fCanvas = new TCanvas("Canvas");
319  // Cleanup up the canvas
320  fCanvas->Clear();
321 
322  // Divide the canvas as many as the number of profiles in the list
323  fCanvas->Divide(2,1);
324 
325  TString perfstats_name = "PROOF_PerfStats";
326 
327  SetParameters();
328 
329  if (nx){
330  Info("Run", "Running CPU-bound tests; %d ~ %d active worker(s)/node,"
331  " every %d worker(s)/node.", start, stop, step);
332  } else {
333  Info("Run", "Running CPU-bound tests; %d ~ %d active worker(s),"
334  " every %d worker(s).", start, stop, step);
335  }
336 
337  Int_t npad = 1; //pad number
338 
339  Int_t nnodes = fNodes->GetNNodes(); // Number of machines
340  Int_t ncores = fNodes->GetNCores(); // Number of cores
341 
342  Double_t ymi = -1., ymx = -1., emx = -1.;
343  for (Int_t nactive = start; nactive <= stop; nactive += step) {
344 
345  // For CPU effectiveness (ok for lite; should do it properly for standard clusters)
346  Int_t ncoren = (nactive < ncores) ? nactive : ncores;
347 
348  // Actvate the wanted workers
349  Int_t nw = -1;
350  if (nx) {
351  TString workers;
352  workers.Form("%dx", nactive);
353  nw = fNodes->ActivateWorkers(workers);
354  } else {
355  nw = fNodes->ActivateWorkers(nactive);
356  }
357  if (nw < 0){
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);
361  continue;
362  }
363 
364  for (Int_t j = 0; j < ntries; j++) {
365 
366  if (nx){
367  Info("Run", "Running CPU-bound tests with %d active worker(s)/node;"
368  " trial %d/%d", nactive, j + 1, ntries);
369  } else {
370  Info("Run", "Running CPU-bound tests with %d active worker(s);"
371  " trial %d/%d", nactive, j + 1, ntries);
372  }
373 
374  Int_t nevents_all=0;
375  if (nx){
376  nevents_all=nevents*nactive*nnodes;
377  } else {
378  nevents_all=nevents*nactive;
379  }
380 
381  // Process
382  fProof->Process(fSelName, nevents_all, fSelOption);
383 
384  TList *l = fProof->GetOutputList();
385 
386  // Save perfstats
387  TTree *t = 0;
388  if (l) t = dynamic_cast<TTree*>(l->FindObject(perfstats_name.Data()));
389  if (t) {
390 
391  //FillPerfStatPerfPlots(t, profile_perfstat_event, nactive);
392  FillPerfStatPerfPlots(t, nactive);
393 
394  TProofPerfAnalysis pfa(t);
395  Double_t pf_eventrate = pfa.GetEvtRateAvgMax();
396 // if (pf_eventrate > emx) emx = pf_eventrate;
397  fProfile_perfstat_evtmax->Fill(nactive, pf_eventrate);
398  fCanvas->cd(npad);
402  fProfLegend->Draw();
403  gPad->Update();
404  // The normalised histos
405  // Use the first bin to set the Y range for the histo
406  Double_t nert = nx ? pf_eventrate/nactive/nnodes : pf_eventrate/nactive;
407  fNorm_perfstat_evtmax->Fill(nactive, nert);
410  Double_t dy = 5 * e1;
411  if (dy / y1 < 0.2) dy = y1 * 0.2;
412  if (dy > y1) dy = y1*.999999;
413  if (ymi < 0.) ymi = y1 - dy;
414  if (fNorm_perfstat_evtmax->GetBinContent(nactive) < ymi)
415  ymi = fNorm_perfstat_evtmax->GetBinContent(nactive) / 2.;
416  if (ymx < 0.) ymx = y1 + dy;
417  if (fNorm_perfstat_evtmax->GetBinContent(nactive) > ymx)
418  ymx = fNorm_perfstat_evtmax->GetBinContent(nactive) * 1.5;
421  fCanvas->cd(npad + 1);
423  fNormLegend->Draw();
424  gPad->Update();
425 
426  // Build up new name
427  TString newname = TString::Format("%s_%s_%dwrks%dthtry", t->GetName(), GetName(), nactive, j);
428  t->SetName(newname);
429 
430  if (debug && fDirProofBench->IsWritable()){
431  TDirectory *curdir = gDirectory;
432  TString dirn = nx ? "RunCPUx" : "RunCPU";
433  if (!fDirProofBench->GetDirectory(dirn))
434  fDirProofBench->mkdir(dirn, "RunCPU results");
435  if (fDirProofBench->cd(dirn)) {
437  t->Write();
438  l->Remove(t);
439  } else {
440  Warning("Run", "cannot cd to subdirectory '%s' to store the results!", dirn.Data());
441  }
442  curdir->cd();
443  }
444 
445  } else {
446  if (l)
447  Warning("Run", "%s: tree not found", perfstats_name.Data());
448  else
449  Error("Run", "PROOF output list is empty!");
450  }
451 
452  // Performance measures from TQueryResult
453 
454  const char *drawopt = t ? "LSAME" : "L";
455  TQueryResult *queryresult = fProof->GetQueryResult();
456  if (queryresult) {
457  queryresult->Print("F");
458  TDatime qr_start = queryresult->GetStartTime();
459  TDatime qr_end = queryresult->GetEndTime();
460  Float_t qr_proc = queryresult->GetProcTime();
461 
462  Long64_t qr_entries = queryresult->GetEntries();
463 
464  // Calculate event rate
465  Double_t qr_eventrate = qr_entries / Double_t(qr_proc);
466  if (qr_eventrate > emx) emx = qr_eventrate;
467 
468  // Calculate and fill CPU efficiency
469  Float_t qr_cpu_eff = -1.;
470  if (qr_proc > 0.) {
471  qr_cpu_eff = queryresult->GetUsedCPU() / ncoren / qr_proc ;
472  fProfile_cpu_eff->Fill(nactive, qr_cpu_eff);
473  Printf("cpu_eff: %f", qr_cpu_eff);
474  }
475 
476  // Fill and draw
477  fProfile_queryresult_event->Fill(nactive, qr_eventrate);
478  fCanvas->cd(npad);
480  fProfLegend->Draw();
481  gPad->Update();
482  // The normalised histo
483  Double_t nert = nx ? qr_eventrate/nactive/nnodes : qr_eventrate/nactive;
484  fNorm_queryresult_event->Fill(nactive, nert);
485  // Use the first bin to set the Y range for the histo
488  Double_t dy = 5 * e1;
489  if (dy / y1 < 0.2) dy = y1 * 0.2;
490  if (dy > y1) dy = y1*.999999;
491  if (ymi < 0.) ymi = y1 - dy;
492  if (fNorm_queryresult_event->GetBinContent(nactive) < ymi)
493  ymi = fNorm_queryresult_event->GetBinContent(nactive) / 2.;
494  if (ymx < 0.) ymx = y1 + dy;
495  if (fNorm_queryresult_event->GetBinContent(nactive) > ymx)
496  ymx = fNorm_queryresult_event->GetBinContent(nactive) * 1.5;
498 // fNorm_queryresult_event->SetMinimum(ymi);
500  fCanvas->cd(npad+1);
501  fNorm_queryresult_event->Draw(drawopt);
502  fNormLegend->Draw();
503  } else {
504  Warning("Run", "TQueryResult not found!");
505  }
506  gPad->Update();
507 
508  } // for iterations
509  } // for number of workers
510 
511  // Make the result persistent
512  fCanvas->cd(npad);
516  fProfLegend->Draw();
517  fCanvas->cd(npad + 1);
520  fNormLegend->Draw();
521  gPad->Update();
522 
523  //save performance profiles to file
525  TDirectory *curdir = gDirectory;
526  TString dirn = nx ? "RunCPUx" : "RunCPU";
527  if (!fDirProofBench->GetDirectory(dirn))
528  fDirProofBench->mkdir(dirn, "RunCPU results");
529  if (fDirProofBench->cd(dirn)) {
533  } else {
534  Warning("Run", "cannot cd to subdirectory '%s' to store the results!", dirn.Data());
535  }
536  curdir->cd();
537  }
538 }
539 
540 ////////////////////////////////////////////////////////////////////////////////
541 
543 {
544  // Fill performance profiles using tree 't'(PROOF_PerfStats).
545  // Input parameters
546  // t: Proof output tree (PROOF_PerfStat) containing performance statistics.
547  // profile: Profile to be filled up with information from tree 't'.
548  // nactive: Number of active workers processed the query.
549  // Return
550  // Nothing
551 
552  // find perfstat profile
554  Error("FillPerfStatPerfPlots", "no perfstat profile found");
555  return;
556  }
557 
558  // find perfstat histogram
559  if (!fHist_perfstat_event){
560  Error("FillPerfStatPerfPlots", "no perfstat histogram found");
561  return;
562  }
563 
564  // extract timing information
565  TPerfEvent pe;
566  TPerfEvent* pep = &pe;
567  t->SetBranchAddress("PerfEvents",&pep);
568  Long64_t entries = t->GetEntries();
569 
570  Double_t event_rate_packet = 0;
571 
572  for (Long64_t k=0; k<entries; k++) {
573 
574  t->GetEntry(k);
575 
576  // Skip information from workers
577  if (pe.fEvtNode.Contains(".")) continue;
578 
580  if (pe.fProcTime != 0.0) {
581  event_rate_packet = pe.fEventsProcessed / pe.fProcTime;
582  fHist_perfstat_event->Fill(Double_t(nactive), event_rate_packet);
583  }
584  }
585  }
586 
587  return;
588 }
589 
590 ////////////////////////////////////////////////////////////////////////////////
591 /// Show settings
592 
594 {
595  Printf("+++ TProofBenchRunCPU +++++++++++++++++++++++++++++++++++++++++");
596  Printf("Name = %s", fName.Data());
597  if (fProof) fProof->Print(option);
598  Printf("fHistType = k%s", GetNameStem().Data());
599  Printf("fNHists = %d", fNHists);
600  Printf("fNEvents = %lld", fNEvents);
601  Printf("fNTries = %d", fNTries);
602  Printf("fStart = %d", fStart);
603  Printf("fStop = %d", fStop);
604  Printf("fStep = %d", fStep);
605  Printf("fDraw = %d", fDraw);
606  Printf("fDebug = %d", fDebug);
607  if (fDirProofBench)
608  Printf("fDirProofBench = %s", fDirProofBench->GetPath());
609  if (fNodes) fNodes->Print(option);
610  if (fListPerfPlots) fListPerfPlots->Print(option);
611  if (fCanvas)
612  Printf("Performance Canvas: Name = %s Title = %s",
614  Printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
615 }
616 
617 ////////////////////////////////////////////////////////////////////////////////
618 /// Draw Performance plots
619 
621 {
622  // Get canvas
623  if (!fCanvas) fCanvas = new TCanvas("Canvas");
624 
625  fCanvas->Clear();
626 
627  // Divide the canvas as many as the number of profiles in the list
628  Int_t nprofiles = fListPerfPlots->GetSize();
629  if (nprofiles <= 2){
630  fCanvas->Divide(1,nprofiles);
631  } else {
632  Int_t nside = (Int_t)TMath::Sqrt((Float_t)nprofiles);
633  nside = (nside*nside<nprofiles)?nside+1:nside;
634  fCanvas->Divide(nside,nside);
635  }
636 
637  Int_t npad=1;
638  TIter nxt(fListPerfPlots);
639  TProfile* profile=0;
640  while ((profile=(TProfile*)(nxt()))){
641  fCanvas->cd(npad++);
642  profile->Draw();
643  gPad->Update();
644  }
645  return;
646 }
647 
648 ////////////////////////////////////////////////////////////////////////////////
649 /// Set histogram type
650 
652 {
653  fHistType = histtype;
654  fName.Form("%sCPU", GetNameStem().Data());
655 }
656 
657 ////////////////////////////////////////////////////////////////////////////////
658 /// Get name for this run
659 
661 {
662  TString namestem("+++undef+++");
663  if (fHistType) {
664  switch (fHistType->GetType()) {
666  namestem = "Hist1D";
667  break;
669  namestem = "Hist2D";
670  break;
672  namestem = "Hist3D";
673  break;
675  namestem = "HistAll";
676  break;
677  default:
678  break;
679  }
680  }
681  return namestem;
682 }
683 
684 ////////////////////////////////////////////////////////////////////////////////
685 /// Set parameters
686 
688 {
689  if (!fProof) {
690  Error("SetParameters", "proof not set; Doing nothing");
691  return 1;
692  }
693 
696  fProof->SetParameter("PROOF_BenchmarkNHists", fNHists);
697  fProof->SetParameter("PROOF_BenchmarkDraw", Int_t(fDraw));
698  return 0;
699 }
700 
701 ////////////////////////////////////////////////////////////////////////////////
702 /// Delete parameters set for this run
703 
705 {
706  if (!fProof){
707  Error("DeleteParameters", "proof not set; Doing nothing");
708  return 1;
709  }
710  if (fProof->GetInputList()) {
711  TObject *type = fProof->GetInputList()->FindObject("PROOF_Benchmark_HistType");
712  if (type) fProof->GetInputList()->Remove(type);
713  }
714  fProof->DeleteParameters("PROOF_BenchmarkNHists");
715  fProof->DeleteParameters("PROOF_BenchmarkDraw");
716  return 0;
717 }
718 
TProofBenchRunCPU::fStep
Int_t fStep
Definition: TProofBenchRunCPU.h:53
TProofBenchRunCPU::GetName
const char * GetName() const
Returns name of object.
Definition: TProofBenchRunCPU.h:129
l
auto * l
Definition: textangle.C:4
TProofNodes::GetNNodes
Int_t GetNNodes() const
Definition: TProofNodes.h:49
TProofPerfAnalysis.h
TProofBenchRunCPU::fStop
Int_t fStop
Definition: TProofBenchRunCPU.h:52
TProofBenchRunCPU::fHist_perfstat_event
TH2 * fHist_perfstat_event
Definition: TProofBenchRunCPU.h:66
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TProofBenchRunCPU::fListPerfPlots
TList * fListPerfPlots
Definition: TProofBenchRunCPU.h:62
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TCollection::Print
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
Definition: TCollection.cxx:476
TDirectory::mkdir
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
Definition: TDirectory.cxx:1042
TProofBenchRunCPU::fNEvents
Long64_t fNEvents
Definition: TProofBenchRunCPU.h:48
TProofBenchRunCPU::fProfLegend
TLegend * fProfLegend
Definition: TProofBenchRunCPU.h:73
TProofNodes.h
TProofNodes
Definition: TProofNodes.h:28
TProfile::GetBinError
virtual Double_t GetBinError(Int_t bin) const
Return bin error of a Profile histogram.
Definition: TProfile.cxx:881
TPerfEvent::fProcTime
Double_t fProcTime
Definition: TPerfStats.h:54
TPerfEvent::fEventsProcessed
Long64_t fEventsProcessed
Definition: TPerfStats.h:50
TCollection::Write
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this collection.
Definition: TCollection.cxx:672
TH1::SetMinimum
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:396
gEnv
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
TPBHistType::kHist3D
@ kHist3D
Definition: TProofBenchTypes.h:63
TString::Data
const char * Data() const
Definition: TString.h:369
TProof::Print
virtual void Print(Option_t *option="") const
Print status of PROOF cluster.
Definition: TProof.cxx:4793
TProofBenchRunCPU::FillPerfStatPerfPlots
void FillPerfStatPerfPlots(TTree *t, Int_t nactive)
Definition: TProofBenchRunCPU.cxx:542
kPROOF_BenchCPUSelPar
const char *const kPROOF_BenchCPUSelPar
Definition: TProofBenchTypes.h:24
TH1::DrawCopy
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
Definition: TH1.cxx:3044
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TQueryResult::Print
void Print(Option_t *opt="") const
Print query content. Use opt = "F" for a full listing.
Definition: TQueryResult.cxx:315
TProofBenchRun::GetSelName
virtual const char * GetSelName()
Definition: TProofBenchRun.h:45
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
TProofNodes::GetNWorkersCluster
Int_t GetNWorkersCluster() const
Definition: TProofNodes.h:48
TPerfEvent
Definition: TPerfStats.h:39
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TLegend.h
TProofBenchRunCPU::fProfile_perfstat_evtmax
TProfile * fProfile_perfstat_evtmax
Definition: TProofBenchRunCPU.h:67
TTree
Definition: TTree.h:79
TMath::Sqrt
Double_t Sqrt(Double_t x)
Definition: TMath.h:691
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
TTree::SetBranchAddress
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:8205
TProofNodes::GetNCores
Int_t GetNCores() const
Definition: TProofNodes.h:50
kPROOF_BenchSelCPUDef
const char *const kPROOF_BenchSelCPUDef
Definition: TProofBenchTypes.h:29
Float_t
float Float_t
Definition: RtypesCore.h:57
TStyle.h
TProofBenchRunCPU::fProfile_perfstat_event
TProfile * fProfile_perfstat_event
Definition: TProofBenchRunCPU.h:65
Int_t
int Int_t
Definition: RtypesCore.h:45
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
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:543
TProofNodes::Print
void Print(Option_t *option="") const
Description: Print node information.
Definition: TProofNodes.cxx:271
TQueryResult.h
TPad::GetName
const char * GetName() const
Returns name of object.
Definition: TPad.h:254
TCanvas::Clear
void Clear(Option_t *option="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:723
TDirectory::cd
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Definition: TDirectory.cxx:498
TQueryResult
Definition: TQueryResult.h:41
TProof::EnablePackage
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
Definition: TProof.cxx:8165
TPad::Divide
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.
Definition: TPad.cxx:1166
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
TEnv.h
TProfile.h
TTree.h
TString
Definition: TString.h:136
TVirtualPerfStats::kPacket
@ kPacket
Definition: TVirtualPerfStats.h:38
TProofBenchRunCPU::SetParameters
Int_t SetParameters()
Set parameters.
Definition: TProofBenchRunCPU.cxx:687
TProof::UploadPackage
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition: TProof.cxx:8431
TString.h
TTree::GetEntry
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Definition: TTree.cxx:5537
bool
TTree::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: TTree.cxx:9563
TProofBenchRunCPU
Definition: TProofBenchRunCPU.h:41
TProof::GetOutputList
TList * GetOutputList()
Get list with all object created during processing (see Process()).
Definition: TProof.cxx:9798
TPerfEvent::fType
TVirtualPerfStats::EEventType fType
Definition: TPerfStats.h:44
TDirectory::IsWritable
virtual Bool_t IsWritable() const
Definition: TDirectory.h:181
TProofBenchRunCPU::fNTries
Int_t fNTries
Definition: TProofBenchRunCPU.h:49
TROOT.h
TObject::kOverwrite
@ kOverwrite
overwrite existing object with same name
Definition: TObject.h:88
kPROOF_BenchParDir
const char *const kPROOF_BenchParDir
Definition: TProofBenchTypes.h:26
TProofBenchRunCPU::DrawPerfPlots
void DrawPerfPlots()
Draw Performance plots.
Definition: TProofBenchRunCPU.cxx:620
TRegexp.h
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
TPBHistType::kHistAll
@ kHistAll
Definition: TProofBenchTypes.h:64
TQueryResult::GetStartTime
TDatime GetStartTime() const
Definition: TQueryResult.h:122
TPBHistType::GetType
EHistType GetType() const
Definition: TProofBenchTypes.h:73
TString::Tokenize
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2197
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TProofBenchRunCPU::fProfile_queryresult_event
TProfile * fProfile_queryresult_event
Definition: TProofBenchRunCPU.h:69
TLeaf.h
TQueryResult::GetEntries
Long64_t GetEntries() const
Definition: TQueryResult.h:127
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TProofPerfAnalysis
Definition: TProofPerfAnalysis.h:32
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:318
TFileInfo.h
TPBHistType
Definition: TProofBenchTypes.h:57
TPerfStats.h
TProofBenchRunCPU::~TProofBenchRunCPU
virtual ~TProofBenchRunCPU()
Destructor.
Definition: TProofBenchRunCPU.cxx:88
TProofBenchRunCPU::Print
void Print(Option_t *option="") const
Show settings.
Definition: TProofBenchRunCPU.cxx:593
TCanvas::cd
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:704
TProofBenchRun::fSelName
TString fSelName
Definition: TProofBenchRun.h:35
TProof::GetInputList
TList * GetInputList()
Get input list.
Definition: TProof.cxx:9743
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TProfile::Fill
Int_t Fill(const Double_t *v)
Definition: TProfile.h:54
TProof.h
TProofBenchRunCPU::SetHistType
void SetHistType(TPBHistType *histtype)
Set histogram type.
Definition: TProofBenchRunCPU.cxx:651
TProofBenchRunCPU.h
TH2D
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:292
TH1::SetMaximum
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:395
TLegend::AddEntry
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Definition: TLegend.cxx:330
TProof::GetQueryResult
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'.
Definition: TProof.cxx:2138
gDirectory
#define gDirectory
Definition: TDirectory.h:236
TProofBenchRunCPU::fDraw
Int_t fDraw
Definition: TProofBenchRunCPU.h:55
TFileCollection.h
TProofBenchRunCPU::fNodes
TProofNodes * fNodes
Definition: TProofBenchRunCPU.h:60
TProofBenchRunCPU::fCanvas
TCanvas * fCanvas
Definition: TProofBenchRunCPU.h:63
TQueryResult::GetEndTime
TDatime GetEndTime() const
Definition: TQueryResult.h:123
TDirectory::GetDirectory
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
Definition: TDirectory.cxx:401
TProofBenchRunCPU::fNHists
Int_t fNHists
Definition: TProofBenchRunCPU.h:46
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:8392
TProofBenchRun
Definition: TProofBenchRun.h:28
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:2925
TQueryResult::GetUsedCPU
Float_t GetUsedCPU() const
Definition: TQueryResult.h:130
TProofNodes::GetMinWrksPerNode
Int_t GetMinWrksPerNode() const
Definition: TProofNodes.h:51
TProofBenchRunCPU::fDirProofBench
TDirectory * fDirProofBench
Definition: TProofBenchRunCPU.h:58
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TTree::SetDirectory
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
Definition: TTree.cxx:8781
TH2.h
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TProofBenchRunCPU::fStart
Int_t fStart
Definition: TProofBenchRunCPU.h:51
TProofBenchRunCPU::fDebug
Int_t fDebug
Definition: TProofBenchRunCPU.h:56
TStyle::SetOptStat
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Definition: TStyle.cxx:1592
TDirectory::GetPath
virtual const char * GetPath() const
Returns the full path of the directory.
Definition: TDirectory.cxx:988
TObject::kInvalidObject
@ kInvalidObject
if object ctor succeeded but object should not be used
Definition: TObject.h:68
TH2::Fill
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH2.cxx:294
TProofBenchRunCPU::fNorm_perfstat_evtmax
TProfile * fNorm_perfstat_evtmax
Definition: TProofBenchRunCPU.h:68
TROOT::GetEtcDir
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
Definition: TROOT.cxx:2958
Printf
void Printf(const char *fmt,...)
TProfile
Definition: TProfile.h:32
TProofBenchRun::fProof
TProof * fProof
Definition: TProofBenchRun.h:34
TProofBenchRunCPU::fProfile_cpu_eff
TProfile * fProfile_cpu_eff
Definition: TProofBenchRunCPU.h:71
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TProofBenchRunCPU::fHistType
TPBHistType * fHistType
Definition: TProofBenchRunCPU.h:45
Double_t
double Double_t
Definition: RtypesCore.h:59
TProofBenchRunCPU::TProofBenchRunCPU
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.
Definition: TProofBenchRunCPU.cxx:53
TF1.h
TCanvas
Definition: TCanvas.h:23
TProofBenchRunCPU::BuildHistos
void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx)
Build histograms, profiles and graphs needed for this run.
Definition: TProofBenchRunCPU.cxx:102
TPerfEvent::fEvtNode
TString fEvtNode
Definition: TPerfStats.h:42
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
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
TProofNodes::ActivateWorkers
Int_t ActivateWorkers(Int_t nwrks)
Description: Activate 'nwrks' workers; calls TProof::SetParallel and rebuild the internal lists Input...
Definition: TProofNodes.cxx:150
TQueryResult::GetProcTime
Float_t GetProcTime() const
Definition: TQueryResult.h:140
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TObject
Definition: TObject.h:37
TMap.h
TList::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
TProofBenchRunCPU::GetNameStem
TString GetNameStem() const
Get name for this run.
Definition: TProofBenchRunCPU.cxx:660
name
char name[80]
Definition: TGX11.cxx:110
TTree::SetName
virtual void SetName(const char *name)
Change the name of this tree.
Definition: TTree.cxx:9020
TProofBenchRunCPU::fName
TString fName
Definition: TProofBenchRunCPU.h:76
TProofBenchRunCPU::DeleteParameters
Int_t DeleteParameters()
Delete parameters set for this run.
Definition: TProofBenchRunCPU.cxx:704
TDirectory
Definition: TDirectory.h:40
TProofBenchRun::fParList
TString fParList
Definition: TProofBenchRun.h:36
gPad
#define gPad
Definition: TVirtualPad.h:287
TIter
Definition: TCollection.h:233
TLegend::Draw
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
Definition: TLegend.cxx:423
TProof
Definition: TProof.h:316
TDatime
Definition: TDatime.h:37
TProofPerfAnalysis::GetEvtRateAvgMax
Double_t GetEvtRateAvgMax() const
Definition: TProofPerfAnalysis.h:104
TEnv::SetValue
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.
Definition: TEnv.cxx:736
TProof::DeleteParameters
void DeleteParameters(const char *wildcard)
Delete the input list parameters specified by a wildcard (e.g.
Definition: TProof.cxx:9923
TProofBenchRunCPU::fNorm_queryresult_event
TProfile * fNorm_queryresult_event
Definition: TProofBenchRunCPU.h:70
TLegend
Definition: TLegend.h:23
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
TProofBenchRun::fSelOption
TString fSelOption
Definition: TProofBenchRun.h:37
type
int type
Definition: TGX11.cxx:121
TGraphErrors.h
TKey.h
TPBHistType::kHist2D
@ kHist2D
Definition: TProofBenchTypes.h:62
TH1::GetXaxis
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:317
TProofBenchRunCPU::fNormLegend
TLegend * fNormLegend
Definition: TProofBenchRunCPU.h:74
Riostream.h
TTree::GetEntries
virtual Long64_t GetEntries() const
Definition: TTree.h:458
TPad::GetTitle
const char * GetTitle() const
Returns title of object.
Definition: TPad.h:255
TProfile::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return bin content of a Profile histogram.
Definition: TProfile.cxx:817
TList
Definition: TList.h:44
TMath.h
int
TH1::Draw
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2997