50#define PPD_SRV_NEWER(v) (fProof && fProof->GetRemoteProtocol() > v)
66 fBar(0), fClose(0), fStop(0), fAbort(0), fAsyn(0), fLog(0), fRatePlot(0),
67 fMemPlot(0), fKeepToggle(0), fLogQueryToggle(0), fTextQuery(0), fEntry(0),
68 fTitleLab(0), fFilesEvents(0), fTimeLab(0), fProcessed(0), fEstim(0),
69 fTotal(0), fRate(0), fInit(0), fSelector(0), fSpeedo(0), fSmoothSpeedo(0)
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",
198 new TGHotString(
"Close dialog when processing is complete"));
201 "TProofProgressDialog",
this,
"DoKeep(Bool_t)");
213 fSpeedo->
Connect(
"OdoClicked()",
"TProofProgressDialog",
this,
"ToggleOdometerInfos()");
214 fSpeedo->
Connect(
"LedClicked()",
"TProofProgressDialog",
this,
"ToggleThreshold()");
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()");
255 fStop->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoStop()");
260 fAbort->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoAbort()");
266 fClose->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoClose()");
275 fLog->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoLog()");
282 fRatePlot->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoPlotRateGraph()");
287 fMemPlot->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoMemoryPlot()");
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()");
419 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
433 buf.
Form(
"Selector: %s", selec);
441 buf.
Form(
"%d files, number of events %lld, starting event %lld",
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",
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);
564 "Progress(Long64_t,Long64_t)");
566 "IndicateStop(Bool_t)");
583 Bool_t incomplete = (processed < 0 &&
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",
698 if (evproc > 0 && procTime > 0.)
715 if (over || (processed >= 0 && processed >=
total)) {
719 Bool_t incomplete = (processed < 0 &&
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",
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)");
801 Bool_t incomplete = (processed < 0 &&
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)",
841 BinHigh = 1.5 * evtrti;
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)");
913 fProof->
Disconnect(
"ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
915 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
952 if (aborted ==
kTRUE)
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)");
1058 timeout = (timeout > 10) ? timeout : 10;
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);
1216 Double_t x0 = xax0 + 0.05 * (xax1 - xax0);
1218 Double_t y0 = yax0 + 0.10 * (yax1 - yax0);
1235 TH1F *graph2 =
new TH1F(
"graph2",
"Average read chunck size (MBs/request)",100,
1326 fSpeedo->
Connect(
"OdoClicked()",
"TProofProgressDialog",
this,
"ToggleOdometerInfos()");
1327 fSpeedo->
Connect(
"LedClicked()",
"TProofProgressDialog",
this,
"ToggleThreshold()");
Handle_t Window_t
Window handle.
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
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
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
void SetFrameBorderMode(Int_t mode=1)
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
The base class for composite widgets (menu bars, list boxes, etc.).
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
UInt_t GetDefaultWidth() const override
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
void Move(Int_t x, Int_t y) override
Move frame.
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
This class handles GUI labels.
void SetTextJustify(Int_t tmode)
Set text justification.
virtual void SetText(TGString *newText)
Set new text in label.
This class describes layout hints used by the layout classes.
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
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.
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)
virtual void ShowPos(Bool_t on)
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
TGSpeedo is a widget looking like a speedometer, with a needle, a counter and a small odometer window...
void SetOdoValue(Int_t val)
Set actual value of odo meter.
Float_t GetScaleMin() const
void SetDisplayText(const char *text1, const char *text2="")
Set small display text (two lines).
Bool_t IsThresholdActive()
void Glow(EGlowColor col=kGreen)
Make speedo glowing.
void SetMinMaxScale(Float_t min, Float_t max)
Set min and max scale values.
void SetThresholds(Float_t th1=0.0, Float_t th2=0.0, Float_t th3=0.0)
void SetThresholdColors(EGlowColor col1, EGlowColor col2, EGlowColor col3)
void SetScaleValue(Float_t val)
Set actual scale (needle position) value.
void SetMeanValue(Float_t mean)
Float_t GetScaleMax() const
Yield an action as soon as it is clicked.
void ChangeText(const char *title)
void SetEnabled(Bool_t flag=kTRUE)
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
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.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
TAxis * GetXaxis() const
Get x axis of the graph.
virtual void SetHistogram(TH1F *h)
void SetTitle(const char *title="") override
Change (i.e.
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
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.
Float_t * GetArgs() const
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
@ 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
TVirtualPad * GetPad(Int_t subpadnumber) const override
Get a pointer to subpadnumber of this pad.
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
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
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
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.
void DoLog(Bool_t grep=kFALSE)
Display logs.
void Clear(Option_t *=nullptr)
Clear log window.
void LoadBuffer(const char *buffer)
Load a text buffer in the window.
void AddBuffer(const char *buffer)
Add text to the window.
void DoPlot()
Draw the plot from the logs.
void Clear(Option_t *=nullptr)
Clear the canvases.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Int_t GetRemoteProtocol() const
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
void GoAsynchronous()
Send GOASYNC message to the master.
void ResetProgressDialogStatus()
void StopProcess(Bool_t abort, Int_t timeout=-1)
Send STOPPROCESS message to master and workers.
const char * GetUser() const
const char * GetMaster() const
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.
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
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.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
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.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Long64_t GetEntries() const
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.