Skip to content
Snippets Groups Projects
Commit 65cc583b authored by Bertrand Bellenot's avatar Bertrand Bellenot
Browse files

Added a speedometer widget (TGSpeedo) to display the processing rate

+ small layout improvements


git-svn-id: http://root.cern.ch/svn/root/trunk@30831 27541ba8-7e3a-0410-8455-c3a389f83636
parent af24eac1
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ class TProofProgressLog; ...@@ -40,7 +40,7 @@ class TProofProgressLog;
class TProofProgressMemoryPlot; class TProofProgressMemoryPlot;
class TNtuple; class TNtuple;
class TGraph; class TGraph;
class TGSpeedo;
class TProofProgressDialog { class TProofProgressDialog {
...@@ -66,11 +66,13 @@ private: ...@@ -66,11 +66,13 @@ private:
TGLabel *fTitleLab; TGLabel *fTitleLab;
TGLabel *fFilesEvents; TGLabel *fFilesEvents;
TGLabel *fProcessed; TGLabel *fProcessed;
TGLabel *fEstim;
TGLabel *fTotal; TGLabel *fTotal;
TGLabel *fRate; TGLabel *fRate;
TGLabel *fInit; TGLabel *fInit;
TGLabel *fSelector; TGLabel *fSelector;
TProofProgressLog *fLogWindow; // transient frame for logs TGSpeedo *fSpeedo; // speedo meter
TProofProgressLog *fLogWindow; // transient frame for logs
TProofProgressMemoryPlot *fMemWindow; // transient frame for memory plots TProofProgressMemoryPlot *fMemWindow; // transient frame for memory plots
TProof *fProof; TProof *fProof;
TTime fStartTime; TTime fStartTime;
...@@ -85,10 +87,12 @@ private: ...@@ -85,10 +87,12 @@ private:
Bool_t fLogQuery; Bool_t fLogQuery;
TNtuple *fRatePoints; TNtuple *fRatePoints;
TGraph *fRateGraph; TGraph *fRateGraph;
Float_t fInitTime;
Float_t fProcTime; Float_t fProcTime;
Double_t fAvgRate; Double_t fAvgRate;
Double_t fAvgMBRate; Double_t fAvgMBRate;
Int_t fSVNRev; Int_t fSVNRev;
Int_t fRightInfo;
TString fSessionUrl; TString fSessionUrl;
...@@ -120,6 +124,8 @@ public: ...@@ -120,6 +124,8 @@ public:
void DoAsyn(); void DoAsyn();
void DoPlotRateGraph(); void DoPlotRateGraph();
void DoMemoryPlot(); void DoMemoryPlot();
void ToggleOdometerInfos();
void ToggleThreshold();
ClassDef(TProofProgressDialog,0) //PROOF progress dialog ClassDef(TProofProgressDialog,0) //PROOF progress dialog
}; };
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "TGTextBuffer.h" #include "TGTextBuffer.h"
#include "TGTextEntry.h" #include "TGTextEntry.h"
#include "TGProgressBar.h" #include "TGProgressBar.h"
#include "TGSpeedo.h"
#include "TProof.h" #include "TProof.h"
#include "TSlave.h" #include "TSlave.h"
#include "TSystem.h" #include "TSystem.h"
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
#include "TAxis.h" #include "TAxis.h"
#include "TPaveText.h" #include "TPaveText.h"
#include "TMath.h" #include "TMath.h"
#include "THLimitsFinder.h"
#ifdef PPD_SRV_NEWER #ifdef PPD_SRV_NEWER
#undef PPD_SRV_NEWER #undef PPD_SRV_NEWER
...@@ -80,9 +82,11 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -80,9 +82,11 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
fRatePoints = 0; fRatePoints = 0;
fRateGraph = 0; fRateGraph = 0;
fProcTime = 0.; fProcTime = 0.;
fInitTime = 0.;
fAvgRate = 0.; fAvgRate = 0.;
fAvgMBRate = 0.; fAvgMBRate = 0.;
fSVNRev = -1; fSVNRev = -1;
fRightInfo = 0;
// Make sure we are attached to a good instance // Make sure we are attached to a good instance
if (!proof || !(proof->IsValid())) { if (!proof || !(proof->IsValid())) {
...@@ -124,70 +128,114 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -124,70 +128,114 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
fDialog = new TGTransientFrame(0, 0, 10, 10); fDialog = new TGTransientFrame(0, 0, 10, 10);
fDialog->Connect("CloseWindow()", "TProofProgressDialog", this, "DoClose()"); fDialog->Connect("CloseWindow()", "TProofProgressDialog", this, "DoClose()");
fDialog->DontCallClose(); fDialog->DontCallClose();
fDialog->SetCleanup(kDeepCleanup);
//=======================================================================================
TGHorizontalFrame *hf4 = new TGHorizontalFrame(fDialog, 100, 100);
TGVerticalFrame *vf4 = new TGVerticalFrame(hf4, 100, 100);
// Title label // Title label
TString buf; TString buf;
buf = TString::Format("Executing on PROOF cluster \"%s\" with %d parallel workers:", buf = TString::Format("Executing on PROOF cluster \"%s\" with %d parallel workers:",
fProof ? fProof->GetMaster() : "<dummy>", fProof ? fProof->GetMaster() : "<dummy>",
fProof ? fProof->GetParallel() : 0); fProof ? fProof->GetParallel() : 0);
fTitleLab = new TGLabel(fDialog, buf), fTitleLab = new TGLabel(vf4, buf);
fDialog->AddFrame(fTitleLab, fTitleLab->SetTextJustify(kTextTop | kTextLeft);
new TGLayoutHints(kLHintsNormal, 10, 10, 20, 0)); vf4->AddFrame(fTitleLab, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
buf = TString::Format("Selector: %s", selector); buf = TString::Format("Selector: %s", selector);
fSelector = new TGLabel(fDialog, buf); fSelector = new TGLabel(vf4, buf);
fDialog->AddFrame(fSelector, fSelector->SetTextJustify(kTextTop | kTextLeft);
new TGLayoutHints(kLHintsNormal, 10, 10, 5, 0)); vf4->AddFrame(fSelector, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
buf = TString::Format("%d files, number of events %lld, starting event %lld", buf = TString::Format("%d files, number of events %lld, starting event %lld",
fFiles, fEntries, fFirst); fFiles, fEntries, fFirst);
fFilesEvents = new TGLabel(fDialog, buf); fFilesEvents = new TGLabel(vf4, buf);
fDialog->AddFrame(fFilesEvents, new TGLayoutHints(kLHintsNormal, 10, 10, 5, 0)); fFilesEvents->SetTextJustify(kTextTop | kTextLeft);
vf4->AddFrame(fFilesEvents, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
// Progress bar // Progress bar
fBar = new TGHProgressBar(fDialog, TGProgressBar::kFancy, 450); fBar = new TGHProgressBar(vf4, TGProgressBar::kFancy, 200);
fBar->SetBarColor("green"); fBar->SetBarColor("green");
fBar->UsePercent(); fBar->UsePercent();
fBar->ShowPos(kTRUE); fBar->ShowPos(kTRUE);
fDialog->AddFrame(fBar, new TGLayoutHints(kLHintsTop | kLHintsLeft | vf4->AddFrame(fBar, new TGLayoutHints(kLHintsTop | kLHintsLeft |
kLHintsExpandX, 10, 10, 20, 20)); kLHintsExpandX, 10, 10, 5, 5));
// Status labels // Status labels
if (PPD_SRV_NEWER(11)) { if (PPD_SRV_NEWER(11)) {
TGHorizontalFrame *hf0 = new TGHorizontalFrame(fDialog, 0, 0); TGHorizontalFrame *hf0 = new TGHorizontalFrame(vf4, 0, 0);
TGCompositeFrame *cf0 = new TGCompositeFrame(hf0, 110, 0, kFixedWidth); TGCompositeFrame *cf0 = new TGCompositeFrame(hf0, 110, 0, kFixedWidth);
cf0->AddFrame(new TGLabel(cf0, "Initialization time:")); cf0->AddFrame(new TGLabel(cf0, "Initialization time:"));
hf0->AddFrame(cf0); hf0->AddFrame(cf0);
fInit = new TGLabel(hf0, "- secs"); fInit = new TGLabel(hf0, "- secs");
hf0->AddFrame(fInit, new TGLayoutHints(kLHintsNormal, 10, 10, 0, 0)); fInit->SetTextJustify(kTextTop | kTextLeft);
fDialog->AddFrame(hf0, new TGLayoutHints(kLHintsNormal, 10, 10, 5, 0)); hf0->AddFrame(fInit, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
vf4->AddFrame(hf0, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
} }
TGHorizontalFrame *hf1 = new TGHorizontalFrame(fDialog, 0, 0); TGHorizontalFrame *hf1 = new TGHorizontalFrame(vf4, 0, 0);
TGCompositeFrame *cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth); TGCompositeFrame *cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth);
fProcessed = new TGLabel(cf1, "Estimated time left:"); cf1->AddFrame(new TGLabel(cf1, "Estimated time left:"));
cf1->AddFrame(fProcessed);
hf1->AddFrame(cf1); hf1->AddFrame(cf1);
fTotal= new TGLabel(hf1, "- sec (- events of - processed)"); fEstim = new TGLabel(hf1, "- sec");
hf1->AddFrame(fTotal, new TGLayoutHints(kLHintsNormal, 10, 10, 0, 0)); fEstim->SetTextJustify(kTextTop | kTextLeft);
fDialog->AddFrame(hf1, new TGLayoutHints(kLHintsNormal, 10, 10, 5, 0)); hf1->AddFrame(fEstim, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
vf4->AddFrame(hf1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
hf1 = new TGHorizontalFrame(vf4, 0, 0);
cf1 = new TGCompositeFrame(hf1, 110, 0, kFixedWidth);
fProcessed = new TGLabel(cf1, "Processing status:");
fProcessed->SetTextJustify(kTextTop | kTextLeft);
cf1->AddFrame(fProcessed, new TGLayoutHints(kLHintsLeft));
hf1->AddFrame(cf1);
fTotal= new TGLabel(hf1, "- / - events");
fTotal->SetTextJustify(kTextTop | kTextLeft);
hf1->AddFrame(fTotal, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
vf4->AddFrame(hf1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
TGHorizontalFrame *hf2 = new TGHorizontalFrame(fDialog, 0, 0); TGHorizontalFrame *hf2 = new TGHorizontalFrame(vf4, 0, 0);
TGCompositeFrame *cf2 = new TGCompositeFrame(hf2, 110, 0, kFixedWidth); TGCompositeFrame *cf2 = new TGCompositeFrame(hf2, 110, 0, kFixedWidth);
cf2->AddFrame(new TGLabel(cf2, "Processing rate:")); cf2->AddFrame(new TGLabel(cf2, "Processing rate:"));
hf2->AddFrame(cf2); hf2->AddFrame(cf2);
fRate = new TGLabel(hf2, "- events/sec"); fRate = new TGLabel(hf2, "- events/sec \n");
hf2->AddFrame(fRate, new TGLayoutHints(kLHintsNormal, 10, 10, 0, 0)); fRate->SetTextJustify(kTextTop | kTextLeft);
fDialog->AddFrame(hf2, new TGLayoutHints(kLHintsNormal, 10, 10, 5, 0)); hf2->AddFrame(fRate, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 0, 0));
vf4->AddFrame(hf2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 10, 10, 5, 0));
// Keep toggle button // Keep toggle button
fKeepToggle = new TGCheckButton(fDialog, fKeepToggle = new TGCheckButton(vf4,
new TGHotString("Close dialog when processing is complete")); new TGHotString("Close dialog when processing is complete"));
if (!fKeep) fKeepToggle->SetState(kButtonDown); if (!fKeep) fKeepToggle->SetState(kButtonDown);
fKeepToggle->Connect("Toggled(Bool_t)", fKeepToggle->Connect("Toggled(Bool_t)",
"TProofProgressDialog", this, "DoKeep(Bool_t)"); "TProofProgressDialog", this, "DoKeep(Bool_t)");
fDialog->AddFrame(fKeepToggle, new TGLayoutHints(kLHintsNormal, 10, 10, 20, 0)); vf4->AddFrame(fKeepToggle, new TGLayoutHints(kLHintsBottom, 10, 10, 10, 5));
hf4->AddFrame(vf4, new TGLayoutHints(kLHintsExpandY | kLHintsExpandX));
TGHorizontalFrame *hf51 = new TGHorizontalFrame(hf4, 20, 20);
fSpeedo = new TGSpeedo(hf51, 0.0, 1.0, "", " Ev/s");
fSpeedo->Connect("OdoClicked()", "TProofProgressDialog", this, "ToggleOdometerInfos()");
fSpeedo->Connect("LedClicked()", "TProofProgressDialog", this, "ToggleThreshold()");
hf51->AddFrame(fSpeedo);
fSpeedo->SetDisplayText("Init Time", "[ms]");
fSpeedo->EnablePeakMark();
fSpeedo->SetThresholds(0.0, 25.0, 50.0);
fSpeedo->SetThresholdColors(TGSpeedo::kRed, TGSpeedo::kOrange, TGSpeedo::kGreen);
fSpeedo->SetOdoValue(0);
fSpeedo->EnableMeanMark();
hf4->AddFrame(hf51, new TGLayoutHints(kLHintsBottom, 5, 5, 5, 5));
fDialog->AddFrame(hf4, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
//==========================================================================================
// Stop, cancel and close buttons // Stop, cancel and close buttons
TGHorizontalFrame *hf3 = new TGHorizontalFrame(fDialog, 60, 20, kFixedWidth); TGHorizontalFrame *hf3 = new TGHorizontalFrame(fDialog, 60, 20);
UInt_t nb1 = 0, width1 = 0, height1 = 0; UInt_t nb1 = 0, width1 = 0, height1 = 0;
...@@ -225,17 +273,14 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -225,17 +273,14 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
height1 = TMath::Max(height1, fClose->GetDefaultHeight()); height1 = TMath::Max(height1, fClose->GetDefaultHeight());
width1 = TMath::Max(width1, fClose->GetDefaultWidth()); ++nb1; width1 = TMath::Max(width1, fClose->GetDefaultWidth()); ++nb1;
fDialog->AddFrame(hf3, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX, 5, 5, 10, 5)); fDialog->AddFrame(hf3, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX, 5, 5, 5, 5));
UInt_t nb2 = 0, width2 = 0, height2 = 0; TGHorizontalFrame *hf5 = new TGHorizontalFrame(fDialog, 60, 20);
TGHorizontalFrame *hf5 = new TGHorizontalFrame(fDialog, 60, 20, kFixedWidth);
fLog = new TGTextButton(hf5, "&Show Logs"); fLog = new TGTextButton(hf5, "&Show Logs");
fLog->SetToolTipText("Show query log messages"); fLog->SetToolTipText("Show query log messages");
fLog->Connect("Clicked()", "TProofProgressDialog", this, "DoLog()"); fLog->Connect("Clicked()", "TProofProgressDialog", this, "DoLog()");
hf5->AddFrame(fLog, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0)); hf5->AddFrame(fLog, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
height2 = TMath::Max(height2, fLog->GetDefaultHeight());
width2 = TMath::Max(width2, fLog->GetDefaultWidth()); ++nb2;
if (PPD_SRV_NEWER(11)) { if (PPD_SRV_NEWER(11)) {
fRatePlot = new TGTextButton(hf5, "&Rate plot"); fRatePlot = new TGTextButton(hf5, "&Rate plot");
...@@ -243,18 +288,14 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -243,18 +288,14 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
fRatePlot->SetState(kButtonDisabled); fRatePlot->SetState(kButtonDisabled);
fRatePlot->Connect("Clicked()", "TProofProgressDialog", this, "DoPlotRateGraph()"); fRatePlot->Connect("Clicked()", "TProofProgressDialog", this, "DoPlotRateGraph()");
hf5->AddFrame(fRatePlot, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0)); hf5->AddFrame(fRatePlot, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
height2 = TMath::Max(height2, fRatePlot->GetDefaultHeight());
width2 = TMath::Max(width2, fRatePlot->GetDefaultWidth()); ++nb2;
} }
fMemPlot = new TGTextButton(hf5, "Memory Plot"); fMemPlot = new TGTextButton(hf5, "Memory Plot");
fMemPlot->Connect("Clicked()", "TProofProgressDialog", this, "DoMemoryPlot()"); fMemPlot->Connect("Clicked()", "TProofProgressDialog", this, "DoMemoryPlot()");
fMemPlot->SetToolTipText("Show memory consumption vs entry / merging phase"); fMemPlot->SetToolTipText("Show memory consumption vs entry / merging phase");
hf5->AddFrame(fMemPlot, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 10, 10, 0, 0)); hf5->AddFrame(fMemPlot, new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 7, 7, 0, 0));
height2 = TMath::Max(height2, fMemPlot->GetDefaultHeight());
width2 = TMath::Max(width2, fMemPlot->GetDefaultWidth()); ++nb2;
fDialog->AddFrame(hf5, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX, 5, 5, 10, 5)); fDialog->AddFrame(hf5, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX, 5, 5, 5, 5));
// Only enable if master supports it // Only enable if master supports it
if (!PPD_SRV_NEWER(18)) { if (!PPD_SRV_NEWER(18)) {
...@@ -266,12 +307,6 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -266,12 +307,6 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
fMemPlot->SetToolTipText("Show memory consumption"); fMemPlot->SetToolTipText("Show memory consumption");
} }
// Keep buttons centered and with the same width
UInt_t width, height, nb;
width = TMath::Max(width1, width2);
height = TMath::Max(height1, height2);
nb = TMath::Max(nb1, nb2);
// Connect slot to proof progress signal // Connect slot to proof progress signal
if (fProof) { if (fProof) {
fProof->Connect("Progress(Long64_t,Long64_t)", "TProofProgressDialog", fProof->Connect("Progress(Long64_t,Long64_t)", "TProofProgressDialog",
...@@ -301,12 +336,7 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -301,12 +336,7 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
// Map all widgets and calculate size of dialog // Map all widgets and calculate size of dialog
fDialog->MapSubwindows(); fDialog->MapSubwindows();
width = fDialog->GetDefaultWidth(); fDialog->Resize(fDialog->GetDefaultSize());
height = fDialog->GetDefaultHeight();
// To allow for lengthening of lines when the number are displayed
width += 100;
fDialog->Resize(width, height);
const TGWindow *main = gClient->GetRoot(); const TGWindow *main = gClient->GetRoot();
// Position relative to the parent window (which is the root window) // Position relative to the parent window (which is the root window)
...@@ -314,6 +344,8 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -314,6 +344,8 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
int ax, ay; int ax, ay;
Int_t mw = ((TGFrame *) main)->GetWidth(); Int_t mw = ((TGFrame *) main)->GetWidth();
Int_t mh = ((TGFrame *) main)->GetHeight(); Int_t mh = ((TGFrame *) main)->GetHeight();
Int_t width = fDialog->GetDefaultWidth();
Int_t height = fDialog->GetDefaultHeight();
gVirtualX->TranslateCoordinates(main->GetId(), main->GetId(), gVirtualX->TranslateCoordinates(main->GetId(), main->GetId(),
(mw - width), (mh - height) >> 1, ax, ay, wdum); (mw - width), (mh - height) >> 1, ax, ay, wdum);
...@@ -336,6 +368,36 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof, ...@@ -336,6 +368,36 @@ TProofProgressDialog::TProofProgressDialog(TProof *proof,
fStartTime = gSystem->Now(); fStartTime = gSystem->Now();
} }
//______________________________________________________________________________
void TProofProgressDialog::ToggleOdometerInfos()
{
// Toggle information displayed in Analog Meter
if (fRightInfo < 1)
fRightInfo++;
else
fRightInfo = 0;
if (fRightInfo == 0) {
fSpeedo->SetDisplayText("Init Time", "[ms]");
fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
}
else if (fRightInfo == 1) {
fSpeedo->SetDisplayText("Proc Time", "[ms]");
fSpeedo->SetOdoValue((Int_t)(fProcTime * 1000.0));
}
}
//______________________________________________________________________________
void TProofProgressDialog::ToggleThreshold()
{
if (fSpeedo->IsThresholdActive()) {
fSpeedo->DisableThreshold();
fSpeedo->Glow(TGSpeedo::kNoglow);
}
else
fSpeedo->EnableThreshold();
}
//______________________________________________________________________________ //______________________________________________________________________________
void TProofProgressDialog::ResetProgressDialog(const char *selec, void TProofProgressDialog::ResetProgressDialog(const char *selec,
Int_t files, Long64_t first, Int_t files, Long64_t first,
...@@ -470,9 +532,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed) ...@@ -470,9 +532,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed)
else else
sprintf(stm, "%d sec", ss); sprintf(stm, "%d sec", ss);
fProcessed->SetText("Processed:"); fProcessed->SetText("Processed:");
buf = TString::Format("%lld events in %s", total, stm); buf = TString::Format("%lld events in %s\n", total, stm);
fTotal->SetText(buf); fTotal->SetText(buf);
fEstim->SetText("0 sec");
if (fProof) { if (fProof) {
fProof->Disconnect("Progress(Long64_t,Long64_t)", this, fProof->Disconnect("Progress(Long64_t,Long64_t)", this,
"Progress(Long64_t,Long64_t)"); "Progress(Long64_t,Long64_t)");
...@@ -514,15 +578,15 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed) ...@@ -514,15 +578,15 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed)
sprintf(stm, "%d min %d sec", mm, ss); sprintf(stm, "%d min %d sec", mm, ss);
else else
sprintf(stm, "%d sec", ss); sprintf(stm, "%d sec", ss);
fEstim->SetText(stm);
buf = TString::Format("%lld / %lld events", evproc, total);
if (fStatus > kDone) { if (fStatus > kDone) {
buf = TString::Format("%s (%lld events of %lld processed) - %s", buf += TString::Format(" - %s", cproc[fStatus]);
stm, evproc, total, cproc[fStatus]);
} else {
buf = TString::Format("%s (%lld events of %lld processed)",
stm, evproc, total);
} }
fTotal->SetText(buf); fTotal->SetText(buf);
buf = TString::Format("%.1f events/sec", Float_t(evproc)/Long_t(tdiff)*1000.);
buf = TString::Format("%.1f events/sec\n", Float_t(evproc)/Long_t(tdiff)*1000.);
fRate->SetText(buf); fRate->SetText(buf);
if (processed < 0) { if (processed < 0) {
...@@ -537,8 +601,6 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed) ...@@ -537,8 +601,6 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed)
} }
} }
fPrevProcessed = evproc; fPrevProcessed = evproc;
fDialog->Layout();
} }
//______________________________________________________________________________ //______________________________________________________________________________
...@@ -550,6 +612,8 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -550,6 +612,8 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
// Update progress bar and status labels. // Update progress bar and status labels.
// Use "processed == total" or "processed < 0" to indicate end of processing. // Use "processed == total" or "processed < 0" to indicate end of processing.
Double_t BinLow, BinHigh;
Int_t nbins;
Long_t tt; Long_t tt;
UInt_t hh=0, mm=0, ss=0; UInt_t hh=0, mm=0, ss=0;
TString buf; TString buf;
...@@ -565,9 +629,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -565,9 +629,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
if (initTime >= 0.) { if (initTime >= 0.) {
// Set init time // Set init time
fInitTime = initTime;
buf = TString::Format("%.1f secs", initTime); buf = TString::Format("%.1f secs", initTime);
fInit->SetText(buf); fInit->SetText(buf);
fDialog->Layout(); if (fRightInfo == 0)
fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
} }
Bool_t over = kFALSE; Bool_t over = kFALSE;
...@@ -578,6 +644,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -578,6 +644,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
fPrevTotal = total; fPrevTotal = total;
} }
// Show proc time by default when switching from init to proc
if (processed > 0 && fPrevProcessed <= 0)
while (fRightInfo != 1)
ToggleOdometerInfos();
// Nothing to update // Nothing to update
if (fPrevProcessed == processed) if (fPrevProcessed == processed)
return; return;
...@@ -608,6 +679,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -608,6 +679,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
fAvgMBRate = mbsproc / procTime; fAvgMBRate = mbsproc / procTime;
} }
if (fRightInfo == 0)
fSpeedo->SetOdoValue((Int_t)(fInitTime * 1000.0));
else if (fRightInfo == 1)
fSpeedo->SetOdoValue((Int_t)(fProcTime * 1000.0));
if (over || (processed >= 0 && processed >= total)) { if (over || (processed >= 0 && processed >= total)) {
// A negative value for process indicates that we are finished, // A negative value for process indicates that we are finished,
...@@ -636,10 +712,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -636,10 +712,11 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
else else
sprintf(stm, "%d sec", ss); sprintf(stm, "%d sec", ss);
fProcessed->SetText("Processed:"); fProcessed->SetText("Processed:");
buf = TString::Format("%lld events (%.2f MBs) in %s %s", buf = TString::Format("%lld events (%.2f MB) in %s %s\n",
std::max(fPrevProcessed, processed), fAvgMBRate*fProcTime, stm, st.Data()); std::max(fPrevProcessed, processed), fAvgMBRate*fProcTime, stm, st.Data());
fTotal->SetText(buf); fTotal->SetText(buf);
buf = TString::Format("%.1f evts/sec (%.1f MBs/sec)", fAvgRate, fAvgMBRate); fEstim->SetText("0 sec");
buf = TString::Format("%.1f evts/sec (%.1f MB/sec)\n", fAvgRate, fAvgMBRate);
fRate->SetText(buf); fRate->SetText(buf);
// Fill rate graph // Fill rate graph
Bool_t useAvg = gEnv->GetValue("Proof.RatePlotUseAvg", 0); Bool_t useAvg = gEnv->GetValue("Proof.RatePlotUseAvg", 0);
...@@ -670,6 +747,10 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -670,6 +747,10 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
fStop->SetState(kButtonDisabled); fStop->SetState(kButtonDisabled);
fAbort->SetState(kButtonDisabled); fAbort->SetState(kButtonDisabled);
fClose->SetState(kButtonUp); fClose->SetState(kButtonUp);
fSpeedo->SetScaleValue(0, 0);
fSpeedo->Glow(TGSpeedo::kNoglow);
if (!fKeep) DoClose(); if (!fKeep) DoClose();
// Set the status to done // Set the status to done
...@@ -698,23 +779,31 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -698,23 +779,31 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
sprintf(stm, "%d min %d sec", mm, ss); sprintf(stm, "%d min %d sec", mm, ss);
else else
sprintf(stm, "%d sec", ss); sprintf(stm, "%d sec", ss);
fEstim->SetText(stm);
buf = TString::Format("%lld / %lld events - %.2f MB", evproc, total, mbsproc);
if (fStatus > kDone) { if (fStatus > kDone) {
buf = TString::Format("%s (processed %lld events out of %lld - %.2f MBs of data) - %s", buf += TString::Format(" - %s", cproc[fStatus]);
stm, evproc, total, mbsproc, cproc[fStatus]);
} else {
buf = TString::Format("%s (processed %lld events out of %lld - %.2f MBs of data)",
stm, evproc, total, mbsproc);
} }
fTotal->SetText(buf); fTotal->SetText(buf);
// Post // Post
if (evtrti > 0.) { if (evtrti > 0.) {
buf = TString::Format("%.1f evts/sec (%.1f MBs/sec) - avg: %.1f evts/sec (%.1f MBs/sec)", buf = TString::Format("%.1f evts/sec (%.1f MB/sec) \navg: %.1f evts/sec (%.1f MB/sec)",
evtrti, mbrti, fAvgRate, fAvgMBRate); evtrti, mbrti, fAvgRate, fAvgMBRate);
fRatePoints->Fill(procTime, evtrti, mbrti); fRatePoints->Fill(procTime, evtrti, mbrti);
fRatePlot->SetState(kButtonUp); fRatePlot->SetState(kButtonUp);
if (evtrti > fSpeedo->GetScaleMax()) {
nbins = 4;
BinLow = fSpeedo->GetScaleMin();
BinHigh = 1.5 * evtrti;
THLimitsFinder::OptimizeLimits(4, nbins, BinLow, BinHigh, kFALSE);
fSpeedo->SetMinMaxScale(fSpeedo->GetScaleMin(), BinHigh);
}
fSpeedo->SetScaleValue(evtrti, 0);
fSpeedo->SetMeanValue(fAvgRate);
} else { } else {
buf = TString::Format("avg: %.1f evts/sec (%.1f MBs/sec)", fAvgRate, fAvgMBRate); buf = TString::Format("avg: %.1f evts/sec (%.1f MB/sec)", fAvgRate, fAvgMBRate);
} }
fRate->SetText(buf); fRate->SetText(buf);
...@@ -725,13 +814,14 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed, ...@@ -725,13 +814,14 @@ void TProofProgressDialog::Progress(Long64_t total, Long64_t processed,
fAbort->SetState(kButtonDisabled); fAbort->SetState(kButtonDisabled);
fClose->SetState(kButtonUp); fClose->SetState(kButtonUp);
fSpeedo->SetScaleValue(0, 0);
fSpeedo->Glow(TGSpeedo::kNoglow);
// Set the status to done // Set the status to done
fStatus = kDone; fStatus = kDone;
} }
} }
fPrevProcessed = evproc; fPrevProcessed = evproc;
fDialog->Layout();
} }
//______________________________________________________________________________ //______________________________________________________________________________
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment