ROOT  6.06/09
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 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TProofBenchRunCPU //
15 // //
16 // CPU-intensive PROOF benchmark test generates events and fill 1, 2, //
17 // or 3-D histograms. No I/O activity is involved. //
18 // //
19 //////////////////////////////////////////////////////////////////////////
20 
21 #include "RConfigure.h"
22 
23 #include "TProofBenchRunCPU.h"
24 #include "TProofNodes.h"
25 #include "TProofPerfAnalysis.h"
26 #include "TFileCollection.h"
27 #include "TFileInfo.h"
28 #include "TProof.h"
29 #include "TString.h"
30 #include "Riostream.h"
31 #include "TMap.h"
32 #include "TEnv.h"
33 #include "TTree.h"
34 #include "TLeaf.h"
35 #include "TCanvas.h"
36 #include "TROOT.h"
37 #include "TH2.h"
38 #include "TF1.h"
39 #include "TProfile.h"
40 #include "TLegend.h"
41 #include "TKey.h"
42 #include "TRegexp.h"
43 #include "TPerfStats.h"
44 #include "TQueryResult.h"
45 #include "TMath.h"
46 #include "TStyle.h"
47 #include "TProofNodes.h"
48 #include "TGraphErrors.h"
49 #include "TLegend.h"
50 
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Default constructor
55 
57  TDirectory* dirproofbench, TProof* proof,
58  TProofNodes* nodes, Long64_t nevents, Int_t ntries,
59  Int_t start, Int_t stop, Int_t step, Int_t draw,
60  Int_t debug)
62  fHistType(histtype), fNHists(nhists),
63  fNEvents(nevents), fNTries(ntries), fStart(start), fStop(stop),
64  fStep(step), fDraw(draw), fDebug(debug), fDirProofBench(dirproofbench),
65  fNodes(nodes), fListPerfPlots(0),
66  fCanvas(0), fProfile_perfstat_event(0), fHist_perfstat_event(0),
67  fProfile_perfstat_evtmax(0), fNorm_perfstat_evtmax(0),
68  fProfile_queryresult_event(0), fNorm_queryresult_event(0), fProfile_cpu_eff(0),
69  fProfLegend(0), fNormLegend(0), fName(0)
70 {
71  if (TestBit(kInvalidObject)) {
72  Error("TProofBenchRunCPU", "problems validating PROOF session or enabling selector PAR");
73  return;
74  }
75 
76  fName = "CPU";
77 
78  if (!fNodes) fNodes = new TProofNodes(fProof);
79 
80  if (stop == -1) fStop = fNodes->GetNWorkersCluster();
81 
82  fListPerfPlots = new TList;
83 
84  gEnv->SetValue("Proof.StatsTrace",1);
85  gStyle->SetOptStat(0);
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// Destructor
90 
92 {
93  fProof=0;
100 }
101 
102 ////////////////////////////////////////////////////////////////////////////////
103 /// Build histograms, profiles and graphs needed for this run
104 
106 {
107  TObject *o = 0;
108  Int_t quotient = (stop - start) / step;
109  Int_t ndiv = quotient + 1;
110  Double_t ns_min = start - step/2.;
111  Double_t ns_max = quotient*step + start + step/2.;
112 
113  fProfLegend = new TLegend(0.1, 0.8, 0.3, 0.9);
114  fNormLegend = new TLegend(0.7, 0.8, 0.9, 0.9);
115 
116  TString axtitle("Active Workers"), namelab(GetName()), sellab(GetSelName());
117  if (nx) {
118  axtitle = "Active Workers/Node";
119  namelab.Form("x_%s", GetName());
120  }
122  sellab.Form("%s_%s", GetSelName(), GetNameStem().Data());
123 
124  TString name, title;
125 
126  // Book perfstat profile (max evts)
127  name.Form("Prof_%s_PS_MaxEvts_%s", namelab.Data(), sellab.Data());
128  title.Form("Profile %s PerfStat Event - %s", namelab.Data(), sellab.Data());
129  fProfile_perfstat_evtmax = new TProfile(name, title, ndiv, ns_min, ns_max);
131  fProfile_perfstat_evtmax->GetYaxis()->SetTitle("Events/sec");
135  if ((o = fListPerfPlots->FindObject(name))) {
137  delete o;
138  }
141 
142  // Book perfstat profile
143  name.Form("Prof_%s_PS_Evts_%s", namelab.Data(), sellab.Data());
144  title.Form("Profile %s PerfStat Event - %s", namelab.Data(), sellab.Data());
145  fProfile_perfstat_event = new TProfile(name, title, ndiv, ns_min, ns_max);
147  fProfile_perfstat_event->GetYaxis()->SetTitle("Events/sec");
150  if ((o = fListPerfPlots->FindObject(name))) {
152  delete o;
153  }
156 
157  // Book perfstat histogram
158  name.Form("Hist_%s_PS_Evts_%s", namelab.Data(), sellab.Data());
159  title.Form("Histogram %s PerfStat Event - %s", namelab.Data(), sellab.Data());
160  fHist_perfstat_event = new TH2D(name, title, ndiv, ns_min, ns_max, 100, 0, 0);
162  fHist_perfstat_event->GetYaxis()->SetTitle("Events/sec");
165  if ((o = fListPerfPlots->FindObject(name))) {
167  delete o;
168  }
170 
171  // Book normalized perfstat profile (max evts)
172  name.Form("Norm_%s_PS_MaxEvts_%s", namelab.Data(), sellab.Data());
173  title.Form("Profile %s Normalized PerfStat Event - %s", namelab.Data(), sellab.Data());
174  fNorm_perfstat_evtmax = new TProfile(name, title, ndiv, ns_min, ns_max);
176  fNorm_perfstat_evtmax->GetYaxis()->SetTitle("Events/sec");
180  if ((o = fListPerfPlots->FindObject(name))) {
182  delete o;
183  }
186 
187  // Book queryresult profile
188  name.Form("Prof_%s_QR_Evts_%s", namelab.Data(), sellab.Data());
189  title.Form("Profile %s QueryResult Event - %s", namelab.Data(), sellab.Data());
190  fProfile_queryresult_event = new TProfile(name, title, ndiv, ns_min, ns_max);
192  fProfile_queryresult_event->GetYaxis()->SetTitle("Events/sec");
195  if ((o = fListPerfPlots->FindObject(name))) {
197  delete o;
198  }
200 
201  // Book normalized queryresult profile
202  name.Form("Norm_%s_QR_Evts_%s", namelab.Data(), sellab.Data());
203  title.Form("Profile %s Normalized QueryResult Event - %s", namelab.Data(), sellab.Data());
204  fNorm_queryresult_event = new TProfile(name, title, ndiv, ns_min, ns_max);
206  fNorm_queryresult_event->GetYaxis()->SetTitle("Events/sec");
209  if ((o = fListPerfPlots->FindObject(name))) {
211  delete o;
212  }
215 
216  // Book CPU efficiency profile
217  name.Form("Prof_%s_CPU_eff_%s", namelab.Data(), sellab.Data());
218  title.Form("Profile %s CPU efficiency - %s", namelab.Data(), sellab.Data());
219  fProfile_cpu_eff = new TProfile(name, title, ndiv, ns_min, ns_max);
221  fProfile_cpu_eff->GetYaxis()->SetTitle("Efficiency");
222  fProfile_cpu_eff->GetXaxis()->SetTitle(axtitle);
224  if ((o = fListPerfPlots->FindObject(name))) {
226  delete o;
227  }
229 }
230 
231 ////////////////////////////////////////////////////////////////////////////////
232 /// Run benchmark
233 /// Input parameters
234 /// nevents: Number of events to run per file. When it is -1, use data member fNEvents.
235 /// start: Start scan with 'start' workers. When it is -1, use data member fStart.
236 /// When 0, the same number of workers are activated on all nodes.
237 /// stop: Stop scan at 'stop' workers. When it is -1 , use data member fStop.
238 /// step: Scan every 'step' workers. When it is -1, use data member fStep.
239 /// ntries: Number of repetitions. When it is -1, use data member fNTries.
240 /// debug: debug switch. When it is -1, use data member fDebug.
241 /// draw: draw switch. When it is -1, use data member fDraw.
242 /// Returns
243 /// Nothing
244 
245 void TProofBenchRunCPU::Run(Long64_t nevents, Int_t start, Int_t stop,
246  Int_t step, Int_t ntries, Int_t debug, Int_t draw)
247 {
248  if (!fProof){
249  Error("Run", "Proof not set");
250  return;
251  }
252 
253  nevents = (nevents == -1) ? fNEvents : nevents;
254  start = (start == -1) ? fStart : start;
255  stop = (stop == -1) ? fStop : stop;
256  step = (step == -1) ? fStep : step;
257  ntries = (ntries == -1) ? fNTries : ntries;
258  debug = (debug == -1) ? fDebug : debug;
259  draw = (draw == -1) ? fDraw : draw;
260 
261  Bool_t nx = kFALSE;
262  if (step == -2){
263  nx = kTRUE;
264  start = fStart;
265  step = 1;
266  }
267 
268  if (nx){
269  Int_t minnworkersanode = fNodes->GetMinWrksPerNode();
270  if (stop > minnworkersanode) stop = minnworkersanode;
271  }
272 
273  // Load the selector, if needed
274  if (!TClass::GetClass(fSelName)) {
275  // Is it the default selector?
277  // Load the parfile
278 #ifdef R__HAVE_CONFIG
279  TString par = TString::Format("%s/%s%s.par", ROOTETCDIR, kPROOF_BenchParDir, kPROOF_BenchCPUSelPar);
280 #else
281  TString par = TString::Format("$ROOTSYS/etc/%s%s.par", kPROOF_BenchParDir, kPROOF_BenchCPUSelPar);
282 #endif
283  Info("Run", "Uploading '%s' ...", par.Data());
284  if (fProof->UploadPackage(par) != 0) {
285  Error("Run", "problems uploading '%s' - cannot continue", par.Data());
286  return;
287  }
288  Info("Run", "Enabling '%s' ...", kPROOF_BenchCPUSelPar);
290  Error("Run", "problems enabling '%s' - cannot continue", kPROOF_BenchCPUSelPar);
291  return;
292  }
293  } else {
294  if (fParList.IsNull()) {
295  Error("Run", "you should load the class '%s' before running the benchmark", fSelName.Data());
296  return;
297  } else {
298  TString par;
299  Int_t from = 0;
300  while (fParList.Tokenize(par, from, ",")) {
301  Info("Run", "Uploading '%s' ...", par.Data());
302  if (fProof->UploadPackage(par) != 0) {
303  Error("Run", "problems uploading '%s' - cannot continue", par.Data());
304  return;
305  }
306  Info("Run", "Enabling '%s' ...", par.Data());
307  if (fProof->EnablePackage(par) != 0) {
308  Error("Run", "problems enabling '%s' - cannot continue", par.Data());
309  return;
310  }
311  }
312  }
313  }
314  // Check
315  if (!TClass::GetClass(fSelName)) {
316  Error("Run", "failed to load '%s'", fSelName.Data());
317  return;
318  }
319  }
320 
321  // Build histograms, profiles and graphs needed for this run
322  BuildHistos(start, stop, step, nx);
323 
324  // Get pad
325  if (!fCanvas) fCanvas = new TCanvas("Canvas");
326  // Cleanup up the canvas
327  fCanvas->Clear();
328 
329  // Divide the canvas as many as the number of profiles in the list
330  fCanvas->Divide(2,1);
331 
332  TString perfstats_name = "PROOF_PerfStats";
333 
334  SetParameters();
335 
336  if (nx){
337  Info("Run", "Running CPU-bound tests; %d ~ %d active worker(s)/node,"
338  " every %d worker(s)/node.", start, stop, step);
339  } else {
340  Info("Run", "Running CPU-bound tests; %d ~ %d active worker(s),"
341  " every %d worker(s).", start, stop, step);
342  }
343 
344  Int_t npad = 1; //pad number
345 
346  Int_t nnodes = fNodes->GetNNodes(); // Number of machines
347  Int_t ncores = fNodes->GetNCores(); // Number of cores
348 
349  Double_t ymi = -1., ymx = -1., emx = -1.;
350  for (Int_t nactive = start; nactive <= stop; nactive += step) {
351 
352  // For CPU effectiveness (ok for lite; should do it properly for standard clusters)
353  Int_t ncoren = (nactive < ncores) ? nactive : ncores;
354 
355  // Actvate the wanted workers
356  Int_t nw = -1;
357  if (nx) {
358  TString workers;
359  workers.Form("%dx", nactive);
360  nw = fNodes->ActivateWorkers(workers);
361  } else {
362  nw = fNodes->ActivateWorkers(nactive);
363  }
364  if (nw < 0){
365  Error("Run", "could not activate the requested number of"
366  " workers/node on the cluster; skipping the test point"
367  " (%d workers/node)", nactive);
368  continue;
369  }
370 
371  for (Int_t j = 0; j < ntries; j++) {
372 
373  if (nx){
374  Info("Run", "Running CPU-bound tests with %d active worker(s)/node;"
375  " trial %d/%d", nactive, j + 1, ntries);
376  } else {
377  Info("Run", "Running CPU-bound tests with %d active worker(s);"
378  " trial %d/%d", nactive, j + 1, ntries);
379  }
380 
381  Int_t nevents_all=0;
382  if (nx){
383  nevents_all=nevents*nactive*nnodes;
384  } else {
385  nevents_all=nevents*nactive;
386  }
387 
388  // Process
389  fProof->Process(fSelName, nevents_all, fSelOption);
390 
391  TList *l = fProof->GetOutputList();
392 
393  // Save perfstats
394  TTree *t = 0;
395  if (l) t = dynamic_cast<TTree*>(l->FindObject(perfstats_name.Data()));
396  if (t) {
397 
398  //FillPerfStatPerfPlots(t, profile_perfstat_event, nactive);
399  FillPerfStatPerfPlots(t, nactive);
400 
401  TProofPerfAnalysis pfa(t);
402  Double_t pf_eventrate = pfa.GetEvtRateAvgMax();
403 // if (pf_eventrate > emx) emx = pf_eventrate;
404  fProfile_perfstat_evtmax->Fill(nactive, pf_eventrate);
405  fCanvas->cd(npad);
409  fProfLegend->Draw();
410  gPad->Update();
411  // The normalised histos
412  // Use the first bin to set the Y range for the histo
413  Double_t nert = nx ? pf_eventrate/nactive/nnodes : pf_eventrate/nactive;
414  fNorm_perfstat_evtmax->Fill(nactive, nert);
417  Double_t dy = 5 * e1;
418  if (dy / y1 < 0.2) dy = y1 * 0.2;
419  if (dy > y1) dy = y1*.999999;
420  if (ymi < 0.) ymi = y1 - dy;
421  if (fNorm_perfstat_evtmax->GetBinContent(nactive) < ymi)
422  ymi = fNorm_perfstat_evtmax->GetBinContent(nactive) / 2.;
423  if (ymx < 0.) ymx = y1 + dy;
424  if (fNorm_perfstat_evtmax->GetBinContent(nactive) > ymx)
425  ymx = fNorm_perfstat_evtmax->GetBinContent(nactive) * 1.5;
428  fCanvas->cd(npad + 1);
430  fNormLegend->Draw();
431  gPad->Update();
432 
433  // Build up new name
434  TString newname = TString::Format("%s_%s_%dwrks%dthtry", t->GetName(), GetName(), nactive, j);
435  t->SetName(newname);
436 
437  if (debug && fDirProofBench->IsWritable()){
438  TDirectory *curdir = gDirectory;
439  TString dirn = nx ? "RunCPUx" : "RunCPU";
440  if (!fDirProofBench->GetDirectory(dirn))
441  fDirProofBench->mkdir(dirn, "RunCPU results");
442  if (fDirProofBench->cd(dirn)) {
444  t->Write();
445  l->Remove(t);
446  } else {
447  Warning("Run", "cannot cd to subdirectory '%s' to store the results!", dirn.Data());
448  }
449  curdir->cd();
450  }
451 
452  } else {
453  if (l)
454  Warning("Run", "%s: tree not found", perfstats_name.Data());
455  else
456  Error("Run", "PROOF output list is empty!");
457  }
458 
459  // Performance measures from TQueryResult
460 
461  const char *drawopt = t ? "LSAME" : "L";
462  TQueryResult *queryresult = fProof->GetQueryResult();
463  if (queryresult) {
464  queryresult->Print("F");
465  TDatime qr_start = queryresult->GetStartTime();
466  TDatime qr_end = queryresult->GetEndTime();
467  Float_t qr_proc = queryresult->GetProcTime();
468 
469  Long64_t qr_entries = queryresult->GetEntries();
470 
471  // Calculate event rate
472  Double_t qr_eventrate = qr_entries / Double_t(qr_proc);
473  if (qr_eventrate > emx) emx = qr_eventrate;
474 
475  // Calculate and fill CPU efficiency
476  Float_t qr_cpu_eff = -1.;
477  if (qr_proc > 0.) {
478  qr_cpu_eff = queryresult->GetUsedCPU() / ncoren / qr_proc ;
479  fProfile_cpu_eff->Fill(nactive, qr_cpu_eff);
480  Printf("cpu_eff: %f", qr_cpu_eff);
481  }
482 
483  // Fill and draw
484  fProfile_queryresult_event->Fill(nactive, qr_eventrate);
485  fCanvas->cd(npad);
487  fProfLegend->Draw();
488  gPad->Update();
489  // The normalised histo
490  Double_t nert = nx ? qr_eventrate/nactive/nnodes : qr_eventrate/nactive;
491  fNorm_queryresult_event->Fill(nactive, nert);
492  // Use the first bin to set the Y range for the histo
495  Double_t dy = 5 * e1;
496  if (dy / y1 < 0.2) dy = y1 * 0.2;
497  if (dy > y1) dy = y1*.999999;
498  if (ymi < 0.) ymi = y1 - dy;
499  if (fNorm_queryresult_event->GetBinContent(nactive) < ymi)
500  ymi = fNorm_queryresult_event->GetBinContent(nactive) / 2.;
501  if (ymx < 0.) ymx = y1 + dy;
502  if (fNorm_queryresult_event->GetBinContent(nactive) > ymx)
503  ymx = fNorm_queryresult_event->GetBinContent(nactive) * 1.5;
505 // fNorm_queryresult_event->SetMinimum(ymi);
507  fCanvas->cd(npad+1);
508  fNorm_queryresult_event->Draw(drawopt);
509  fNormLegend->Draw();
510  } else {
511  Warning("Run", "TQueryResult not found!");
512  }
513  gPad->Update();
514 
515  } // for iterations
516  } // for number of workers
517 
518  // Make the result persistent
519  fCanvas->cd(npad);
523  fProfLegend->Draw();
524  fCanvas->cd(npad + 1);
527  fNormLegend->Draw();
528  gPad->Update();
529 
530  //save performance profiles to file
532  TDirectory *curdir = gDirectory;
533  TString dirn = nx ? "RunCPUx" : "RunCPU";
534  if (!fDirProofBench->GetDirectory(dirn))
535  fDirProofBench->mkdir(dirn, "RunCPU results");
536  if (fDirProofBench->cd(dirn)) {
540  } else {
541  Warning("Run", "cannot cd to subdirectory '%s' to store the results!", dirn.Data());
542  }
543  curdir->cd();
544  }
545 }
546 
547 ////////////////////////////////////////////////////////////////////////////////
548 
550 {
551  // Fill performance profiles using tree 't'(PROOF_PerfStats).
552  // Input parameters
553  // t: Proof output tree (PROOF_PerfStat) containing performance statistics.
554  // profile: Profile to be filled up with information from tree 't'.
555  // nactive: Number of active workers processed the query.
556  // Return
557  // Nothing
558 
559  // find perfstat profile
561  Error("FillPerfStatPerfPlots", "no perfstat profile found");
562  return;
563  }
564 
565  // find perfstat histogram
566  if (!fHist_perfstat_event){
567  Error("FillPerfStatPerfPlots", "no perfstat histogram found");
568  return;
569  }
570 
571  // extract timing information
572  TPerfEvent pe;
573  TPerfEvent* pep = &pe;
574  t->SetBranchAddress("PerfEvents",&pep);
575  Long64_t entries = t->GetEntries();
576 
577  Double_t event_rate_packet = 0;
578 
579  for (Long64_t k=0; k<entries; k++) {
580 
581  t->GetEntry(k);
582 
583  // Skip information from workers
584  if (pe.fEvtNode.Contains(".")) continue;
585 
587  if (pe.fProcTime != 0.0) {
588  event_rate_packet = pe.fEventsProcessed / pe.fProcTime;
589  fHist_perfstat_event->Fill(Double_t(nactive), event_rate_packet);
590  }
591  }
592  }
593 
594  return;
595 }
596 
597 ////////////////////////////////////////////////////////////////////////////////
598 /// Show settings
599 
601 {
602  Printf("+++ TProofBenchRunCPU +++++++++++++++++++++++++++++++++++++++++");
603  Printf("Name = %s", fName.Data());
604  if (fProof) fProof->Print(option);
605  Printf("fHistType = k%s", GetNameStem().Data());
606  Printf("fNHists = %d", fNHists);
607  Printf("fNEvents = %lld", fNEvents);
608  Printf("fNTries = %d", fNTries);
609  Printf("fStart = %d", fStart);
610  Printf("fStop = %d", fStop);
611  Printf("fStep = %d", fStep);
612  Printf("fDraw = %d", fDraw);
613  Printf("fDebug = %d", fDebug);
614  if (fDirProofBench)
615  Printf("fDirProofBench = %s", fDirProofBench->GetPath());
616  if (fNodes) fNodes->Print(option);
617  if (fListPerfPlots) fListPerfPlots->Print(option);
618  if (fCanvas)
619  Printf("Performance Canvas: Name = %s Title = %s",
621  Printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
622 }
623 
624 ////////////////////////////////////////////////////////////////////////////////
625 /// Draw Performance plots
626 
628 {
629  // Get canvas
630  if (!fCanvas) fCanvas = new TCanvas("Canvas");
631 
632  fCanvas->Clear();
633 
634  // Divide the canvas as many as the number of profiles in the list
635  Int_t nprofiles = fListPerfPlots->GetSize();
636  if (nprofiles <= 2){
637  fCanvas->Divide(1,nprofiles);
638  } else {
639  Int_t nside = (Int_t)TMath::Sqrt((Float_t)nprofiles);
640  nside = (nside*nside<nprofiles)?nside+1:nside;
641  fCanvas->Divide(nside,nside);
642  }
643 
644  Int_t npad=1;
645  TIter nxt(fListPerfPlots);
646  TProfile* profile=0;
647  while ((profile=(TProfile*)(nxt()))){
648  fCanvas->cd(npad++);
649  profile->Draw();
650  gPad->Update();
651  }
652  return;
653 }
654 
655 ////////////////////////////////////////////////////////////////////////////////
656 /// Set histogram type
657 
659 {
660  fHistType = histtype;
661  fName.Form("%sCPU", GetNameStem().Data());
662 }
663 
664 ////////////////////////////////////////////////////////////////////////////////
665 /// Get name for this run
666 
668 {
669  TString namestem("+++undef+++");
670  if (fHistType) {
671  switch (fHistType->GetType()) {
673  namestem = "Hist1D";
674  break;
676  namestem = "Hist2D";
677  break;
679  namestem = "Hist3D";
680  break;
682  namestem = "HistAll";
683  break;
684  default:
685  break;
686  }
687  }
688  return namestem;
689 }
690 
691 ////////////////////////////////////////////////////////////////////////////////
692 /// Set parameters
693 
695 {
696  if (!fProof) {
697  Error("SetParameters", "proof not set; Doing nothing");
698  return 1;
699  }
700 
703  fProof->SetParameter("PROOF_BenchmarkNHists", fNHists);
704  fProof->SetParameter("PROOF_BenchmarkDraw", Int_t(fDraw));
705  return 0;
706 }
707 
708 ////////////////////////////////////////////////////////////////////////////////
709 /// Delete parameters set for this run
710 
712 {
713  if (!fProof){
714  Error("DeleteParameters", "proof not set; Doing nothing");
715  return 1;
716  }
717  if (fProof->GetInputList()) {
718  TObject *type = fProof->GetInputList()->FindObject("PROOF_Benchmark_HistType");
719  if (type) fProof->GetInputList()->Remove(type);
720  }
721  fProof->DeleteParameters("PROOF_BenchmarkNHists");
722  fProof->DeleteParameters("PROOF_BenchmarkDraw");
723  return 0;
724 }
725 
const int nx
Definition: kalman.C:16
double par[1]
Definition: unuranDistr.cxx:38
TVirtualPerfStats::EEventType fType
Definition: TPerfStats.h:54
const char *const kPROOF_BenchCPUSelPar
THist< 2, double > TH2D
Definition: THist.h:320
long long Long64_t
Definition: RtypesCore.h:69
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:394
This class displays a legend box (TPaveText) containing several legend entries.
Definition: TLegend.h:35
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
Definition: TProof.cxx:8632
TString GetNameStem() const
Get name for this run.
float Float_t
Definition: RtypesCore.h:53
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:8266
const char Option_t
Definition: RtypesCore.h:62
virtual void Print(Option_t *option="") const
Print status of PROOF cluster.
Definition: TProof.cxx:4793
R__EXTERN TStyle * gStyle
Definition: TStyle.h:423
#define gDirectory
Definition: TDirectory.h:218
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
Definition: TLegend.cxx:373
void SetParameter(const char *par, const char *value)
Set input list parameter.
Definition: TProof.cxx:10389
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:659
TList * GetOutputList()
Get list with all object created during processing (see Process()).
Definition: TProof.cxx:10375
Int_t GetMinWrksPerNode() const
Definition: TProofNodes.h:53
TProfile * fProfile_perfstat_event
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:395
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:5163
Basic string class.
Definition: TString.h:137
ClassImp(TProofBenchRunCPU) TProofBenchRunCPU
Default constructor.
int Int_t
Definition: RtypesCore.h:41
virtual TDirectory * mkdir(const char *name, const char *title="")
Create a sub-directory and return a pointer to the created directory.
Definition: TDirectory.cxx:955
bool Bool_t
Definition: RtypesCore.h:59
const char *const kPROOF_BenchParDir
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:496
Profile Historam.
Definition: TProfile.h:34
virtual const char * GetPath() const
Returns the full path of the directory.
Definition: TDirectory.cxx:909
Int_t SetParameters()
Set parameters.
void FillPerfStatPerfPlots(TTree *t, Int_t nactive)
void Run(Long64_t nevents, Int_t start, Int_t stop, Int_t step, Int_t ntries, Int_t debug, Int_t draw)
Run benchmark Input parameters nevents: Number of events to run per file.
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=0)
Set the value of a resource or create a new resource.
Definition: TEnv.cxx:749
TProfile * fProfile_queryresult_event
const char * Data() const
Definition: TString.h:349
#define SafeDelete(p)
Definition: RConfig.h:436
void Print(Option_t *option="") const
Description: Print node information.
void Print(Option_t *opt="") const
Print query content. Use opt = "F" for a full listing.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2334
TProfile * fProfile_perfstat_evtmax
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:7529
virtual const char * GetSelName()
virtual void SetMarkerColor(Color_t mcolor=1)
Definition: TAttMarker.h:51
TString fEvtNode
Definition: TPerfStats.h:52
void Clear(Option_t *option="")
Remove all primitives from the canvas.
Definition: TCanvas.cxx:678
void SetHistType(TPBHistType *histtype)
Set histogram type.
std::vector< std::vector< double > > Data
Double_t GetEvtRateAvgMax() const
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'...
Definition: TProof.cxx:2143
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
Definition: TH1.cxx:2925
A container class for query results.
Definition: TQueryResult.h:44
Long64_t GetEntries() const
Definition: TQueryResult.h:130
void Error(const char *location, const char *msgfmt,...)
const char * GetName() const
Returns name of object.
Definition: TPad.h:255
A doubly linked list.
Definition: TList.h:47
Int_t GetNNodes() const
Definition: TProofNodes.h:51
TDirectory * fDirProofBench
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
Definition: TProof.cxx:8898
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:8811
EHistType GetType() const
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Definition: TH1.cxx:2878
Float_t GetUsedCPU() const
Definition: TQueryResult.h:133
TProofNodes * fNodes
Long64_t fEventsProcessed
Definition: TPerfStats.h:60
Double_t fProcTime
Definition: TPerfStats.h:64
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:674
Int_t GetNCores() const
Definition: TProofNodes.h:52
TString fSelOption
void DrawPerfPlots()
Draw Performance plots.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2321
Int_t Fill(const Double_t *v)
Definition: TProfile.h:56
TLine * l
Definition: textangle.C:4
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual void SetMarkerStyle(Style_t mstyle=1)
Definition: TAttMarker.h:53
TAxis * GetYaxis()
Definition: TH1.h:320
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
Bool_t IsNull() const
Definition: TString.h:387
void AddInput(TObject *obj)
Add objects that might be needed during the processing of the selector (see Process()).
Definition: TProof.cxx:10301
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2240
#define Printf
Definition: TGeoToOCC.h:18
virtual Double_t GetBinError(Int_t bin) const
Return bin error of a Profile histogram.
Definition: TProfile.cxx:860
TDatime GetStartTime() const
Definition: TQueryResult.h:125
virtual ~TProofBenchRunCPU()
Destructor.
void Print(Option_t *option="") const
Show settings.
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
const char * GetTitle() const
Returns title of object.
Definition: TPad.h:256
virtual Double_t GetBinContent(Int_t bin) const
Return bin content of a Profile histogram.
Definition: TProfile.cxx:795
TPBHistType * fHistType
The Canvas class.
Definition: TCanvas.h:48
TList * GetInputList()
Get input list.
Definition: TProof.cxx:10320
virtual Int_t GetSize() const
Definition: TCollection.h:95
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
Definition: TTree.cxx:8095
void DeleteParameters(const char *wildcard)
Delete the input list parameters specified by a wildcard (e.g.
Definition: TProof.cxx:10500
double Double_t
Definition: RtypesCore.h:55
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Definition: TLegend.cxx:280
TProfile * fNorm_queryresult_event
Int_t ActivateWorkers(Int_t nwrks)
Description: Activate 'nwrks' workers; calls TProof::SetParallel and rebuild the internal lists Input...
TProfile * fNorm_perfstat_evtmax
Describe directory structure in memory.
Definition: TDirectory.h:41
int type
Definition: TGX11.cxx:120
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
Definition: TProof.h:339
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:2881
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:348
Int_t DeleteParameters()
Delete parameters set for this run.
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
const char Int_t const char TProof * proof
Definition: TXSlave.cxx:46
const char *const kPROOF_BenchSelCPUDef
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
Definition: TDirectory.cxx:433
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:1077
virtual void Add(TObject *obj)
Definition: TList.h:81
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
virtual Bool_t IsWritable() const
Definition: TDirectory.h:168
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
Definition: TDirectory.cxx:336
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:1252
#define gPad
Definition: TVirtualPad.h:288
TProfile * fProfile_cpu_eff
bool debug
virtual Long64_t GetEntries() const
Definition: TTree.h:382
A TTree object has a header with a name and a title.
Definition: TTree.h:94
Double_t Sqrt(Double_t x)
Definition: TMath.h:464
void BuildHistos(Int_t start, Int_t stop, Int_t step, Bool_t nx)
Build histograms, profiles and graphs needed for this run.
const Bool_t kTRUE
Definition: Rtypes.h:91
Float_t GetProcTime() const
Definition: TQueryResult.h:143
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH2.cxx:285
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this collection.
TAxis * GetXaxis()
Definition: TH1.h:319
TDatime GetEndTime() const
Definition: TQueryResult.h:126
virtual void SetName(const char *name)
Change the name of this tree.
Definition: TTree.cxx:8300
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:39
const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904