ATLAS Offline Software
MemoryMonitoringTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MemoryMonitoringTool.h, (c) ATLAS Detector software
8 
9 #ifndef ISF_TOOLS_MEMORYMONITORINGTOOL_H
10 #define ISF_TOOLS_MEMORYMONITORINGTOOL_H 1
11 
12 // Gaudi & Athena basics
14 
15 // ISF includes
17 
18 
19 // stl includes
20 #include <utility>
21 #include <vector>
22 
23 namespace ISF {
24 
26  typedef std::pair <const char* , int> InfoUsagePair;
27  typedef std::vector <InfoUsagePair*> InfoUsagePairVector;
28 
29 
37  class MemoryMonitoringTool : public extends<AthAlgTool, IMonitoringTool> {
38 
39  public:
41  MemoryMonitoringTool( const std::string& t, const std::string& n, const IInterface* p );
42 
45 
46  // Athena algtool's Hooks
49 
51  virtual double getCurrent() const;
52 
54  virtual void dumpCurrent(const char *infoStr,
55  bool considerInSummary);
56 
58  virtual void recordCurrent(const char *infoStr);
59 
61  virtual void dumpSummary(const char *dumpCallDescr) const;
62 
63  private:
65  int computeCurMemoryUsage() const;
66 
68  unsigned int m_numCalls;
69  unsigned int m_prevCallMemUsage;
72 
75 
76  };
77 
78 }
79 
80 
81 #endif //> !ISF_TOOLS_MEMORYMONITORINGTOOL_H
ISF::MemoryMonitoringTool::initialize
StatusCode initialize()
Athena algtool Hooks.
Definition: MemoryMonitoringTool.cxx:41
ISF::MemoryMonitoringTool::dumpCurrent
virtual void dumpCurrent(const char *infoStr, bool considerInSummary)
dump current memory monitoring information
Definition: MemoryMonitoringTool.cxx:66
ISF::MemoryMonitoringTool::computeCurMemoryUsage
int computeCurMemoryUsage() const
consolidate /proc to determine current memory usage
Definition: MemoryMonitoringTool.cxx:138
ISF::MemoryMonitoringTool
Definition: MemoryMonitoringTool.h:37
ISF::MemoryMonitoringTool::dumpSummary
virtual void dumpSummary(const char *dumpCallDescr) const
dump all internally stored memory monitoring information
Definition: MemoryMonitoringTool.cxx:108
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ISF::MemoryMonitoringTool::~MemoryMonitoringTool
~MemoryMonitoringTool()
Destructor.
Definition: MemoryMonitoringTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ISF::InfoUsagePair
std::pair< const char *, int > InfoUsagePair
these datatypes used to store (infoStr,memUsage) paired info
Definition: MemoryMonitoringTool.h:26
ISF::MemoryMonitoringTool::getCurrent
virtual double getCurrent() const
return current memory usage in kBytes
Definition: MemoryMonitoringTool.cxx:60
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IMonitoringTool.h
AthAlgTool.h
ISF::MemoryMonitoringTool::m_accumulatedIncrMemory
double m_accumulatedIncrMemory
Definition: MemoryMonitoringTool.h:71
ISF::MemoryMonitoringTool::MemoryMonitoringTool
MemoryMonitoringTool(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: MemoryMonitoringTool.cxx:16
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ISF::MemoryMonitoringTool::m_accumulatedCallMemory
double m_accumulatedCallMemory
Definition: MemoryMonitoringTool.h:70
ISF::MemoryMonitoringTool::recordCurrent
virtual void recordCurrent(const char *infoStr)
store the current memory monitoring information internally
Definition: MemoryMonitoringTool.cxx:93
ISF::MemoryMonitoringTool::m_numCalls
unsigned int m_numCalls
needed to compute per event stats
Definition: MemoryMonitoringTool.h:68
ISF::MemoryMonitoringTool::m_table
InfoUsagePairVector m_table
storing all (infoStr,memUsage) pairs created in recordCurrent(..) calls
Definition: MemoryMonitoringTool.h:74
ISF::MemoryMonitoringTool::m_prevCallMemUsage
unsigned int m_prevCallMemUsage
Definition: MemoryMonitoringTool.h:69
ISF::InfoUsagePairVector
std::vector< InfoUsagePair * > InfoUsagePairVector
Definition: MemoryMonitoringTool.h:27
ISF::MemoryMonitoringTool::finalize
StatusCode finalize()
Athena algtool Hook.
Definition: MemoryMonitoringTool.cxx:51