Public Member Functions | |
BlockWipedAllocatorService (const edm::ParameterSet &iConfig, edm::ActivityRegistry &iAR) | |
void | dump () |
void | postEndJob () |
void | postModule (const edm::ModuleDescription &desc) |
void | preEventProcessing (const edm::EventID &, const edm::Timestamp &) |
void | preModule (const edm::ModuleDescription &desc) |
void | preSource () |
void | wiper () |
Private Attributes | |
int | m_clearFreq |
bool | m_dump |
bool | m_silent |
bool | m_useAlloc |
BlockWipedPool | pool |
manage the allocator
Definition at line 32 of file BlockWipedAllocatorService.cc.
BlockWipedAllocatorService::BlockWipedAllocatorService | ( | const edm::ParameterSet & | iConfig, |
edm::ActivityRegistry & | iAR | ||
) | [inline] |
Definition at line 40 of file BlockWipedAllocatorService.cc.
References blockWipedPool(), edm::ParameterSet::getUntrackedParameter(), m_clearFreq, m_dump, m_silent, m_useAlloc, max(), pool, postEndJob(), postModule(), preEventProcessing(), preModule(), preSource(), BlockWipedPoolAllocated::usePool(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPreModule(), edm::ActivityRegistry::watchPreProcessEvent(), and edm::ActivityRegistry::watchPreSource().
: pool( std::max(256,iConfig.getUntrackedParameter<int>("blockSize",1024)), std::max(256,iConfig.getUntrackedParameter<int>("recyclerSize",4096)) ) { m_useAlloc = iConfig.getUntrackedParameter<bool>("usePoolAllocator",false); m_silent = iConfig.getUntrackedParameter<bool>("silent",true); m_dump = iConfig.getUntrackedParameter<bool>("dumpEachModule",false); m_clearFreq = std::max(1,iConfig.getUntrackedParameter<int>("clearFrequency",20)); blockWipedPool(&pool); if (m_useAlloc) BlockWipedPoolAllocated::usePool(); iAR.watchPreSource(this,&BlockWipedAllocatorService::preSource); iAR.watchPreProcessEvent(this,&BlockWipedAllocatorService::preEventProcessing); iAR.watchPostEndJob(this,&BlockWipedAllocatorService::postEndJob); iAR.watchPreModule(this,&BlockWipedAllocatorService::preModule); iAR.watchPostModule(this,&BlockWipedAllocatorService::postModule); }
void BlockWipedAllocatorService::dump | ( | void | ) | [inline] |
Definition at line 68 of file BlockWipedAllocatorService.cc.
References blockWipedPool(), gather_cfg::cout, m_silent, BlockWipedPoolAllocated::s_alive, ReferenceCountedPoolAllocated::s_alive, ReferenceCountedPoolAllocated::s_referenced, and BlockWipedPool::visit().
Referenced by postModule(), and wiper().
{ if (m_silent) return; std::cout << "ReferenceCounted stat"<< std::endl; std::cout << "still alive/referenced " << ReferenceCountedPoolAllocated::s_alive << "/" << ReferenceCountedPoolAllocated::s_referenced << std::endl; std::cout << "BlockAllocator stat"<< std::endl; std::cout << "still alive " << BlockWipedPoolAllocated::s_alive << std::endl; Dumper dumper; blockWipedPool().visit(dumper); }
void BlockWipedAllocatorService::postEndJob | ( | ) | [inline] |
Definition at line 108 of file BlockWipedAllocatorService.cc.
References wiper().
Referenced by BlockWipedAllocatorService().
{ wiper(); }
void BlockWipedAllocatorService::postModule | ( | const edm::ModuleDescription & | desc | ) | [inline] |
Definition at line 103 of file BlockWipedAllocatorService.cc.
References dump(), and m_dump.
Referenced by BlockWipedAllocatorService().
void BlockWipedAllocatorService::preEventProcessing | ( | const edm::EventID & | , |
const edm::Timestamp & | |||
) | [inline] |
Definition at line 61 of file BlockWipedAllocatorService.cc.
References wiper().
Referenced by BlockWipedAllocatorService().
{ wiper();}
void BlockWipedAllocatorService::preModule | ( | const edm::ModuleDescription & | desc | ) | [inline] |
Definition at line 99 of file BlockWipedAllocatorService.cc.
References blockWipedPool(), and BlockWipedPool::wipe().
Referenced by BlockWipedAllocatorService().
{ blockWipedPool().wipe(false); }
void BlockWipedAllocatorService::preSource | ( | ) | [inline] |
Definition at line 64 of file BlockWipedAllocatorService.cc.
Referenced by BlockWipedAllocatorService().
{
// wiper();
}
void BlockWipedAllocatorService::wiper | ( | ) | [inline] |
Definition at line 83 of file BlockWipedAllocatorService.cc.
References blockWipedPool(), trackerHits::c, BlockWipedPool::clear(), dump(), m_clearFreq, and BlockWipedPool::wipe().
Referenced by postEndJob(), and preEventProcessing().
{ dump(); blockWipedPool().wipe(); // blockWipedPool().clear(); // try to crash { static int c=0; c++; if (m_clearFreq==c) { blockWipedPool().clear(); c=0; } } }
int BlockWipedAllocatorService::m_clearFreq [private] |
Definition at line 37 of file BlockWipedAllocatorService.cc.
Referenced by BlockWipedAllocatorService(), and wiper().
bool BlockWipedAllocatorService::m_dump [private] |
Definition at line 36 of file BlockWipedAllocatorService.cc.
Referenced by BlockWipedAllocatorService(), and postModule().
bool BlockWipedAllocatorService::m_silent [private] |
Definition at line 35 of file BlockWipedAllocatorService.cc.
Referenced by BlockWipedAllocatorService(), and dump().
bool BlockWipedAllocatorService::m_useAlloc [private] |
Definition at line 34 of file BlockWipedAllocatorService.cc.
Referenced by BlockWipedAllocatorService().
Definition at line 38 of file BlockWipedAllocatorService.cc.
Referenced by BlockWipedAllocatorService().