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) :
{
gErrorIgnoreLevel = kError;
fWatch = new TStopwatch;
ULong_t red;
ULong_t blue;
ULong_t black;
......@@ -595,6 +597,8 @@ void GuiBuildTree::ProcessRun(int RunIndex)
rootmaster->Add<ADHitTree>("HitTree","Branch on hits");
}
gFile->SetCompressionLevel(0);
fCurrentFileName = rootmaster->GetTree()->GetCurrentFile()->GetName();
fBashColor->SetInfoOut();
......@@ -647,6 +651,7 @@ void GuiBuildTree::Start()
return;
}
IsProcessing = true;
gROOT->SetBatch(true);
DisableEntries();
......@@ -658,12 +663,22 @@ void GuiBuildTree::Start()
for (uint i=0 ; i<NFiles ; i++)
{
if(IsProcessing)
{
fWatch->Start();
ProcessRun(i);
fWatch->Stop();
cout<<"GuiBuildTree timer:"<<endl;
fWatch->Print();
cout << " --> Reading rate " << femulator->GetBytesRead() / (1024*1024*fWatch->RealTime()) << " MB/s"<< endl ;
}
}
EnableEntries();
IsProcessing = false;
gROOT->SetBatch(false);
}
......@@ -672,7 +687,14 @@ void GuiBuildTree::Stop()
if(IsProcessing)
{
femulator->Stop();
fWatch->Stop();
cout<<"GuiBuildTree timer:"<<endl;
fWatch->Print();
cout << " --> Reading rate " << femulator->GetBytesRead() / (1024*1024*fWatch->RealTime()) << " MB/s"<< endl ;
IsProcessing = false;
gROOT->SetBatch(false);
}
else
{
......
......@@ -20,6 +20,7 @@
#include "RQ_OBJECT.h"
#include "TGSplitter.h"
#include "TGListBox.h"
#include "TStopwatch.h"
#include "ADFLogMessage.h"
......@@ -117,6 +118,7 @@ class GuiBuildTree : public TGMainFrame
TGNumberEntry *fNEAGATAOffset;
TGNumberEntry *fVertexBetaNE;
TStopwatch *fWatch;
bool fShowAllADF;
......
......@@ -58,7 +58,7 @@ using namespace __LoadTree__ ;
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
CompOpt = comp_opt;
......
......@@ -214,7 +214,9 @@ private:
private:
std::string fPathProd;
std::string fPathCons;
bool floopon;
bool floopon;
Int_t fBytesRead;
public:
EmulatorPC(const char *path, UInt_t bsize = aMByte);
......@@ -246,6 +248,8 @@ public:
virtual Bool_t Run(UInt_t max_loop = kMaxUInt_t);
virtual void Stop();
Int_t GetBytesRead(){return fBytesRead;}
};
template <typename Prod_actor, typename Cons_actor>
......@@ -256,7 +260,8 @@ EmulatorPC<Prod_actor,Cons_actor>::EmulatorPC(const char *path, UInt_t bsize):
fConsumer(0x0),
fBProd(bsize),
fPathProd(path),
fPathCons(path)
fPathCons(path),
fBytesRead(0)
{
}
......@@ -324,6 +329,8 @@ template <typename Prod_actor, typename Cons_actor>
Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop)
{
floopon=true;
fBytesRead=0;
printf("\n*********** EMULATOR MAIN LOOP : START ... \n\n");
// loop on events
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)
int Prodstatus = fProducer->ProcessBlock(fBProd);
int ProdSize = fBProd.GetSize();
// cout<<"Loop Nbr "<<nb_loop<<endl;
// cout<<"Producer status = "<<Prodstatus<<endl;
// cout<<"Producer size = "<<ProdSize<<endl;
fBytesRead += ProdSize;
if ( ProdSize == 0u && Prodstatus ==0) {
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)
int ConsStatus = fConsumer->ProcessBlock(fBProd);
// cout<<"Consumer status = "<<ConsStatus<<endl;
if(Prodstatus != 0 || ConsStatus != 0u) break;
nb_loop++;
......@@ -375,7 +378,6 @@ Bool_t EmulatorPC<Prod_actor,Cons_actor>::Run(UInt_t max_loop)
ec->Print();
}
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