50#define PPD_SRV_NEWER(v) (fProof && fProof->GetRemoteProtocol() > v)
99 if (!proof || !(proof->
IsValid())) {
100 Error(
"TProofProgressDialog",
"proof instance is invalid (%p, %s): protocol error?",
101 proof, (proof && !(proof->IsValid())) ?
"invalid" :
"undef");
110 fRatePoints =
new TNtuple(
"RateNtuple",
"Rate progress info",
"tm:evr:mbr:act:tos:efs");
116 fDialog->Connect(
"CloseWindow()",
"TProofProgressDialog",
this,
"DoClose()");
128 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
134 buf.
Form(
"Selector: %s", selector);
138 buf.
Form(
"%d files, number of events %lld, starting event %lld",
146 fBar->SetBarColor(
"green");
198 new TGHotString(
"Close dialog when processing is complete"));
201 "TProofProgressDialog",
this,
"DoKeep(Bool_t)");
208 Int_t enablespeedo =
gEnv->GetValue(
"Proof.EnableSpeedo", 0);
213 fSpeedo->Connect(
"OdoClicked()",
"TProofProgressDialog",
this,
"ToggleOdometerInfos()");
214 fSpeedo->Connect(
"LedClicked()",
"TProofProgressDialog",
this,
"ToggleThreshold()");
217 fSpeedo->SetDisplayText(
"Init Time",
"[ms]");
219 fSpeedo->SetThresholds(0.0, 25.0, 50.0);
227 fSmoothSpeedo->SetToolTipText(
"Control smoothness in refreshing the speedo");
229 fSmoothSpeedo->SetToolTipText(
"Speedo refreshing is disabled");
244 if (
fProof->GetRemoteProtocol() >= 22 &&
fProof->IsSync()) {
245 fAsyn->SetToolTipText(
"Continue running in the background (asynchronous mode), releasing the ROOT prompt");
247 fAsyn->SetToolTipText(
"Switch to asynchronous mode disabled: functionality not supported by the server");
250 fAsyn->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoAsyn()");
254 fStop->SetToolTipText(
"Stop processing, Terminate() will be executed");
255 fStop->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoStop()");
259 fAbort->SetToolTipText(
"Cancel processing, Terminate() will NOT be executed");
260 fAbort->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoAbort()");
264 fClose->SetToolTipText(
"Close this dialog");
266 fClose->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoClose()");
274 fLog->SetToolTipText(
"Show query log messages");
275 fLog->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoLog()");
280 fRatePlot->SetToolTipText(
"Show rates, chunck sizes, cluster activities ... vs time");
282 fRatePlot->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoPlotRateGraph()");
287 fMemPlot->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoMemoryPlot()");
288 fMemPlot->SetToolTipText(
"Show memory consumption vs entry / merging phase");
292 fUpdtSpeedo->Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoEnableSpeedo()");
295 fUpdtSpeedo->SetToolTipText(
"Disable speedometer");
298 fUpdtSpeedo->SetToolTipText(
"Enable speedometer (may have an impact on performance)");
311 fMemPlot->SetToolTipText(
"Show memory consumption");
316 fProof->Connect(
"Progress(Long64_t,Long64_t)",
"TProofProgressDialog",
317 this,
"Progress(Long64_t,Long64_t)");
318 fProof->Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
319 "TProofProgressDialog",
this,
320 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
321 fProof->Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
322 "TProofProgressDialog",
this,
323 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
324 fProof->Connect(
"StopProcess(Bool_t)",
"TProofProgressDialog",
this,
325 "IndicateStop(Bool_t)");
326 fProof->Connect(
"ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
327 "TProofProgressDialog",
this,
328 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
329 fProof->Connect(
"CloseProgressDialog()",
"TProofProgressDialog",
this,
"DoClose()");
330 fProof->Connect(
"DisableGoAsyn()",
"TProofProgressDialog",
this,
"DisableAsyn()");
335 if (strlen(
fProof->GetUser()) > 0)
336 fDialog->SetWindowName(
Form(
"PROOF Query Progress: %s@%s",
341 fDialog->SetWindowName(
"PROOF Query Progress: <dummy>");
370 fDialog->Move(ax-10, ay - mh/4);
371 fDialog->SetWMPosition(ax-10, ay - mh/4);
388 fSpeedo->SetDisplayText(
"Init Time",
"[ms]");
392 fSpeedo->SetDisplayText(
"Proc Time",
"[ms]");
401 if (
fSpeedo->IsThresholdActive()) {
419 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
433 buf.
Form(
"Selector: %s", selec);
437 fTimeLab->SetText(
"Estimated time left:");
441 buf.
Form(
"%d files, number of events %lld, starting event %lld",
446 fBar->SetBarColor(
"green");
450 fSpeedo->SetMinMaxScale(0.0, 1.0);
466 fProof->Connect(
"Progress(Long64_t,Long64_t)",
"TProofProgressDialog",
467 this,
"Progress(Long64_t,Long64_t)");
468 fProof->Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
469 "TProofProgressDialog",
this,
470 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
471 fProof->Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
472 "TProofProgressDialog",
this,
473 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
474 fProof->Connect(
"StopProcess(Bool_t)",
"TProofProgressDialog",
this,
475 "IndicateStop(Bool_t)");
476 fProof->Connect(
"DisableGoAsyn()",
"TProofProgressDialog",
this,
"DisableAsyn()");
504 static const char *cproc[] = {
"running",
"done",
505 "STOPPED",
"ABORTED",
"***EVENTS SKIPPED***"};
508 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
527 buf.
Form(
"%d files, number of events %lld, starting event %lld",
534 fBar->SetPosition(pos);
543 if (processed >= 0 && processed >=
total) {
551 stm.
Form(
"%d h %d min %d sec", hh, mm, ss);
553 stm.
Form(
"%d min %d sec", mm, ss);
555 stm.
Form(
"%d sec", ss);
563 fProof->Disconnect(
"Progress(Long64_t,Long64_t)",
this,
564 "Progress(Long64_t,Long64_t)");
565 fProof->Disconnect(
"StopProcess(Bool_t)",
this,
566 "IndicateStop(Bool_t)");
567 fProof->Disconnect(
"DisableGoAsyn()",
this,
"DisableAsyn()");
583 Bool_t incomplete = (processed < 0 &&
589 fBar->SetBarColor(
"magenta");
598 stm.
Form(
"%d h %d min %d sec", hh, mm, ss);
600 stm.
Form(
"%d min %d sec", mm, ss);
602 stm.
Form(
"%d sec", ss);
605 buf.
Form(
"%lld / %lld events", evproc,
total);
644 static const char *cproc[] = {
"running",
"done",
645 "STOPPED",
"ABORTED",
"***EVENTS SKIPPED***"};
648 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
654 Info(
"Progress",
"t: %lld, p: %lld, itm: %f, ptm: %f",
total, processed, initTime, procTime);
656 if (initTime >= 0.) {
659 buf.
Form(
"%.1f secs", initTime);
688 buf.
Form(
"%d files, number of events %lld, starting event %lld",
695 fBar->SetPosition(pos);
698 if (evproc > 0 && procTime > 0.)
715 if (over || (processed >= 0 && processed >=
total)) {
719 Bool_t incomplete = (processed < 0 &&
726 fBar->SetBarColor(
"magenta");
737 stm.
Form(
"%d h %d min %d sec", hh, mm, ss);
739 stm.
Form(
"%d min %d sec", mm, ss);
741 stm.
Form(
"%d sec", ss);
746 buf.
Form(
"%lld events (%.2f %s)\n",
750 fTimeLab->SetText(
"Processing time:");
755 Bool_t useAvg =
gEnv->GetValue(
"Proof.RatePlotUseAvg", 0);
769 fProof->Disconnect(
"Progress(Long64_t,Long64_t)",
this,
770 "Progress(Long64_t,Long64_t)");
771 fProof->Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
773 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
774 fProof->Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
776 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
777 fProof->Disconnect(
"StopProcess(Bool_t)",
this,
"IndicateStop(Bool_t)");
778 fProof->Disconnect(
"DisableGoAsyn()",
this,
"DisableAsyn()");
788 fSpeedo->SetScaleValue(0.0, 0);
801 Bool_t incomplete = (processed < 0 &&
807 fBar->SetBarColor(
"magenta");
816 stm.
Form(
"%d h %d min %d sec", hh, mm, ss);
818 stm.
Form(
"%d min %d sec", mm, ss);
820 stm.
Form(
"%d sec", ss);
825 buf.
Form(
"%lld / %lld events - %.2f %s", evproc,
total, xb, sf.
Data());
833 buf.
Form(
"%.1f evts/sec \navg: %.1f evts/sec (%.1f MB/sec)",
838 if (evtrti >
fSpeedo->GetScaleMax()) {
840 BinLow =
fSpeedo->GetScaleMin();
841 BinHigh = 1.5 * evtrti;
846 fSpeedo->SetScaleValue(evtrti, 0);
848 fSpeedo->SetScaleValue(evtrti);
865 fSpeedo->SetScaleValue(0.0, 0);
903 fProof->Disconnect(
"Progress(Long64_t,Long64_t)",
this,
904 "Progress(Long64_t,Long64_t)");
905 fProof->Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
907 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
908 fProof->Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
910 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
911 fProof->Disconnect(
"StopProcess(Bool_t)",
this,
"IndicateStop(Bool_t)");
912 fProof->Disconnect(
"DisableGoAsyn()",
this,
"DisableAsyn()");
913 fProof->Disconnect(
"ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
915 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
916 fProof->Disconnect(
"CloseProgressDialog()",
this,
"CloseProgressDialog()");
917 fProof->ResetProgressDialogStatus();
943 fProof->Disconnect(
"DisableGoAsyn()",
this,
"DisableAsyn()");
952 if (aborted ==
kTRUE)
953 fBar->SetBarColor(
"red");
955 fBar->SetBarColor(
"yellow");
958 fProof->Disconnect(
"Progress(Long64_t,Long64_t)",
this,
959 "Progress(Long64_t,Long64_t)");
960 fProof->Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
962 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
963 fProof->Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
965 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
966 fProof->Disconnect(
"StopProcess(Bool_t)",
this,
"IndicateStop(Bool_t)");
967 fProof->Disconnect(
"DisableGoAsyn()",
this,
"DisableAsyn()");
1043 fEntry->SetToolTipText(
"Enter the query number ('last' for the last query)",50);
1045 fEntry->SetToolTipText(0);
1057 Long_t timeout =
gEnv->GetValue(
"Proof.ShutdownTimeout", 60) / 2;
1058 timeout = (timeout > 10) ? timeout : 10;
1089 fProof->GoAsynchronous();
1102 Info(
"DoPlotRateGraph",
"list is empty!");
1108 Double_t eymx = -1., bymx = -1., wymx = -1., tymx=-1., symx = -1.;
1123 for ( ; ii <
np; ++ii) {
1125 if (!(nar[1] > 0.))
continue;
1128 eymx = (nar[1] > eymx) ? nar[1] : eymx;
1131 bymx = (nar[2] > bymx) ? nar[2] : bymx;
1135 wymx = (nar[3] > wymx) ? nar[3] : wymx;
1140 tymx = (nar[4] > tymx) ? nar[4] : tymx;
1142 symx = (nar[5] > symx) ? nar[5] : symx;
1174 Int_t jsz = 200*npads;
1176 c1->SetFillColor(0);
1178 c1->SetBorderMode(0);
1179 c1->SetFrameBorderMode(0);
1182 c1->Divide(1, npads);
1199 fRateGraph->SetTitle(
"Processing rate (evts/sec)");
1200 fRateGraph->GetXaxis()->SetTitle(
"elapsed time (sec)");
1206 line->SetLineColor(8);
1207 line->SetLineStyle(2);
1208 line->SetLineWidth(2);
1216 Double_t x0 = xax0 + 0.05 * (xax1 - xax0);
1218 Double_t y0 = yax0 + 0.10 * (yax1 - yax0);
1221 pt->SetFillColor(0);
1227 cpad = (
TPad *)
c1->GetPad(kMBrt);
1235 TH1F *graph2 =
new TH1F(
"graph2",
"Average read chunck size (MBs/request)",100,
1248 cpad = (
TPad *)
c1->GetPad(kActW);
1263 fActWGraph->GetXaxis()->SetTitle(
"elapsed time (sec)");
1269 cpad = (
TPad *)
c1->GetPad(kSess);
1283 fTotSGraph->SetTitle(
"Active, Effective sessions");
1284 fTotSGraph->GetXaxis()->SetTitle(
"elapsed time (sec)");
1326 fSpeedo->Connect(
"OdoClicked()",
"TProofProgressDialog",
this,
"ToggleOdometerInfos()");
1327 fSpeedo->Connect(
"LedClicked()",
"TProofProgressDialog",
this,
"ToggleThreshold()");
1329 fUpdtSpeedo->SetToolTipText(
"Disable speedometer");
1331 fSmoothSpeedo->SetToolTipText(
"Control smoothness in refreshing the speedo");
1338 fUpdtSpeedo->SetToolTipText(
"Enable speedometer (may have an impact on performance)");
1339 fSmoothSpeedo->SetToolTipText(
"Speedo refreshing is disabled");
Handle_t Window_t
Window handle.
if(isa< VarDecl >(D)||isa< FieldDecl >(D)||isa< EnumConstantDecl >(D))
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
static unsigned int total
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char y1
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
int main(int argc, char *argv[])
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
void SetFrameBorderMode(Int_t mode=1)
The base class for composite widgets (menu bars, list boxes, etc.).
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
TGSpeedo is a widget looking like a speedometer, with a needle, a counter and a small odometer window...
Yield an action as soon as it is clicked.
Defines transient windows that typically are used for dialogs windows.
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
A TGraph is an object made of two arrays X and Y with npoints each.
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetMinimum(Double_t minimum=-1111)
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
static void OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
Optimize axis limits.
Use the TLine constructor to create a simple line.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
A simple TTree restricted to a list of float variables only.
@ kInvalidObject
if object ctor succeeded but object should not be used
The most important graphics class in the ROOT system.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void SetBorderMode(Short_t bordermode) override
A Pave (see TPave) with text, lines or/and boxes inside.
virtual const char * GetUrl()
This class provides a query progress bar.
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
TGTextBuffer * fTextQuery
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
static Bool_t fgLogQueryDefault
void DoPlotRateGraph()
Handle Plot Rate Graph.
void DoAsyn()
Handle Asyn button.
TGTextButton * fUpdtSpeedo
TProofProgressMemoryPlot * fMemWindow
void CloseWindow()
Called when dialog is closed.
TGCheckButton * fSmoothSpeedo
void DoSetLogQuery(Bool_t on)
Handle log-current-query-only toggle button.
static Bool_t fgKeepDefault
TGCheckButton * fLogQueryToggle
void ResetProgressDialog(const char *sel, Int_t sz, Long64_t fst, Long64_t ent)
Reset dialog box preparing for new query.
friend class TProofProgressLog
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.
This class controls a Parallel ROOT Facility, PROOF, cluster.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Basic time type with millisecond precision.
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.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.