49 #define PPD_SRV_NEWER(v) (fProof && fProof->GetRemoteProtocol() > v) 65 fBar(0), fClose(0), fStop(0), fAbort(0), fAsyn(0), fLog(0), fRatePlot(0),
66 fMemPlot(0), fKeepToggle(0), fLogQueryToggle(0), fTextQuery(0), fEntry(0),
67 fTitleLab(0), fFilesEvents(0), fTimeLab(0), fProcessed(0), fEstim(0),
68 fTotal(0), fRate(0), fInit(0), fSelector(0), fSpeedo(0), fSmoothSpeedo(0)
98 if (!proof || !(proof->
IsValid())) {
99 Error(
"TProofProgressDialog",
"proof instance is invalid (%p, %s): protocol error?",
100 proof, (proof && !(proof->
IsValid())) ?
"invalid" :
"undef");
109 fRatePoints =
new TNtuple(
"RateNtuple",
"Rate progress info",
"tm:evr:mbr:act:tos:efs");
115 fDialog->
Connect(
"CloseWindow()",
"TProofProgressDialog",
this,
"DoClose()");
127 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
133 buf.
Form(
"Selector: %s", selector);
137 buf.
Form(
"%d files, number of events %lld, starting event %lld",
197 new TGHotString(
"Close dialog when processing is complete"));
200 "TProofProgressDialog",
this,
"DoKeep(Bool_t)");
212 fSpeedo->
Connect(
"OdoClicked()",
"TProofProgressDialog",
this,
"ToggleOdometerInfos()");
213 fSpeedo->
Connect(
"LedClicked()",
"TProofProgressDialog",
this,
"ToggleThreshold()");
242 UInt_t nb1 = 0, width1 = 0, height1 = 0;
246 fAsyn->
SetToolTipText(
"Continue running in the background (asynchronous mode), releasing the ROOT prompt");
248 fAsyn->
SetToolTipText(
"Switch to asynchronous mode disabled: functionality not supported by the server");
251 fAsyn->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoAsyn()");
258 fStop->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoStop()");
265 fAbort->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoAbort()");
273 fClose->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoClose()");
284 fLog->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoLog()");
291 fRatePlot->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoPlotRateGraph()");
296 fMemPlot->
Connect(
"Clicked()",
"TProofProgressDialog",
this,
"DoMemoryPlot()");
325 fProof->
Connect(
"Progress(Long64_t,Long64_t)",
"TProofProgressDialog",
326 this,
"Progress(Long64_t,Long64_t)");
327 fProof->
Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
328 "TProofProgressDialog",
this,
329 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
330 fProof->
Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
331 "TProofProgressDialog",
this,
332 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
333 fProof->
Connect(
"StopProcess(Bool_t)",
"TProofProgressDialog",
this,
334 "IndicateStop(Bool_t)");
335 fProof->
Connect(
"ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
336 "TProofProgressDialog",
this,
337 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
338 fProof->
Connect(
"CloseProgressDialog()",
"TProofProgressDialog",
this,
"DoClose()");
339 fProof->
Connect(
"DisableGoAsyn()",
"TProofProgressDialog",
this,
"DisableAsyn()");
367 (mw - width), (mh - height) >> 1, ax, ay, wdum);
428 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
442 buf.
Form(
"Selector: %s", selec);
450 buf.
Form(
"%d files, number of events %lld, starting event %lld",
475 fProof->
Connect(
"Progress(Long64_t,Long64_t)",
"TProofProgressDialog",
476 this,
"Progress(Long64_t,Long64_t)");
477 fProof->
Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
478 "TProofProgressDialog",
this,
479 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
480 fProof->
Connect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
481 "TProofProgressDialog",
this,
482 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
483 fProof->
Connect(
"StopProcess(Bool_t)",
"TProofProgressDialog",
this,
484 "IndicateStop(Bool_t)");
485 fProof->
Connect(
"DisableGoAsyn()",
"TProofProgressDialog",
this,
"DisableAsyn()");
513 static const char *cproc[] = {
"running",
"done",
514 "STOPPED",
"ABORTED",
"***EVENTS SKIPPED***"};
517 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
536 buf.
Form(
"%d files, number of events %lld, starting event %lld",
552 if (processed >= 0 && processed >= total) {
557 ss = (
UInt_t)((tt % 3600) % 60);
560 stm.
Form(
"%d h %d min %d sec", hh,
mm, ss);
562 stm.
Form(
"%d min %d sec",
mm, ss);
564 stm.
Form(
"%d sec", ss);
566 buf.
Form(
"%lld events in %s\n", total, stm.
Data());
573 "Progress(Long64_t,Long64_t)");
575 "IndicateStop(Bool_t)");
592 Bool_t incomplete = (processed < 0 &&
604 ss = (
UInt_t)((tt % 3600) % 60);
607 stm.
Form(
"%d h %d min %d sec", hh,
mm, ss);
609 stm.
Form(
"%d min %d sec",
mm, ss);
611 stm.
Form(
"%d sec", ss);
614 buf.
Form(
"%lld / %lld events", evproc, total);
653 static const char *cproc[] = {
"running",
"done",
654 "STOPPED",
"ABORTED",
"***EVENTS SKIPPED***"};
657 buf.
Form(
"Executing on PROOF cluster \"%s\" with %d parallel workers:",
663 Info(
"Progress",
"t: %lld, p: %lld, itm: %f, ptm: %f", total, processed, initTime, procTime);
665 if (initTime >= 0.) {
668 buf.
Form(
"%.1f secs", initTime);
697 buf.
Form(
"%d files, number of events %lld, starting event %lld",
707 if (evproc > 0 && procTime > 0.)
724 if (over || (processed >= 0 && processed >= total)) {
728 Bool_t incomplete = (processed < 0 &&
743 ss = (
UInt_t)((tt % 3600) % 60);
746 stm.
Form(
"%d h %d min %d sec", hh,
mm, ss);
748 stm.
Form(
"%d min %d sec",
mm, ss);
750 stm.
Form(
"%d sec", ss);
755 buf.
Form(
"%lld events (%.2f %s)\n",
779 "Progress(Long64_t,Long64_t)");
780 fProof->
Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
782 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
783 fProof->
Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
785 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
810 Bool_t incomplete = (processed < 0 &&
822 ss = (
UInt_t)((tt % 3600) % 60);
825 stm.
Form(
"%d h %d min %d sec", hh,
mm, ss);
827 stm.
Form(
"%d min %d sec",
mm, ss);
829 stm.
Form(
"%d sec", ss);
834 buf.
Form(
"%lld / %lld events - %.2f %s", evproc, total, xb, sf.
Data());
842 buf.
Form(
"%.1f evts/sec \navg: %.1f evts/sec (%.1f MB/sec)",
850 BinHigh = 1.5 * evtrti;
913 "Progress(Long64_t,Long64_t)");
914 fProof->
Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
916 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
917 fProof->
Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
919 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
922 fProof->
Disconnect(
"ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)",
924 "ResetProgressDialog(const char*,Int_t,Long64_t,Long64_t)");
961 if (aborted ==
kTRUE)
968 "Progress(Long64_t,Long64_t)");
969 fProof->
Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)",
971 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t)");
972 fProof->
Disconnect(
"Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)",
974 "Progress(Long64_t,Long64_t,Long64_t,Float_t,Float_t,Float_t,Float_t,Int_t,Int_t,Float_t)");
1067 timeout = (timeout > 10) ? timeout : 10;
1111 Info(
"DoPlotRateGraph",
"list is empty!");
1117 Double_t eymx = -1., bymx = -1., wymx = -1., tymx=-1., symx = -1.;
1132 for ( ; ii < np; ++ii) {
1134 if (!(nar[1] > 0.))
continue;
1137 eymx = (nar[1] > eymx) ? nar[1] : eymx;
1140 bymx = (nar[2] > bymx) ? nar[2] : bymx;
1144 wymx = (nar[3] > wymx) ? nar[3] : wymx;
1149 tymx = (nar[4] > tymx) ? nar[4] : tymx;
1151 symx = (nar[5] > symx) ? nar[5] : symx;
1183 Int_t jsz = 200*npads;
1225 Double_t x0 = xax0 + 0.05 * (xax1 - xax0);
1227 Double_t y0 = yax0 + 0.10 * (yax1 - yax0);
1228 Double_t y1 = yax0 + 0.20 * (yax1 - yax0);
1244 TH1F *graph2 =
new TH1F(
"graph2",
"Average read chunck size (MBs/request)",100,
1335 fSpeedo->
Connect(
"OdoClicked()",
"TProofProgressDialog",
this,
"ToggleOdometerInfos()");
1336 fSpeedo->
Connect(
"LedClicked()",
"TProofProgressDialog",
this,
"ToggleThreshold()");
void ChangeText(const char *title)
void DoSetLogQuery(Bool_t on)
Handle log-current-query-only toggle button.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
void DisableAsyn()
Disable the asyn switch when an external request for going asynchronous is issued.
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
virtual void SetMaximum(Double_t maximum=-1111)
void ResetProgressDialog(const char *sel, Int_t sz, Long64_t fst, Long64_t ent)
Reset dialog box preparing for new query.
virtual TVirtualPad * GetPad(Int_t subpadnumber) const
Get a pointer to subpadnumber of this pad.
void DoLog()
Ask proof session for logs.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
void CloseWindow()
Called when dialog is closed.
void DoKeep(Bool_t on)
Handle keep toggle button.
void DoMemoryPlot()
Do a memory plot.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
void SetFrameBorderMode(Int_t mode=1)
void SetDisplayText(const char *text1, const char *text2="")
Set small display text (two lines).
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
TGCheckButton * fKeepToggle
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
Float_t GetScaleMax() const
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual void SetBorderMode(Short_t bordermode)
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
static TString fgTextQueryDefault
Bool_t IsThresholdActive()
virtual void SetMinimum(Double_t minimum=-1111)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
1-D histogram with a float per channel (see TH1 documentation)}
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 UInt_t GetDefaultHeight() const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void SetTitle(const char *title="")
Set graph title.
static constexpr double mm
Basic time type with millisecond precision.
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
static void OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger)
Optimize axis limits.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual void SetBarColor(Pixel_t color)
Set progress bar color.
void SetMinMaxScale(Float_t min, Float_t max)
Set min and max scale values.
virtual ~TProofProgressDialog()
Cleanup dialog.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
void StopProcess(Bool_t abort, Int_t timeout=-1)
Send STOPPROCESS message to master and workers.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
TProofProgressLog * fLogWindow
virtual void Percent(Bool_t on)
virtual void SetText(TGString *newText)
Set new text in label.
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.
TGTextButton * fUpdtSpeedo
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
void DoLog(Bool_t grep=kFALSE)
Display logs.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
void Info(const char *location, const char *msgfmt,...)
friend class TProofProgressLog
int main(int argc, char **argv)
TGCheckButton * fSmoothSpeedo
void Progress(Long64_t total, Long64_t processed)
Update progress bar and status labels.
void DoEnableSpeedo()
Enable/Disable speedometer.
void Clear(Option_t *=0)
Clear log window.
void SetOdoValue(Int_t val)
Set actual value of odo meter.
void Error(const char *location, const char *msgfmt,...)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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...
static Bool_t fgKeepDefault
void SetThresholdColors(EGlowColor col1, EGlowColor col2, EGlowColor col3)
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
void SetScaleValue(Float_t val)
Set actual scale (needle position) value.
static Bool_t fgLogQueryDefault
virtual UInt_t GetDefaultWidth() const
A simple TTree restricted to a list of float variables only.
R__EXTERN TSystem * gSystem
virtual void ShowPos(Bool_t on)
if object ctor succeeded but object should not be used
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
void Glow(EGlowColor col=kGreen)
Make speedo glowing.
friend class TProofProgressMemoryPlot
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
The most important graphics class in the ROOT system.
char * Form(const char *fmt,...)
virtual UInt_t GetDefaultWidth() const
virtual const char * GetUrl()
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
void DoPlotRateGraph()
Handle Plot Rate Graph.
void LoadBuffer(const char *buffer)
Load a text buffer in the window.
TAxis * GetXaxis() const
Get x axis of the graph.
virtual void Move(Int_t x, Int_t y)
Move frame.
Float_t * GetArgs() const
void GoAsynchronous()
Send GOASYNC message to the master.
static unsigned int total
virtual UInt_t GetDefaultHeight() const
void LogMessage(const char *msg, Bool_t all)
Load/append a log msg in the log frame, if open.
void SetEnabled(Bool_t flag=kTRUE)
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
void DoPlot()
Draw the plot from the logs.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
const char * GetMaster() const
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
void SetPosition(Float_t pos)
Set progress position between [min,max].
This class controls a Parallel ROOT Facility, PROOF, cluster.
virtual Int_t Fill()
Fill a Ntuple with current values in fArgs.
void DoClose()
Close dialog.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Float_t AdjustBytes(Float_t mbs, TString &sf)
Transform MBs to GBs ot TBs and get the correct suffix.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Float_t GetScaleMin() const
void SetMeanValue(Float_t mean)
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual Long64_t GetEntries() const
void DoStop()
Handle Stop button.
virtual void Reset()
Reset progress bar (i.e. set pos to 0).
void ResetProgressDialogStatus()
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
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.
void SetTextJustify(Int_t tmode)
Set text justification.
TProofProgressMemoryPlot * fMemWindow
TProofProgressDialog(TProof *proof, const char *selector, Int_t files, Long64_t first, Long64_t entries)
Create PROOF processing progress dialog.
Short_t Max(Short_t a, Short_t b)
TGTransientFrame * fDialog
A Graph is a graphics object made of two arrays X and Y with npoints each.
void AddBuffer(const char *buffer)
Add text to the window.
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
Int_t GetRemoteProtocol() const
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
virtual void SetHistogram(TH1F *h)
const char * GetUser() const
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void SetThresholds(Float_t th1=0.0, Float_t th2=0.0, Float_t th3=0.0)
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
void Modified(Bool_t flag=1)
void ToggleOdometerInfos()
Toggle information displayed in Analog Meter.
void DoAsyn()
Handle Asyn button.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
void DoAbort()
Handle Cancel button.
void Clear(Option_t *=0)
Clear the canvases.
void IndicateStop(Bool_t aborted)
Indicate that Cancel or Stop was clicked.
const char * Data() const