Commit 17ae7f43 authored by J.Dudouet [IPNL/CSNSM]'s avatar J.Dudouet [IPNL/CSNSM]
Browse files

Setting The tree generation in batch mode to boost the code

Adding a TStopWatch in the GuiBuildTree
Adding an output of the bytes read in the Emulator
Setting the default compilation of the watchers in optimized ("+O")


git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2262 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent d9633a85
...@@ -43,6 +43,8 @@ GuiBuildTree::GuiBuildTree(const TGWindow *p, UInt_t w, UInt_t h) : ...@@ -43,6 +43,8 @@ GuiBuildTree::GuiBuildTree(const TGWindow *p, UInt_t w, UInt_t h) :
{ {
gErrorIgnoreLevel = kError; gErrorIgnoreLevel = kError;
fWatch = new TStopwatch;
ULong_t red; ULong_t red;
ULong_t blue; ULong_t blue;
ULong_t black; ULong_t black;
...@@ -595,6 +597,8 @@ void GuiBuildTree::ProcessRun(int RunIndex) ...@@ -595,6 +597,8 @@ void GuiBuildTree::ProcessRun(int RunIndex)
rootmaster->Add<ADHitTree>("HitTree","Branch on hits"); rootmaster->Add<ADHitTree>("HitTree","Branch on hits");
} }
gFile->SetCompressionLevel(0);
fCurrentFileName = rootmaster->GetTree()->GetCurrentFile()->GetName(); fCurrentFileName = rootmaster->GetTree()->GetCurrentFile()->GetName();
fBashColor->SetInfoOut(); fBashColor->SetInfoOut();
...@@ -647,6 +651,7 @@ void GuiBuildTree::Start() ...@@ -647,6 +651,7 @@ void GuiBuildTree::Start()
return; return;
} }
IsProcessing = true; IsProcessing = true;
gROOT->SetBatch(true);
DisableEntries(); DisableEntries();
...@@ -658,12 +663,22 @@ void GuiBuildTree::Start() ...@@ -658,12 +663,22 @@ void GuiBuildTree::Start()
for (uint i=0 ; i<NFiles ; i++) for (uint i=0 ; i<NFiles ; i++)
{ {
if(IsProcessing) if(IsProcessing)
{
fWatch->Start();
ProcessRun(i); ProcessRun(i);
fWatch->Stop();
cout<<"GuiBuildTree timer:"<<endl;
fWatch->Print();
cout << " --> Reading rate " << femulator->GetBytesRead() / (1024*1024*fWatch->RealTime()) << " MB/s"<< endl ;
}
} }
EnableEntries(); EnableEntries();
IsProcessing = false; IsProcessing = false;
gROOT->SetBatch(false);
} }
...@@ -672,7 +687,14 @@ void GuiBuildTree::Stop() ...@@ -672,7 +687,14 @@ void GuiBuildTree::Stop()
if(IsProcessing) if(IsProcessing)
{ {
femulator->Stop(); femulator->Stop();
fWatch->Stop();
cout<<"GuiBuildTree timer:"<<endl;
fWatch->Print();
cout << " --> Reading rate " << femulator->GetBytesRead() / (1024*1024*fWatch->RealTime()) << " MB/s"<< endl ;
IsProcessing = false; IsProcessing = false;
gROOT->SetBatch(false);
} }
else else
{ {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "RQ_OBJECT.h" #include "RQ_OBJECT.h"
#include "TGSplitter.h" #include "TGSplitter.h"
#include "TGListBox.h" #include "TGListBox.h"
#include "TStopwatch.h"
#include "ADFLogMessage.h" #include "ADFLogMessage.h"
...@@ -117,6 +118,7 @@ class GuiBuildTree : public TGMainFrame ...@@ -117,6 +118,7 @@ class GuiBuildTree : public TGMainFrame
TGNumberEntry *fNEAGATAOffset; TGNumberEntry *fNEAGATAOffset;
TGNumberEntry *fVertexBetaNE; TGNumberEntry *fVertexBetaNE;
TStopwatch *fWatch;
bool fShowAllADF; bool fShowAllADF;
......
...@@ -58,7 +58,7 @@ using namespace __LoadTree__ ; ...@@ -58,7 +58,7 @@ using namespace __LoadTree__ ;
O. Stézowski O. Stézowski
*/ */
void LoadBuildTree(const Char_t *comp_opt = "g") void LoadBuildTree(const Char_t *comp_opt = "O")
{ {
// // to modify to Aclic compilation's options + to force re-compilation, g for debugging // // to modify to Aclic compilation's options + to force re-compilation, g for debugging
CompOpt = comp_opt; CompOpt = comp_opt;
......
...@@ -214,7 +214,9 @@ private: ...@@ -214,7 +214,9 @@ private:
private: private:
std::string fPathProd; std::string fPathProd;
std::string fPathCons; std::string fPathCons;
bool floopon;
bool floopon;
Int_t fBytesRead;
public: public:
EmulatorPC(const char *path, UInt_t bsize = aMByte); EmulatorPC(const char *path, UInt_t bsize = aMByte);
...@@ -246,6 +248,8 @@ public: ...@@ -246,6 +248,8 @@ public:
virtual Bool_t Run(UInt_t max_loop = kMaxUInt_t); virtual Bool_t Run(UInt_t max_loop = kMaxUInt_t);
virtual void Stop(); virtual void Stop();
Int_t GetBytesRead(){return fBytesRead;}
}; };
template <typename Prod_actor, typename Cons_actor> template <typename Prod_actor, typename Cons_actor>
...@@ -256,7 +260,8 @@ EmulatorPC<Prod_actor,Cons_actor>::EmulatorPC(const char *path, UInt_t bsize): ...@@ -256,7 +260,8 @@ EmulatorPC<Prod_actor,Cons_actor>::EmulatorPC(const char *path, UInt_t bsize):
fConsumer(0x0), fConsumer(0x0),
fBProd(bsize), fBProd(bsize),
fPathProd(path), fPathProd(path),
fPathCons(path) fPathCons(path),
fBytesRead(0)
{ {
} }
...@@ -324,6 +329,8 @@ template <typename Prod_actor, typename Cons_actor> ...@@ -324,6 +329,8 @@ template <typename Prod_actor, typename Cons_actor>
Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop) Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop)
{ {
floopon=true; floopon=true;
fBytesRead=0;
printf("\n*********** EMULATOR MAIN LOOP : START ... \n\n"); printf("\n*********** EMULATOR MAIN LOOP : START ... \n\n");
// loop on events // loop on events
UInt_t nb_loop = 0u, err = 0u, nb_try = 0; UInt_t nb_loop = 0u, err = 0u, nb_try = 0;
...@@ -334,9 +341,7 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop) ...@@ -334,9 +341,7 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop)
int Prodstatus = fProducer->ProcessBlock(fBProd); int Prodstatus = fProducer->ProcessBlock(fBProd);
int ProdSize = fBProd.GetSize(); int ProdSize = fBProd.GetSize();
// cout<<"Loop Nbr "<<nb_loop<<endl; fBytesRead += ProdSize;
// cout<<"Producer status = "<<Prodstatus<<endl;
// cout<<"Producer size = "<<ProdSize<<endl;
if ( ProdSize == 0u && Prodstatus ==0) { if ( ProdSize == 0u && Prodstatus ==0) {
if ( nb_try > 1 ) { // up to XX tries of consecutive empty output before stooping if ( nb_try > 1 ) { // up to XX tries of consecutive empty output before stooping
...@@ -351,8 +356,6 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop) ...@@ -351,8 +356,6 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop)
int ConsStatus = fConsumer->ProcessBlock(fBProd); int ConsStatus = fConsumer->ProcessBlock(fBProd);
// cout<<"Consumer status = "<<ConsStatus<<endl;
if(Prodstatus != 0 || ConsStatus != 0u) break; if(Prodstatus != 0 || ConsStatus != 0u) break;
nb_loop++; nb_loop++;
...@@ -375,7 +378,6 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop) ...@@ -375,7 +378,6 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop)
ec->Print(); ec->Print();
} }
return true; return true;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment