From a8b0468ffe6e1f14814186356b0cc58b4a52bd41 Mon Sep 17 00:00:00 2001 From: cvetan Date: Wed, 4 Jun 2008 16:34:44 +0000 Subject: [PATCH] Changing the default basket size to 32KB and adding an option to the alimdc API which can be used run-time in order to change this size. To be propagated also to v4-13-Release. --- RAW/AliMDC.cxx | 4 +++- RAW/AliMDC.h | 6 ++++-- RAW/AliRawDB.cxx | 13 +++++++------ RAW/AliRawDB.h | 7 +++++-- RAW/alimdc_main.cxx | 3 ++- RAW/mdc.cxx | 6 ++++-- RAW/mdc.h | 3 ++- 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/RAW/AliMDC.cxx b/RAW/AliMDC.cxx index ac0e3a8e5bd..30e25c394d9 100644 --- a/RAW/AliMDC.cxx +++ b/RAW/AliMDC.cxx @@ -87,7 +87,8 @@ const char* const AliMDC::fgkFilterName[kNFilters] = {"AliHoughFilter"}; //______________________________________________________________________________ AliMDC::AliMDC(Int_t compress, Bool_t deleteFiles, EFilterMode filterMode, Double_t maxSizeTagDB, const char* fileNameTagDB, - const char *guidFileFolder) : + const char *guidFileFolder, + Int_t basketsize) : fEvent(new AliRawEvent), fESD(NULL), fStats(NULL), @@ -95,6 +96,7 @@ AliMDC::AliMDC(Int_t compress, Bool_t deleteFiles, EFilterMode filterMode, fTagDB(NULL), fEventTag(new AliRawEventTag), fCompress(compress), + fBasketSize(basketsize), fDeleteFiles(deleteFiles), fFilterMode(filterMode), fFilters(), diff --git a/RAW/AliMDC.h b/RAW/AliMDC.h index 5a776a5bc58..e12ddd0b9d5 100644 --- a/RAW/AliMDC.h +++ b/RAW/AliMDC.h @@ -64,7 +64,8 @@ public: AliMDC(Int_t compress, Bool_t deleteFiles, EFilterMode filterMode = kFilterTransparent, Double_t maxSizeTagDB = -1, const char* fileNameTagDB = NULL, - const char* guidFileFolder = NULL); + const char* guidFileFolder = NULL, + Int_t basketsize = 32000); virtual ~AliMDC(); Int_t Open(EWriteMode mode, const char* fileName, @@ -103,6 +104,7 @@ private: AliTagDB *fTagDB; // tag DB AliRawEventTag *fEventTag; // raw-data event tag object Int_t fCompress; // compression factor used for raw output DB + Int_t fBasketSize; // root i/o basket size (default = 32000) Bool_t fDeleteFiles; // flag for deletion of files EFilterMode fFilterMode; // high level filter mode TObjArray fFilters; // filter algorithms @@ -125,7 +127,7 @@ private: Bool_t isSwapped, char*& data); Int_t ReadRawData(AliRawData &raw, Int_t size, char*& data); - ClassDef(AliMDC,2) // MDC processor + ClassDef(AliMDC,3) // MDC processor }; #endif diff --git a/RAW/AliRawDB.cxx b/RAW/AliRawDB.cxx index b0abd58e8e6..825a4454d6d 100644 --- a/RAW/AliRawDB.cxx +++ b/RAW/AliRawDB.cxx @@ -59,13 +59,15 @@ Int_t AliRawDB::fgkDetBranches[AliDAQ::kNDetectors+1] = {1,1,1,18,1,1,1,1,1,1,1, AliRawDB::AliRawDB(AliRawEvent *event, AliESDEvent *esd, Int_t compress, - const char* fileName) : + const char* fileName, + Int_t basketsize) : fRawDB(NULL), fTree(NULL), fEvent(event), fESDTree(NULL), fESD(esd), fCompress(compress), + fBasketSize(basketsize), fMaxSize(-1), fFS1(""), fFS2(""), @@ -271,22 +273,21 @@ void AliRawDB::MakeTree() fTree->BranchRef(); - Int_t bufsize = 256000; // splitting 29.6 MB/s, no splitting 35.3 MB/s on P4 2GHz 15k SCSI //Int_t split = 1; Int_t split = 0; - fTree->Branch("rawevent", "AliRawEvent", &fEvent, bufsize, split); + fTree->Branch("rawevent", "AliRawEvent", &fEvent, fBasketSize, split); // Make brach for each sub-detector for (Int_t iDet = 0; iDet < AliDAQ::kNDetectors; iDet++) { for (Int_t iBranch = 0; iBranch < fgkDetBranches[iDet]; iBranch++) fTree->Branch(Form("%s%d",AliDAQ::DetectorName(iDet),iBranch),"AliRawDataArray", - &fDetRawData[iDet][iBranch],bufsize,split); + &fDetRawData[iDet][iBranch],fBasketSize,split); } // Make special branch for unrecognized raw-data payloads for (Int_t iBranch = 0; iBranch < fgkDetBranches[AliDAQ::kNDetectors]; iBranch++) fTree->Branch(Form("Common%d",iBranch),"AliRawDataArray", - &fDetRawData[AliDAQ::kNDetectors][iBranch],bufsize,split); + &fDetRawData[AliDAQ::kNDetectors][iBranch],fBasketSize,split); // Create tree which will contain the HLT ESD information @@ -294,7 +295,7 @@ void AliRawDB::MakeTree() fESDTree = new TTree("esdTree", Form("ALICE HLT ESD tree (%s)", GetAliRootTag())); fESDTree->SetAutoSave(21000000000LL); // autosave when 21 Gbyte written split = 0; - fESDTree->Branch("ESD", "AliESDEvent", &fESD, bufsize, split); + fESDTree->Branch("ESD", "AliESDEvent", &fESD, fBasketSize, split); } } diff --git a/RAW/AliRawDB.h b/RAW/AliRawDB.h index e4bf9ca0714..633b99413e4 100644 --- a/RAW/AliRawDB.h +++ b/RAW/AliRawDB.h @@ -43,7 +43,8 @@ public: AliRawDB(AliRawEvent *event, AliESDEvent *esd, Int_t compress, - const char* fileName = NULL); + const char* fileName = NULL, + Int_t basketsize = 32000); virtual ~AliRawDB(); virtual const char *GetOpenOption() const { return "RECREATE"; } @@ -69,6 +70,7 @@ public: AliRawEvent *GetEvent() const { return fEvent; } Float_t GetCompressionFactor() const; Int_t GetCompressionMode() const { return fRawDB->GetCompressionLevel(); } + Int_t GetBasketSize() const { return fBasketSize; } void Stop() { fStop = kTRUE; } static const char *GetAliRootTag(); Bool_t WriteGuidFile(TString &guidFileFolder); @@ -81,6 +83,7 @@ protected: TTree *fESDTree; // tree for storing HLT ESD information AliESDEvent *fESD; // pointer to HLT ESD object Int_t fCompress; // compression mode (1 default) + Int_t fBasketSize; // root i/o basket size (default = 32000) Double_t fMaxSize; // maximum size in bytes of the raw DB TString fFS1; // first raw DB file system location TString fFS2; // second raw DB file system location @@ -98,7 +101,7 @@ private: AliRawDB(const AliRawDB& rawDB); AliRawDB& operator = (const AliRawDB& rawDB); - ClassDef(AliRawDB,3) // Raw DB + ClassDef(AliRawDB,4) // Raw DB }; #endif diff --git a/RAW/alimdc_main.cxx b/RAW/alimdc_main.cxx index 846ca09c64c..c6b1dc2b1f7 100644 --- a/RAW/alimdc_main.cxx +++ b/RAW/alimdc_main.cxx @@ -269,9 +269,10 @@ int main(int argc, char **argv) } } + Int_t basketsize = 32000; // Create MDC processor object and process input stream AliMDC mdcproc(compress, delFiles, AliMDC::EFilterMode(filterMode), - maxTagSize, tagDBFS); + maxTagSize, tagDBFS,NULL,basketsize); Int_t result = mdcproc.Run(file, useLoop, wmode, maxFileSize, fs1, fs2); diff --git a/RAW/mdc.cxx b/RAW/mdc.cxx index 46aa4d1fdf8..8223f466337 100644 --- a/RAW/mdc.cxx +++ b/RAW/mdc.cxx @@ -27,13 +27,15 @@ void* alimdcCreate(int compress, int filterMode, double maxSizeTagDB, const char* fileNameTagDB, - const char* guidFileFolder) + const char* guidFileFolder, + int basketsize) { // create an AliMDC object return new AliMDC(compress, kFALSE, AliMDC::EFilterMode(filterMode), maxSizeTagDB, fileNameTagDB, - guidFileFolder); + guidFileFolder, + basketsize); } diff --git a/RAW/mdc.h b/RAW/mdc.h index 872fa498939..bb6d50d5f56 100644 --- a/RAW/mdc.h +++ b/RAW/mdc.h @@ -17,7 +17,8 @@ extern "C" { void* alimdcCreate(int compress, int filterMode, double maxSizeTagDB, const char* fileNameTagDB, - const char* guidFileFolder); + const char* guidFileFolder, + int basketsize); int alimdcOpen(void* alimdc, int mode, const char* fileName); int alimdcProcessEvent(void* alimdc, void* event, int isIovecArray); long long alimdcGetTotalFileSize(void* alimdc); -- 2.39.3