Logo ROOT  
Reference Guide
TProofProgressDialog.cxx
Go to the documentation of this file.
1// @(#)root/sessionviewer:$Id$
2// Author: Fons Rademakers 21/03/03
3
4/*************************************************************************
5 * Copyright (C) 1995-2003, 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// TProofProgressDialog //
15// //
16// This class provides a query progress bar. //
17// //
18//////////////////////////////////////////////////////////////////////////
19
21#include "TProofProgressLog.h"
23#include "TEnv.h"
24#include "TError.h"
25#include "TGLabel.h"
26#include "TGButton.h"
27#include "TGTextBuffer.h"
28#include "TGTextEntry.h"
29#include "TGProgressBar.h"
30#include "TGSpeedo.h"
31#include "TProof.h"
32#include "TSlave.h"
33#include "TSystem.h"
34#include "TTimer.h"
35#include "TGraph.h"
36#include "TNtuple.h"
37#include "TCanvas.h"
38#include "TColor.h"
39#include "TLine.h"
40#include "TAxis.h"
41#include "TPaveText.h"
42#include "TMath.h"
43#include "TH1F.h"
44#include "THLimitsFinder.h"
45#include "TVirtualX.h"
46
47
48#ifdef PPD_SRV_NEWER
49#undef PPD_SRV_NEWER
50#endif
51#define PPD_SRV_NEWER(v) (fProof && fProof->GetRemoteProtocol() > v)
52
56
57//static const Int_t gSVNMemPlot = 25090;
58
60
61////////////////////////////////////////////////////////////////////////////////
62/// Create PROOF processing progress dialog.
63
65 Int_t files, Long64_t first,
66 Long64_t entries) : fDialog(0),
67 fBar(0), fClose(0), fStop(0), fAbort(0), fAsyn(0), fLog(0), fRatePlot(0),
68 fMemPlot(0), fKeepToggle(0), fLogQueryToggle(0), fTextQuery(0), fEntry(0),
69 fTitleLab(0), fFilesEvents(0), fTimeLab(0), fProcessed(0), fEstim(0),
70 fTotal(0), fRate(0), fInit(0), fSelector(0), fSpeedo(0), fSmoothSpeedo(0)
71{
72 fProof = proof;
73 fFiles = files;
74 fFirst = first;
75 fEntries = entries;
77 fPrevTotal = 0;
78 fLogWindow = 0;
79 fMemWindow = 0;
83 fRatePoints = 0;
84 fRateGraph = 0;
85 fMBRtGraph = 0;
86 fActWGraph = 0;
87 fTotSGraph = 0;
88 fEffSGraph = 0;
89 fProcTime = 0.;
90 fInitTime = 0.;
91 fAvgRate = 0.;
92 fAvgMBRate = 0.;
93 fRightInfo = 0;
95 fSpeedo = 0;
96 fUpdtSpeedo = 0;
97 fSmoothSpeedo = 0;
98
99 // Make sure we are attached to a good instance
100 if (!proof || !(proof->IsValid())) {
101 Error("TProofProgressDialog", "proof instance is invalid (%p, %s): protocol error?",
102 proof, (proof && !(proof->IsValid())) ? "invalid" : "undef");
103 return;
104 }
105
106 // Have to save this information here, in case gProof is dead when
107 // the logs are requested
108 fSessionUrl = (proof && proof->GetManager()) ? proof->GetManager()->GetUrl() : "";
109
110 if (PPD_SRV_NEWER(25)) {
111 fRatePoints = new TNtuple("RateNtuple","Rate progress info","tm:evr:mbr:act:tos:efs");
112 } else if (PPD_SRV_NEWER(11)) {
113 fRatePoints = new TNtuple("RateNtuple","Rate progress info","tm:evr:mbr");
114 }
115
116 fDialog = new TGTransientFrame(0, 0, 10, 10);
117 fDialog->Connect("CloseWindow()", "TProofProgressDialog", this, "DoClose()");
120
121//=======================================================================================
122
123 TGHorizontalFrame *hf4 = new TGHorizontalFrame(fDialog, 100, 100);
124
125 TGVerticalFrame *vf4 = new TGVerticalFrame(hf4, 100, 100);
126
127 // Title label
128 TString buf;
129 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
130 fProof ? fProof->GetMaster() : "<dummy>",
131 fProof ? fProof->GetParallel() : 0);
132 fTitleLab = new TGLabel(vf4, buf);
134 vf4->AddFrame(fTitleLab, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
135 buf.Form("Selector: %s", selector);
136 fSelector = new TGLabel(vf4, buf);
138 vf4->AddFrame(fSelector, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
139 buf.Form("%d files, number of events %lld, starting event %lld",
141 fFilesEvents = new TGLabel(vf4, buf);
144
145 // Progress bar
147 fBar->SetBarColor("green");
151 kLHintsExpandX, 10, 10, 5, 5));
152
153 // Status labels
154 if (PPD_SRV_NEWER(11)) {
155 TGHorizontalFrame *hf0 = new TGHorizontalFrame(vf4, 0, 0);
156 TGCompositeFrame *cf0 = new TGCompositeFrame(hf0, 110, 0, kFixedWidth);
157 cf0->AddFrame(new TGLabel(cf0, "Initialization time:"));
158 hf0->AddFrame(cf0);
159 fInit = new TGLabel(hf0, "- secs");
161 hf0->AddFrame(fInit, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
162 vf4->AddFrame(hf0, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
163 }
164
165 TGHorizontalFrame *hf1 = new TGHorizontalFrame(vf4, 0, 0);
166 TGCompositeFrame *cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth);
167 fTimeLab = new TGLabel(cf1, "Estimated time left:");
170 hf1->AddFrame(cf1);
171 fEstim = new TGLabel(hf1, "- sec");
173 hf1->AddFrame(fEstim, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
174 vf4->AddFrame(hf1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
175
176 hf1 = new TGHorizontalFrame(vf4, 0, 0);
177 cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth);
178 fProcessed = new TGLabel(cf1, "Processing status:");
181 hf1->AddFrame(cf1);
182 fTotal= new TGLabel(hf1, "- / - events");
184 hf1->AddFrame(fTotal, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
185
186 vf4->AddFrame(hf1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
187
188 TGHorizontalFrame *hf2 = new TGHorizontalFrame(vf4, 0, 0);
189 TGCompositeFrame *cf2 = new TGCompositeFrame(hf2, 110, 0, kFixedWidth);
190 cf2->AddFrame(new TGLabel(cf2, "Processing rate:"));
191 hf2->AddFrame(cf2);
192 fRate = new TGLabel(hf2, "- events/sec \n");
194 hf2->AddFrame(fRate, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
195 vf4->AddFrame(hf2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
196
197 // Keep toggle button
198 fKeepToggle = new TGCheckButton(vf4,
199 new TGHotString("Close dialog when processing is complete"));
201 fKeepToggle->Connect("Toggled(Bool_t)",
202 "TProofProgressDialog", this, "DoKeep(Bool_t)");
203 vf4->AddFrame(fKeepToggle, new TGLayoutHints(kLHintsBottom, 10, 10, 10, 5));
204
206
207 TGVerticalFrame *vf51 = new TGVerticalFrame(hf4, 20, 20);
208
209 Int_t enablespeedo = gEnv->GetValue("Proof.EnableSpeedo", 0);
210 if (enablespeedo) fSpeedoEnabled = kTRUE;
211
212 fSpeedo = new TGSpeedo(vf51, 0.0, 1.0, "", " Ev/s");
213 if (fSpeedoEnabled) {
214 fSpeedo->Connect("OdoClicked()", "TProofProgressDialog", this, "ToggleOdometerInfos()");
215 fSpeedo->Connect("LedClicked()", "TProofProgressDialog", this, "ToggleThreshold()");
216 }
217 vf51->AddFrame(fSpeedo);
218 fSpeedo->SetDisplayText("Init Time", "[ms]");
220 fSpeedo->SetThresholds(0.0, 25.0, 50.0);
224
225 fSmoothSpeedo = new TGCheckButton(vf51, new TGHotString("Smooth speedometer update"));
226 if (fSpeedoEnabled) {
228 fSmoothSpeedo->SetToolTipText("Control smoothness in refreshing the speedo");
229 } else {
230 fSmoothSpeedo->SetToolTipText("Speedo refreshing is disabled");
232 }
234
235 hf4->AddFrame(vf51, new TGLayoutHints(kLHintsBottom, 5, 5, 5, 5));
236
237 fDialog->AddFrame(hf4, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
238
239//==========================================================================================
240
241 // Stop, cancel and close buttons
242 TGHorizontalFrame *hf3 = new TGHorizontalFrame(fDialog, 60, 20);
243
244 UInt_t nb1 = 0, width1 = 0, height1 = 0;
245
246 fAsyn = new TGTextButton(hf3, "&Run in background");
247 if (fProof->GetRemoteProtocol() >= 22 && fProof->IsSync()) {
248 fAsyn->SetToolTipText("Continue running in the background (asynchronous mode), releasing the ROOT prompt");
249 } else {
250 fAsyn->SetToolTipText("Switch to asynchronous mode disabled: functionality not supported by the server");
252 }
253 fAsyn->Connect("Clicked()", "TProofProgressDialog", this, "DoAsyn()");
254 hf3->AddFrame(fAsyn, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
255 height1 = TMath::Max(height1, fAsyn->GetDefaultHeight());
256 width1 = TMath::Max(width1, fAsyn->GetDefaultWidth()); ++nb1;
257
258 fStop = new TGTextButton(hf3, "&Stop");
259 fStop->SetToolTipText("Stop processing, Terminate() will be executed");
260 fStop->Connect("Clicked()", "TProofProgressDialog", this, "DoStop()");
261 hf3->AddFrame(fStop, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
262 height1 = TMath::Max(height1, fStop->GetDefaultHeight());
263 width1 = TMath::Max(width1, fStop->GetDefaultWidth()); ++nb1;
264
265 fAbort = new TGTextButton(hf3, "&Cancel");
266 fAbort->SetToolTipText("Cancel processing, Terminate() will NOT be executed");
267 fAbort->Connect("Clicked()", "TProofProgressDialog", this, "DoAbort()");
269 height1 = TMath::Max(height1, fAbort->GetDefaultHeight());
270 width1 = TMath::Max(width1, fAbort->GetDefaultWidth()); ++nb1;
271
272 fClose = new TGTextButton(hf3, "&Close");
273 fClose->SetToolTipText("Close this dialog");
275 fClose->Connect("Clicked()", "TProofProgressDialog", this, "DoClose()");
277 height1 = TMath::Max(height1, fClose->GetDefaultHeight());
278 width1 = TMath::Max(width1, fClose->GetDefaultWidth()); ++nb1;
279
281
282 TGHorizontalFrame *hf5 = new TGHorizontalFrame(fDialog, 60, 20);
283
284 fLog = new TGTextButton(hf5, "&Show Logs");
285 fLog->SetToolTipText("Show query log messages");
286 fLog->Connect("Clicked()", "TProofProgressDialog", this, "DoLog()");
287 hf5->AddFrame(fLog, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
288
289 if (PPD_SRV_NEWER(11)) {
290 fRatePlot = new TGTextButton(hf5, "&Performance plot");
291 fRatePlot->SetToolTipText("Show rates, chunck sizes, cluster activities ... vs time");
293 fRatePlot->Connect("Clicked()", "TProofProgressDialog", this, "DoPlotRateGraph()");
295 }
296
297 fMemPlot = new TGTextButton(hf5, "&Memory Plot");
298 fMemPlot->Connect("Clicked()", "TProofProgressDialog", this, "DoMemoryPlot()");
299 fMemPlot->SetToolTipText("Show memory consumption vs entry / merging phase");
301
302 fUpdtSpeedo = new TGTextButton(hf5, "&Enable speedometer");
303 fUpdtSpeedo->Connect("Clicked()", "TProofProgressDialog", this, "DoEnableSpeedo()");
304 if (fSpeedoEnabled) {
305 fUpdtSpeedo->ChangeText("&Disable speedometer");
306 fUpdtSpeedo->SetToolTipText("Disable speedometer");
307 } else {
308 fUpdtSpeedo->ChangeText("&Enable speedometer");
309 fUpdtSpeedo->SetToolTipText("Enable speedometer (may have an impact on performance)");
310 }
312
314
315 // Only enable if master supports it
316 if (!PPD_SRV_NEWER(18)) {
318 TString tip = TString::Format("Not supported by the master: required protocol 19 > %d",
319 (fProof ? fProof->GetRemoteProtocol() : -1));
321 } else {
322 fMemPlot->SetToolTipText("Show memory consumption");
323 }
324
325 // Connect slot to proof progress signal
326 if (fProof) {
327 fProof->Connect("Progress(Long64_t,Long64_t)", "TProofProgressDialog",
328 this, "Progress(Long64_t,Long64_t)");
329 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
330 "TProofProgressDialog", this,
331 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
332 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
333 "TProofProgressDialog", this,
334 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
335 fProof->Connect("StopProcess(Bool_t)", "TProofProgressDialog", this,
336 "IndicateStop(Bool_t)");
337 fProof->Connect("ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
338 "TProofProgressDialog", this,
339 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
340 fProof->Connect("CloseProgressDialog()", "TProofProgressDialog", this, "DoClose()");
341 fProof->Connect("DisableGoAsyn()", "TProofProgressDialog", this, "DisableAsyn()");
342 }
343
344 // Set dialog title
345 if (fProof) {
346 if (strlen(fProof->GetUser()) > 0)
347 fDialog->SetWindowName(Form("PROOF Query Progress: %s@%s",
349 else
350 fDialog->SetWindowName(Form("PROOF Query Progress: %s", fProof->GetMaster()));
351 } else
352 fDialog->SetWindowName("PROOF Query Progress: <dummy>");
353
354 // Map all widgets and calculate size of dialog
356
358
359 const TGWindow *main = gClient->GetRoot();
360 // Position relative to the parent window (which is the root window)
361 Window_t wdum;
362 int ax, ay;
363 Int_t mw = ((TGFrame *) main)->GetWidth();
364 Int_t mh = ((TGFrame *) main)->GetHeight();
366 Int_t height = fDialog->GetDefaultHeight();
367
368 gVirtualX->TranslateCoordinates(main->GetId(), main->GetId(),
369 (mw - width), (mh - height) >> 1, ax, ay, wdum);
370
371 // Make the message box non-resizable
372 fDialog->SetWMSize(width, height);
373 fDialog->SetWMSizeHints(width, height, width, height, 0, 0);
374
380
381 fDialog->Move(ax-10, ay - mh/4);
382 fDialog->SetWMPosition(ax-10, ay - mh/4);
383 // Popup dialog and wait till user replies
385
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// Toggle information displayed in Analog Meter
391
393{
394 if (fRightInfo < 1)
395 fRightInfo++;
396 else
397 fRightInfo = 0;
398 if (fRightInfo == 0) {
399 fSpeedo->SetDisplayText("Init Time", "[ms]");
400 fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
401 }
402 else if (fRightInfo == 1) {
403 fSpeedo->SetDisplayText("Proc Time", "[ms]");
404 fSpeedo->SetOdoValue((Int_t)(fProcTime * 1000.0));
405 }
406}
407
408////////////////////////////////////////////////////////////////////////////////
409
411{
412 if (fSpeedo->IsThresholdActive()) {
415 }
416 else
418}
419
420////////////////////////////////////////////////////////////////////////////////
421/// Reset dialog box preparing for new query
422
424 Int_t files, Long64_t first,
425 Long64_t entries)
426{
427 TString buf;
428
429 // Update title
430 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
431 fProof ? fProof->GetMaster() : "<dummy>",
432 fProof ? fProof->GetParallel() : 0);
433 fTitleLab->SetText(buf);
434
435 // Reset members
436 fFiles = files;
437 fFirst = first;
438 fEntries = entries;
439 fPrevProcessed = 0;
440 fPrevTotal = 0;
442
443 // Update selector name
444 buf.Form("Selector: %s", selec);
445 fSelector->SetText(buf);
446
447 // Reset 'estim' and 'processed' text
448 fTimeLab->SetText("Estimated time left:");
449 fProcessed->SetText("Processing status:");
450
451 // Update numbers
452 buf.Form("%d files, number of events %lld, starting event %lld",
454 fFilesEvents->SetText(buf);
455
456 // Reset progress bar
457 fBar->SetBarColor("green");
458 fBar->Reset();
459
460 // Reset speedo
461 fSpeedo->SetMinMaxScale(0.0, 1.0);
462 fSpeedo->SetMeanValue(0.0);
464
465 // Reset buttons
469 if (fProof && fProof->IsSync() && fProof->GetRemoteProtocol() >= 22) {
471 } else {
473 }
474
475 // Reconnect the slots
476 if (fProof) {
477 fProof->Connect("Progress(Long64_t,Long64_t)", "TProofProgressDialog",
478 this, "Progress(Long64_t,Long64_t)");
479 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
480 "TProofProgressDialog", this,
481 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
482 fProof->Connect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
483 "TProofProgressDialog", this,
484 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
485 fProof->Connect("StopProcess(Bool_t)", "TProofProgressDialog", this,
486 "IndicateStop(Bool_t)");
487 fProof->Connect("DisableGoAsyn()", "TProofProgressDialog", this, "DisableAsyn()");
488 }
489
490 // Reset start time
492
493 // Clear the list of performances points
494 if (PPD_SRV_NEWER(11))
501 fAvgRate = 0.;
502 fAvgMBRate = 0.;
503}
504
505////////////////////////////////////////////////////////////////////////////////
506/// Update progress bar and status labels.
507/// Use "processed == total" or "processed < 0" to indicate end of processing.
508
510{
511 Long_t tt;
512 UInt_t hh=0, mm=0, ss=0;
513 TString buf;
514 TString stm;
515 static const char *cproc[] = { "running", "done",
516 "STOPPED", "ABORTED", "***EVENTS SKIPPED***"};
517
518 // Update title
519 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
520 fProof ? fProof->GetMaster() : "<dummy>",
521 fProof ? fProof->GetParallel() : 0);
522 fTitleLab->SetText(buf);
523
524 if (total < 0)
526 else
528
529 // Nothing to update
530 if (fPrevProcessed == processed)
531 return;
532
533 // Number of processed events
534 Long64_t evproc = (processed >= 0) ? processed : fPrevProcessed;
535
536 if (fEntries != total) {
537 fEntries = total;
538 buf.Form("%d files, number of events %lld, starting event %lld",
540 fFilesEvents->SetText(buf);
541 }
542
543 // Update position
544 Float_t pos = Float_t(Double_t(evproc * 100)/Double_t(total));
545 fBar->SetPosition(pos);
546
547 // get current time
548 fEndTime = gSystem->Now();
549 TTime tdiff = fEndTime - fStartTime;
550 Float_t eta = 0;
551 if (evproc > 0)
552 eta = ((Float_t)((Long64_t)tdiff)*total/Float_t(evproc) - Long64_t(tdiff))/1000.;
553
554 if (processed >= 0 && processed >= total) {
555 tt = (Long_t)Long64_t(tdiff)/1000;
556 if (tt > 0) {
557 hh = (UInt_t)(tt / 3600);
558 mm = (UInt_t)((tt % 3600) / 60);
559 ss = (UInt_t)((tt % 3600) % 60);
560 }
561 if (hh)
562 stm.Form("%d h %d min %d sec", hh, mm, ss);
563 else if (mm)
564 stm.Form("%d min %d sec", mm, ss);
565 else
566 stm.Form("%d sec", ss);
567 fProcessed->SetText("Processed:");
568 buf.Form("%lld events in %s\n", total, stm.Data());
569 fTotal->SetText(buf);
570
571 fEstim->SetText("0 sec");
572
573 if (fProof) {
574 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
575 "Progress(Long64_t,Long64_t)");
576 fProof->Disconnect("StopProcess(Bool_t)", this,
577 "IndicateStop(Bool_t)");
578 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
579 }
580
581 // Set button state
586 if (!fKeep) DoClose();
587
588 // Set the status to done
589 fStatus = kDone;
590
591 } else {
592 // A negative value for process indicates that we are finished,
593 // no matter whether the processing was complete
594 Bool_t incomplete = (processed < 0 &&
596 ? kTRUE : kFALSE;
597 if (incomplete) {
599 // We use a different color to highlight incompletion
600 fBar->SetBarColor("magenta");
601 }
602 tt = (Long_t)eta;
603 if (tt > 0) {
604 hh = (UInt_t)(tt / 3600);
605 mm = (UInt_t)((tt % 3600) / 60);
606 ss = (UInt_t)((tt % 3600) % 60);
607 }
608 if (hh)
609 stm.Form("%d h %d min %d sec", hh, mm, ss);
610 else if (mm)
611 stm.Form("%d min %d sec", mm, ss);
612 else
613 stm.Form("%d sec", ss);
614
615 fEstim->SetText(stm.Data());
616 buf.Form("%lld / %lld events", evproc, total);
617 if (fStatus > kDone) {
618 buf += TString::Format(" - %s", cproc[fStatus]);
619 }
620 fTotal->SetText(buf);
621
622 buf.Form("%.1f events/sec\n", Float_t(evproc)/Long64_t(tdiff)*1000.);
623 fRate->SetText(buf);
624
625 if (processed < 0) {
626 // And we disable the buttons
631
632 // Set the status to done
633 fStatus = kDone;
634 }
635 }
636 fPrevProcessed = evproc;
637}
638
639////////////////////////////////////////////////////////////////////////////////
640/// Update progress bar and status labels.
641/// Use "processed == total" or "processed < 0" to indicate end of processing.
642
644 Long64_t bytesread,
645 Float_t initTime, Float_t procTime,
646 Float_t evtrti, Float_t mbrti,
647 Int_t actw, Int_t tses, Float_t eses)
648{
649 Double_t BinLow, BinHigh;
650 Int_t nbins;
651 Long_t tt;
652 UInt_t hh=0, mm=0, ss=0;
653 TString buf;
654 TString stm;
655 static const char *cproc[] = { "running", "done",
656 "STOPPED", "ABORTED", "***EVENTS SKIPPED***"};
657
658 // Update title
659 buf.Form("Executing on PROOF cluster \"%s\" with %d parallel workers:",
660 fProof ? fProof->GetMaster() : "<dummy>",
661 fProof ? fProof->GetParallel() : 0);
662 fTitleLab->SetText(buf);
663
664 if (gDebug > 1)
665 Info("Progress","t: %lld, p: %lld, itm: %f, ptm: %f", total, processed, initTime, procTime);
666
667 if (initTime >= 0.) {
668 // Set init time
669 fInitTime = initTime;
670 buf.Form("%.1f secs", initTime);
671 fInit->SetText(buf);
672 if (fSpeedoEnabled && fRightInfo == 0)
673 fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
674 }
675
676 Bool_t over = kFALSE;
677 if (total < 0) {
679 over = kTRUE;
680 } else {
682 }
683
684 // Show proc time by default when switching from init to proc
685 if (processed > 0 && fPrevProcessed <= 0)
686 while (fRightInfo != 1)
688
689 // Nothing to update
690 if (fPrevProcessed == processed)
691 return;
692
693 // Number of processed events
694 Long64_t evproc = (processed >= 0) ? processed : fPrevProcessed;
695 Float_t mbsproc = bytesread / TMath::Power(2.,20.);
696
697 if (fEntries != total) {
698 fEntries = total;
699 buf.Form("%d files, number of events %lld, starting event %lld",
701 fFilesEvents->SetText(buf);
702 }
703
704 // Update position
705 Float_t pos = Float_t(Double_t(evproc * 100)/Double_t(total));
706 fBar->SetPosition(pos);
707
708 Float_t eta = 0;
709 if (evproc > 0 && procTime > 0.)
710 eta = (Float_t) (total - evproc) / (Double_t)evproc * procTime;
711
712 // Update average rates
713 if (procTime > 0.) {
714 fProcTime = procTime;
715 fAvgRate = Float_t(evproc) / procTime;
716 fAvgMBRate = mbsproc / procTime;
717 }
718
719 if (fSpeedoEnabled) {
720 if (fRightInfo == 0)
721 fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
722 else if (fRightInfo == 1)
723 fSpeedo->SetOdoValue((Int_t)(fProcTime * 1000.0));
724 }
725
726 if (over || (processed >= 0 && processed >= total)) {
727
728 // A negative value for process indicates that we are finished,
729 // no matter whether the processing was complete
730 Bool_t incomplete = (processed < 0 &&
732 ? kTRUE : kFALSE;
733 TString st = "";
734 if (incomplete) {
736 // We use a different color to highlight incompletion
737 fBar->SetBarColor("magenta");
738 st = TString::Format(" %s", cproc[fStatus]);
739 }
740
742 if (tt > 0) {
743 hh = (UInt_t)(tt / 3600);
744 mm = (UInt_t)((tt % 3600) / 60);
745 ss = (UInt_t)((tt % 3600) % 60);
746 }
747 if (hh)
748 stm.Form("%d h %d min %d sec", hh, mm, ss);
749 else if (mm)
750 stm.Form("%d min %d sec", mm, ss);
751 else
752 stm.Form("%d sec", ss);
753 fProcessed->SetText("Processed:");
754 TString sf("MB");
756 xb = AdjustBytes(xb, sf);
757 buf.Form("%lld events (%.2f %s)\n",
758 std::max(fPrevProcessed, processed), xb, sf.Data());
759 fTotal->SetText(buf);
760 buf.Form("%s %s\n", stm.Data(), st.Data());
761 fTimeLab->SetText("Processing time:");
762 fEstim->SetText(buf);
763 buf.Form("%.1f evts/sec (%.1f MB/sec)\n", fAvgRate, fAvgMBRate);
764 fRate->SetText(buf);
765 // Fill rate graph
766 Bool_t useAvg = gEnv->GetValue("Proof.RatePlotUseAvg", 0);
767 if (useAvg) {
768 if (fAvgRate > 0.) {
769 fRatePoints->Fill(procTime, fAvgRate, fAvgMBRate);
771 }
772 } else {
773 if (evtrti > 0.) {
774 fRatePoints->Fill(procTime, evtrti, mbrti, (Float_t)actw, (Float_t)tses, eses);
776 }
777 }
778
779 if (fProof) {
780 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
781 "Progress(Long64_t,Long64_t)");
782 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
783 this,
784 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
785 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
786 this,
787 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
788 fProof->Disconnect("StopProcess(Bool_t)", this, "IndicateStop(Bool_t)");
789 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
790 }
791
792 // Set button state
797
799 fSpeedo->SetScaleValue(0.0, 0);
800 else
803
804 if (!fKeep) DoClose();
805
806 // Set the status to done
807 fStatus = kDone;
808
809 } else {
810 // A negative value for process indicates that we are finished,
811 // no matter whether the processing was complete
812 Bool_t incomplete = (processed < 0 &&
814 ? kTRUE : kFALSE;
815 if (incomplete) {
817 // We use a different color to highlight incompletion
818 fBar->SetBarColor("magenta");
819 }
820 tt = (Long_t)eta;
821 if (tt > 0) {
822 hh = (UInt_t)(tt / 3600);
823 mm = (UInt_t)((tt % 3600) / 60);
824 ss = (UInt_t)((tt % 3600) % 60);
825 }
826 if (hh)
827 stm.Form("%d h %d min %d sec", hh, mm, ss);
828 else if (mm)
829 stm.Form("%d min %d sec", mm, ss);
830 else
831 stm.Form("%d sec", ss);
832
833 fEstim->SetText(stm.Data());
834 TString sf("MB");
835 Float_t xb = AdjustBytes(mbsproc, sf);
836 buf.Form("%lld / %lld events - %.2f %s", evproc, total, xb, sf.Data());
837 if (fStatus > kDone) {
838 buf += TString::Format(" - %s", cproc[fStatus]);
839 }
840 fTotal->SetText(buf);
841
842 // Post
843 if (evtrti > 0.) {
844 buf.Form("%.1f evts/sec \navg: %.1f evts/sec (%.1f MB/sec)",
845 evtrti, fAvgRate, fAvgMBRate);
846 fRatePoints->Fill(procTime, evtrti, mbrti, (Float_t)actw, (Float_t)tses, eses);
848 if (fSpeedoEnabled) {
849 if (evtrti > fSpeedo->GetScaleMax()) {
850 nbins = 4;
851 BinLow = fSpeedo->GetScaleMin();
852 BinHigh = 1.5 * evtrti;
853 THLimitsFinder::OptimizeLimits(4, nbins, BinLow, BinHigh, kFALSE);
855 }
857 fSpeedo->SetScaleValue(evtrti, 0);
858 else
859 fSpeedo->SetScaleValue(evtrti);
861 }
862 } else {
863 buf.Form("avg: %.1f evts/sec (%.1f MB/sec)", fAvgRate, fAvgMBRate);
864 }
865 fRate->SetText(buf);
866
867 if (processed < 0) {
868 // And we disable the buttons
873
874 if (fSpeedoEnabled) {
876 fSpeedo->SetScaleValue(0.0, 0);
877 else
880 }
881
882 // Set the status to done
883 fStatus = kDone;
884 }
885 }
886 fPrevProcessed = evproc;
887}
888
889////////////////////////////////////////////////////////////////////////////////
890/// Transform MBs to GBs ot TBs and get the correct suffix
891
893{
894 Float_t xb = mbs;
895 sf = "MB";
896 if (xb > 1024.) {
897 xb = xb / 1024.;
898 sf = "GB";
899 }
900 if (xb > 1024.) {
901 xb = xb / 1024.;
902 sf = "TB";
903 }
904 // Done
905 return xb;
906}
907
908////////////////////////////////////////////////////////////////////////////////
909/// Cleanup dialog.
910
912{
913 if (fProof) {
914 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
915 "Progress(Long64_t,Long64_t)");
916 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
917 this,
918 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
919 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
920 this,
921 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
922 fProof->Disconnect("StopProcess(Bool_t)", this, "IndicateStop(Bool_t)");
923 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
924 fProof->Disconnect("ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
925 this,
926 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
927 fProof->Disconnect("CloseProgressDialog()", this, "CloseProgressDialog()");
929 // We are called after a TProofDetach: we delete the instance
930 if (!fProof->IsValid())
932 }
933 if (fLogWindow)
934 delete fLogWindow;
935 if (fMemWindow)
936 delete fMemWindow;
937 fDialog->Cleanup();
938 delete fDialog;
939}
940
941////////////////////////////////////////////////////////////////////////////////
942/// Called when dialog is closed.
943
945{
946 delete this;
947}
948
949////////////////////////////////////////////////////////////////////////////////
950/// Disable the asyn switch when an external request for going asynchronous is issued
951
953{
954 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
956}
957
958////////////////////////////////////////////////////////////////////////////////
959/// Indicate that Cancel or Stop was clicked.
960
962{
963 if (aborted == kTRUE)
964 fBar->SetBarColor("red");
965 else
966 fBar->SetBarColor("yellow");
967
968 if (fProof) {
969 fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
970 "Progress(Long64_t,Long64_t)");
971 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
972 this,
973 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
974 fProof->Disconnect("Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
975 this,
976 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
977 fProof->Disconnect("StopProcess(Bool_t)", this, "IndicateStop(Bool_t)");
978 fProof->Disconnect("DisableGoAsyn()", this, "DisableAsyn()");
979 // These buttons are meaningless at this point
983 }
984
986 if (!fKeep)
987 DoClose();
988}
989
990////////////////////////////////////////////////////////////////////////////////
991/// Load/append a log msg in the log frame, if open
992
993void TProofProgressDialog::LogMessage(const char *msg, Bool_t all)
994{
995 if (fLogWindow) {
996 if (all) {
997 // load buffer
999 } else {
1000 // append
1001 fLogWindow->AddBuffer(msg);
1002 }
1003 }
1004}
1005
1006////////////////////////////////////////////////////////////////////////////////
1007/// Close dialog.
1008
1010{
1012 TTimer::SingleShot(50, "TProofProgressDialog", this, "CloseWindow()");
1013}
1014
1015////////////////////////////////////////////////////////////////////////////////
1016/// Ask proof session for logs
1017
1019{
1020 if (fProof) {
1021 if (!fLogWindow) {
1022 fLogWindow = new TProofProgressLog(this);
1024 fLogWindow->DoLog();
1025 } else {
1026 // Clear window
1028 fLogWindow->Clear();
1029 fLogWindow->DoLog();
1030 }
1031 }
1032 }
1033}
1034
1035////////////////////////////////////////////////////////////////////////////////
1036/// Handle keep toggle button.
1037
1039{
1040 fKeep = !fKeep;
1041
1042 // Last choice will be the default for the future
1044}
1045
1046////////////////////////////////////////////////////////////////////////////////
1047/// Handle log-current-query-only toggle button.
1048
1050{
1053 if (fLogQuery)
1054 fEntry->SetToolTipText("Enter the query number ('last' for the last query)",50);
1055 else
1057
1058 // Last choice will be the default for the future
1060}
1061
1062////////////////////////////////////////////////////////////////////////////////
1063/// Handle Stop button.
1064
1066{
1067 // Do not wait for ever, but al least 10 seconds
1068 Long_t timeout = gEnv->GetValue("Proof.ShutdownTimeout", 60) / 2;
1069 timeout = (timeout > 10) ? timeout : 10;
1070 fProof->StopProcess(kFALSE, timeout);
1071 fStatus = kStopped;
1072
1073 // Set buttons states
1078}
1079
1080////////////////////////////////////////////////////////////////////////////////
1081/// Handle Cancel button.
1082
1084{
1086 fStatus = kAborted;
1087
1088 // Set buttons states
1093}
1094
1095////////////////////////////////////////////////////////////////////////////////
1096/// Handle Asyn button.
1097
1099{
1101
1102 // Set buttons states
1104}
1105
1106////////////////////////////////////////////////////////////////////////////////
1107/// Handle Plot Rate Graph.
1108
1110{
1111 // We must have some point to plot
1112 if (!fRatePoints || fRatePoints->GetEntries() <= 0) {
1113 Info("DoPlotRateGraph","list is empty!");
1114 return;
1115 }
1116
1117 // Fill the graphs
1119 Double_t eymx = -1., bymx = -1., wymx = -1., tymx=-1., symx = -1.;
1125 fRateGraph = new TGraph(np);
1126 fMBRtGraph = new TGraph(np);
1127 if (PPD_SRV_NEWER(25)) {
1128 fActWGraph = new TGraph(np);
1129 fTotSGraph = new TGraph(np);
1130 fEffSGraph = new TGraph(np);
1131 }
1132 Float_t *nar = fRatePoints->GetArgs();
1133 Int_t ii = 0;
1134 for ( ; ii < np; ++ii) {
1135 fRatePoints->GetEntry(ii);
1136 if (!(nar[1] > 0.)) continue;
1137 // Evts/s
1138 fRateGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[1]);
1139 eymx = (nar[1] > eymx) ? nar[1] : eymx;
1140 // MBs/s
1141 fMBRtGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[2]);
1142 bymx = (nar[2] > bymx) ? nar[2] : bymx;
1143 // Active workers
1144 if (PPD_SRV_NEWER(25)) {
1145 fActWGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[3]);
1146 wymx = (nar[3] > wymx) ? nar[3] : wymx;
1147 }
1148 // Sessions info
1149 if (PPD_SRV_NEWER(25)) {
1150 fTotSGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[4]);
1151 tymx = (nar[4] > tymx) ? nar[4] : tymx;
1152 fEffSGraph->SetPoint(ii, (Double_t) nar[0], (Double_t) nar[5]);
1153 symx = (nar[5] > symx) ? nar[5] : symx;
1154 }
1155 }
1156
1157 // Pad numbering
1158 Int_t npads = 4;
1159 Int_t kEvrt = 1;
1160 Int_t kMBrt = 2;
1161 Int_t kActW = 3;
1162 Int_t kSess = 4;
1163 if (bymx <= 0.) {
1165 npads--;
1166 kActW--;
1167 kSess--;
1168 }
1169 if (wymx <= 0.) {
1171 npads--;
1172 kSess--;
1173 }
1174 // Plot only if more than one active session during the query
1175 if (tymx <= 1.) {
1178 npads--;
1179 kSess--;
1180 }
1181 if (tymx <= 0.) SafeDelete(fTotSGraph);
1182 if (symx <= 0.) SafeDelete(fEffSGraph);
1183
1184 // Create a canvas
1185 Int_t jsz = 200*npads;
1186 TCanvas *c1 = new TCanvas("c1","Rate vs Time",200,10,700,jsz);
1187 c1->SetFillColor(0);
1188 c1->SetGrid();
1189 c1->SetBorderMode(0);
1190 c1->SetFrameBorderMode(0);
1191
1192 // Padding
1193 c1->Divide(1, npads);
1194
1195 // Event Rate plot
1196 TPad *cpad = (TPad *) c1->GetPad(kEvrt);
1197 if (cpad) {
1198 cpad->cd();
1199 cpad->SetFillColor(0);
1200 cpad->SetBorderMode(20);
1201 cpad->SetFrameBorderMode(0);
1202 }
1204 fRateGraph->SetMaximum(eymx*1.1);
1210 fRateGraph->SetTitle("Processing rate (evts/sec)");
1211 fRateGraph->GetXaxis()->SetTitle("elapsed time (sec)");
1212 fRateGraph->Draw("ALP");
1213
1214 // Line with average
1217 line->SetLineColor(8);
1218 line->SetLineStyle(2);
1219 line->SetLineWidth(2);
1220 line->Draw();
1221
1222 // Label
1223 Double_t xax0 = fRateGraph->GetXaxis()->GetXmin();
1224 Double_t xax1 = fRateGraph->GetXaxis()->GetXmax();
1225 Double_t yax0 = 0.;
1226 Double_t yax1 = eymx*1.1;
1227 Double_t x0 = xax0 + 0.05 * (xax1 - xax0);
1228 Double_t x1 = xax0 + 0.60 * (xax1 - xax0);
1229 Double_t y0 = yax0 + 0.10 * (yax1 - yax0);
1230 Double_t y1 = yax0 + 0.20 * (yax1 - yax0);
1231 TPaveText *pt = new TPaveText(x0, y0, x1, y1, "br");
1232 pt->SetFillColor(0);
1233 pt->AddText(Form("Global average: %.2f evts/sec", fAvgRate));
1234 pt->Draw();
1235
1236 // MB Rate plot
1237 if (fMBRtGraph) {
1238 cpad = (TPad *) c1->GetPad(kMBrt);
1239 if (cpad) {
1240 cpad->cd();
1241 cpad->SetFillColor(0);
1242 cpad->SetBorderMode(0);
1243 cpad->SetFrameBorderMode(0);
1244 }
1246 TH1F *graph2 = new TH1F("graph2","Average read chunck size (MBs/request)",100,
1248 graph2->SetMinimum(0);
1249 graph2->SetMaximum(1.1*bymx);
1250 graph2->SetDirectory(0);
1251 graph2->SetStats(0);
1252 graph2->GetXaxis()->SetTitle("elapsed time (sec)");
1253 fMBRtGraph->SetHistogram(graph2);
1254 fMBRtGraph->Draw("AB");
1255 }
1256
1257 // MB Rate plot
1258 if (fActWGraph) {
1259 cpad = (TPad *) c1->GetPad(kActW);
1260 if (cpad) {
1261 cpad->cd();
1262 cpad->SetFillColor(0);
1263 cpad->SetBorderMode(0);
1264 cpad->SetFrameBorderMode(0);
1265 }
1267 fActWGraph->SetMaximum(wymx*1.1);
1273 fActWGraph->SetTitle("Active workers");
1274 fActWGraph->GetXaxis()->SetTitle("elapsed time (sec)");
1275 fActWGraph->Draw("ALP");
1276 }
1277
1278 // MB Rate plot
1279 if (fTotSGraph) {
1280 cpad = (TPad *) c1->GetPad(kSess);
1281 if (cpad) {
1282 cpad->cd();
1283 cpad->SetFillColor(0);
1284 cpad->SetBorderMode(0);
1285 cpad->SetFrameBorderMode(0);
1286 }
1288 fTotSGraph->SetMaximum(tymx*1.1);
1294 fTotSGraph->SetTitle("Active, Effective sessions");
1295 fTotSGraph->GetXaxis()->SetTitle("elapsed time (sec)");
1296 fTotSGraph->Draw("ALP");
1297
1298 // Effective sessions
1299 if (fEffSGraph) {
1301 fEffSGraph->SetMaximum(tymx*1.1);
1307 fEffSGraph->Draw("SLP");
1308 }
1309 }
1310
1311 c1->Modified();
1312}
1313
1314////////////////////////////////////////////////////////////////////////////////
1315/// Do a memory plot
1316
1318{
1319 if (!fMemWindow) {
1320 fMemWindow = new TProofProgressMemoryPlot(this, 500, 300);
1321 fMemWindow->DoPlot();
1322 } else {
1323 // Clear window
1324 fMemWindow->Clear();
1325 fMemWindow->DoPlot();
1326 }
1327}
1328
1329////////////////////////////////////////////////////////////////////////////////
1330/// Enable/Disable speedometer
1331
1333{
1334 if (!fSpeedoEnabled) {
1335 // Enable and connect
1337 fSpeedo->Connect("OdoClicked()", "TProofProgressDialog", this, "ToggleOdometerInfos()");
1338 fSpeedo->Connect("LedClicked()", "TProofProgressDialog", this, "ToggleThreshold()");
1339 fUpdtSpeedo->ChangeText("&Disable speedometer");
1340 fUpdtSpeedo->SetToolTipText("Disable speedometer");
1342 fSmoothSpeedo->SetToolTipText("Control smoothness in refreshing the speedo");
1343 } else {
1344 // Disable and disconnect
1346 // Reset speedo
1348 fUpdtSpeedo->ChangeText("&Enable speedometer");
1349 fUpdtSpeedo->SetToolTipText("Enable speedometer (may have an impact on performance)");
1350 fSmoothSpeedo->SetToolTipText("Speedo refreshing is disabled");
1352 }
1353}
@ kFixedWidth
Definition: GuiTypes.h:387
Handle_t Window_t
Definition: GuiTypes.h:28
#define SafeDelete(p)
Definition: RConfig.hxx:543
static const double x1[5]
int Int_t
Definition: RtypesCore.h:43
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
R__EXTERN Int_t gDebug
Definition: RtypesCore.h:117
long long Long64_t
Definition: RtypesCore.h:71
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
@ kButtonDown
Definition: TGButton.h:54
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
#define gClient
Definition: TGClient.h:166
@ kMWMDecorResizeH
Definition: TGFrame.h:74
@ kMWMFuncAll
Definition: TGFrame.h:58
@ kMWMFuncResize
Definition: TGFrame.h:59
@ kMWMDecorMaximize
Definition: TGFrame.h:78
@ kMWMDecorMinimize
Definition: TGFrame.h:77
@ kMWMDecorMenu
Definition: TGFrame.h:76
@ kMWMDecorAll
Definition: TGFrame.h:72
@ kMWMFuncMaximize
Definition: TGFrame.h:62
@ kMWMInputModeless
Definition: TGFrame.h:66
@ kMWMFuncMinimize
Definition: TGFrame.h:61
@ kDeepCleanup
Definition: TGFrame.h:51
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsCenterY
Definition: TGLayout.h:35
@ kLHintsCenterX
Definition: TGLayout.h:32
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
@ kTextLeft
Definition: TGWidget.h:34
@ kTextTop
Definition: TGWidget.h:37
static unsigned int total
#define PPD_SRV_NEWER(v)
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gVirtualX
Definition: TVirtualX.h:338
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition: TAttLine.h:42
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
void SetFrameBorderMode(Int_t mode=1)
Definition: TAttPad.h:79
Double_t GetXmax() const
Definition: TAxis.h:134
Double_t GetXmin() const
Definition: TAxis.h:133
The Canvas class.
Definition: TCanvas.h:27
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:397
virtual EButtonState GetState() const
Definition: TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:187
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1202
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:215
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:577
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void MapWindow()
map window
Definition: TGFrame.h:229
void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGLabel.cxx:394
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:178
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition: TGFrame.cxx:1740
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
Definition: TGFrame.cxx:1851
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1839
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition: TGFrame.cxx:1826
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition: TGFrame.cxx:1864
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
void SetPosition(Float_t pos)
Set progress position between [min,max].
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
virtual void Percent(Bool_t on)
Definition: TGProgressBar.h:90
virtual void ShowPos(Bool_t on)
Definition: TGProgressBar.h:91
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
void SetOdoValue(Int_t val)
Set actual value of odo meter.
Definition: TGSpeedo.cxx:307
void ResetPeakVal()
Definition: TGSpeedo.h:106
Float_t GetScaleMin() const
Definition: TGSpeedo.h:83
void EnableThreshold()
Definition: TGSpeedo.h:100
void SetDisplayText(const char *text1, const char *text2="")
Set small display text (two lines).
Definition: TGSpeedo.cxx:320
@ kGreen
Definition: TGSpeedo.h:41
@ kOrange
Definition: TGSpeedo.h:41
@ kNoglow
Definition: TGSpeedo.h:41
@ kRed
Definition: TGSpeedo.h:41
Bool_t IsThresholdActive()
Definition: TGSpeedo.h:85
void Glow(EGlowColor col=kGreen)
Make speedo glowing.
Definition: TGSpeedo.cxx:231
void SetMinMaxScale(Float_t min, Float_t max)
Set min and max scale values.
Definition: TGSpeedo.cxx:350
void DisableThreshold()
Definition: TGSpeedo.h:101
void SetThresholds(Float_t th1=0.0, Float_t th2=0.0, Float_t th3=0.0)
Definition: TGSpeedo.h:96
void SetThresholdColors(EGlowColor col1, EGlowColor col2, EGlowColor col3)
Definition: TGSpeedo.h:98
void SetScaleValue(Float_t val)
Set actual scale (needle position) value.
Definition: TGSpeedo.cxx:366
void EnableMeanMark()
Definition: TGSpeedo.h:104
void SetMeanValue(Float_t mean)
Definition: TGSpeedo.h:107
void EnablePeakMark()
Definition: TGSpeedo.h:102
Float_t GetScaleMax() const
Definition: TGSpeedo.h:84
void ChangeText(const char *title)
Definition: TGButton.h:217
void SetEnabled(Bool_t flag=kTRUE)
Definition: TGTextEntry.h:164
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
A TGraph is an object made of two arrays X and Y with npoints each.
Definition: TGraph.h:41
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition: TGraph.cxx:2269
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
Definition: TGraph.cxx:2251
virtual void SetTitle(const char *title="")
Change (i.e.
Definition: TGraph.cxx:2324
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
Definition: TGraph.cxx:760
TAxis * GetXaxis() const
Get x axis of the graph.
Definition: TGraph.cxx:1626
virtual void SetHistogram(TH1F *h)
Definition: TGraph.h:175
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
Definition: TGraph.cxx:2260
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:571
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:8393
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:316
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:394
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:395
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition: TH1.cxx:8446
static void OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
Optimize axis limits.
A simple line.
Definition: TLine.h:23
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
A simple TTree restricted to a list of float variables only.
Definition: TNtuple.h:28
Float_t * GetArgs() const
Definition: TNtuple.h:56
virtual Int_t Fill()
Fill a Ntuple with current values in fArgs.
Definition: TNtuple.cxx:170
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:195
@ kInvalidObject
if object ctor succeeded but object should not be used
Definition: TObject.h:68
The most important graphics class in the ROOT system.
Definition: TPad.h:29
virtual void SetBorderMode(Short_t bordermode)
Definition: TPad.h:320
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:593
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:182
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:233
virtual const char * GetUrl()
Definition: TProofMgr.h:94
TProofProgressDialog(TProof *proof, const char *selector, Int_t files, Long64_t first, Long64_t entries)
Create PROOF processing progress dialog.
Float_t AdjustBytes(Float_t mbs, TString &sf)
Transform MBs to GBs ot TBs and get the correct suffix.
TProofProgressLog * fLogWindow
virtual ~TProofProgressDialog()
Cleanup dialog.
void DoEnableSpeedo()
Enable/Disable speedometer.
void DisableAsyn()
Disable the asyn switch when an external request for going asynchronous is issued.
friend class TProofProgressMemoryPlot
void DoKeep(Bool_t on)
Handle keep toggle button.
static TString fgTextQueryDefault
void DoLog()
Ask proof session for logs.
void Progress(Long64_t total, Long64_t processed)
Update progress bar and status labels.
void DoStop()
Handle Stop button.
void LogMessage(const char *msg, Bool_t all)
Load/append a log msg in the log frame, if open.
TGTransientFrame * fDialog
void DoMemoryPlot()
Do a memory plot.
TGCheckButton * fKeepToggle
void DoPlotRateGraph()
Handle Plot Rate Graph.
void DoAsyn()
Handle Asyn button.
TProofProgressMemoryPlot * fMemWindow
void CloseWindow()
Called when dialog is closed.
TGCheckButton * fSmoothSpeedo
void DoSetLogQuery(Bool_t on)
Handle log-current-query-only toggle button.
void ResetProgressDialog(const char *sel, Int_t sz, Long64_t fst, Long64_t ent)
Reset dialog box preparing for new query.
void DoAbort()
Handle Cancel button.
void DoClose()
Close dialog.
void IndicateStop(Bool_t aborted)
Indicate that Cancel or Stop was clicked.
void ToggleOdometerInfos()
Toggle information displayed in Analog Meter.
void DoLog(Bool_t grep=kFALSE)
Display logs.
void LoadBuffer(const char *buffer)
Load a text buffer in the window.
void AddBuffer(const char *buffer)
Add text to the window.
void Clear(Option_t *=0)
Clear log window.
void DoPlot()
Draw the plot from the logs.
void Clear(Option_t *=0)
Clear the canvases.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:316
Bool_t IsValid() const
Definition: TProof.h:937
Int_t GetRemoteProtocol() const
Definition: TProof.h:913
Bool_t IsSync() const
Definition: TProof.h:669
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
Definition: TProof.cxx:2294
void GoAsynchronous()
Send GOASYNC message to the master.
Definition: TProof.cxx:6257
void ResetProgressDialogStatus()
Definition: TProof.h:1021
void StopProcess(Bool_t abort, Int_t timeout=-1)
Send STOPPROCESS message to master and workers.
Definition: TProof.cxx:6214
const char * GetUser() const
Definition: TProof.h:906
const char * GetMaster() const
Definition: TProof.h:903
TProofMgr * GetManager()
Definition: TProof.h:1037
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
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
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition: TSystem.cxx:461
Basic time type with millisecond precision.
Definition: TTime.h:27
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition: TTimer.cxx:256
virtual Long64_t GetEntries() const
Definition: TTree.h:457
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
Definition: TTree.cxx:7897
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:5542
TPaveText * pt
TLine * line
int main(int argc, char **argv)
return c1
Definition: legend1.C:41
static constexpr double mm
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Definition: TMath.h:725
Definition: first.py:1
auto * tt
Definition: textangle.C:16