CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
BlockWipedAllocatorService Class Reference

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_useAlloc
 

Detailed Description

manage the allocator

Definition at line 32 of file BlockWipedAllocatorService.cc.

Constructor & Destructor Documentation

BlockWipedAllocatorService::BlockWipedAllocatorService ( const edm::ParameterSet iConfig,
edm::ActivityRegistry iAR 
)
inline

Definition at line 38 of file BlockWipedAllocatorService.cc.

References edm::ParameterSet::getUntrackedParameter(), m_clearFreq, m_dump, m_useAlloc, max(), postEndJob(), postModule(), preEventProcessing(), preModule(), preSource(), BlockWipedPoolAllocated::usePool(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPreModule(), edm::ActivityRegistry::watchPreProcessEvent(), and edm::ActivityRegistry::watchPreSource().

39  {
40 
41  m_useAlloc = iConfig.getUntrackedParameter<bool>("usePoolAllocator",false);
42  m_dump = iConfig.getUntrackedParameter<bool>("dumpEachModule",false);
43  m_clearFreq = std::max(1,iConfig.getUntrackedParameter<int>("clearFrequency",20));
44 
51  }
T getUntrackedParameter(std::string const &, T const &) const
void preModule(const edm::ModuleDescription &desc)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void watchPostModule(PostModule::slot_type const &iSlot)
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
void watchPreModule(PreModule::slot_type const &iSlot)
void preEventProcessing(const edm::EventID &, const edm::Timestamp &)
const T & max(const T &a, const T &b)
void watchPreSource(PreSource::slot_type const &iSlot)
void postModule(const edm::ModuleDescription &desc)

Member Function Documentation

void BlockWipedAllocatorService::dump ( void  )
inline

Definition at line 61 of file BlockWipedAllocatorService.cc.

References blockWipedPool(), gather_cfg::cout, ReferenceCountedPoolAllocated::s_alive, BlockWipedPoolAllocated::s_alive, ReferenceCountedPoolAllocated::s_referenced, and BlockWipedPool::visit().

Referenced by postModule(), and wiper().

61  {
62  std::cout << "ReferenceCounted stat"<< std::endl;
63  std::cout << "still alive/referenced "
66  << std::endl;
67 
68  std::cout << "BlockAllocator stat"<< std::endl;
69  std::cout << "still alive " << BlockWipedPoolAllocated::s_alive << std::endl;
70  Dumper dumper;
71  blockWipedPool().visit(dumper);
72  }
BlockWipedPool & blockWipedPool()
void visit(Visitor &visitor) const
tuple cout
Definition: gather_cfg.py:41
void BlockWipedAllocatorService::postEndJob ( )
inline

Definition at line 100 of file BlockWipedAllocatorService.cc.

References wiper().

Referenced by BlockWipedAllocatorService().

100  {
101  wiper();
102  }
void BlockWipedAllocatorService::postModule ( const edm::ModuleDescription desc)
inline

Definition at line 95 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 54 of file BlockWipedAllocatorService.cc.

References wiper().

Referenced by BlockWipedAllocatorService().

void BlockWipedAllocatorService::preModule ( const edm::ModuleDescription desc)
inline

Definition at line 91 of file BlockWipedAllocatorService.cc.

Referenced by BlockWipedAllocatorService().

91  {
92  // blockWipedPool().wipe();
93  }
void BlockWipedAllocatorService::preSource ( )
inline

Definition at line 57 of file BlockWipedAllocatorService.cc.

Referenced by BlockWipedAllocatorService().

57  {
58  // wiper();
59  }
void BlockWipedAllocatorService::wiper ( )
inline

Definition at line 75 of file BlockWipedAllocatorService.cc.

References blockWipedPool(), trackerHits::c, BlockWipedPool::clear(), dump(), m_clearFreq, and BlockWipedPool::wipe().

Referenced by postEndJob(), and preEventProcessing().

75  {
76  dump();
77  blockWipedPool().wipe();
78  // blockWipedPool().clear(); // try to crash
79  {
80  static int c=0;
81  c++;
82  if (m_clearFreq==c) {
84  c=0;
85  }
86  }
87 
88  }
BlockWipedPool & blockWipedPool()

Member Data Documentation

int BlockWipedAllocatorService::m_clearFreq
private

Definition at line 36 of file BlockWipedAllocatorService.cc.

Referenced by BlockWipedAllocatorService(), and wiper().

bool BlockWipedAllocatorService::m_dump
private

Definition at line 35 of file BlockWipedAllocatorService.cc.

Referenced by BlockWipedAllocatorService(), and postModule().

bool BlockWipedAllocatorService::m_useAlloc
private

Definition at line 34 of file BlockWipedAllocatorService.cc.

Referenced by BlockWipedAllocatorService().