Skip to content

Commit

Permalink
Merge pull request #30 from cms-nanoAOD/memoryIssue
Browse files Browse the repository at this point in the history
add autoflush options, default -10MB
  • Loading branch information
gpetruc committed Oct 3, 2017
2 parents a8aba11 + 53674c0 commit 54ccc00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PhysicsTools/NanoAOD/plugins/NanoAODOutputModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class NanoAODOutputModule : public edm::one::OutputModule<> {
std::string m_compressionAlgorithm;
bool m_writeProvenance;
bool m_fakeName; //crab workaround, remove after crab is fixed
int m_autoFlush;
edm::ProcessHistoryRegistry m_processHistoryRegistry;
edm::JobReport::Token m_jrToken;
std::unique_ptr<TFile> m_file;
Expand Down Expand Up @@ -139,6 +140,7 @@ NanoAODOutputModule::NanoAODOutputModule(edm::ParameterSet const& pset):
m_compressionAlgorithm(pset.getUntrackedParameter<std::string>("compressionAlgorithm")),
m_writeProvenance(pset.getUntrackedParameter<bool>("saveProvenance", true)),
m_fakeName(pset.getUntrackedParameter<bool>("fakeNameForCrab", false)),
m_autoFlush(pset.getUntrackedParameter<int>("autoFlush", -10000000)),
m_processHistoryRegistry()
{
}
Expand Down Expand Up @@ -258,6 +260,7 @@ NanoAODOutputModule::openFile(edm::FileBlock const&) {
// create the trees
m_tree.reset(new TTree("Events","Events"));
m_tree->SetAutoSave(std::numeric_limits<Long64_t>::max());
m_tree->SetAutoFlush(m_autoFlush);
m_commonBranches.branch(*m_tree);

m_lumiTree.reset(new TTree("LuminosityBlocks","LuminosityBlocks"));
Expand Down

0 comments on commit 54ccc00

Please sign in to comment.