ATLAS Offline Software
Classes | Functions | Variables
python.AthDsoLogger Namespace Reference

Classes

class  DsoEvent
 
class  DsoLogger
 

Functions

def __del__ (self)
 
def default_cb_fct (self, evt, usrdata)
 

Variables

string __doc__ = "log the vmem usage at each dso being dlopen'd"
 
string __version__ = "$Revision: 1.3 $"
 
string __author__ = "Sebastien Binet <binet@cern.ch>"
 
 _cb_fct_type
 self.lib.fetch_vmem.argtypes = None self.lib.fetch_vmem.restype = ctypes.c_float More...
 
 fct = self.lib.ath_dso_cbk_register
 
 argtypes
 
 restype
 
 _data
 
 msg
 
 cb_fct = self.default_cb_fct
 
string fname = 'vmem-dso.csv'
 
 _fd
 
 out
 
 delimiter
 

Function Documentation

◆ __del__()

def python.AthDsoLogger.__del__ (   self)

Definition at line 82 of file AthDsoLogger.py.

82  def __del__ (self):
83  # release library
84  self.lib.ath_dso_cbk_unregister(self.cb_fct)
85  self._fd.close()
86 

◆ default_cb_fct()

def python.AthDsoLogger.default_cb_fct (   self,
  evt,
  usrdata 
)

Definition at line 88 of file AthDsoLogger.py.

88  def default_cb_fct (self, evt, usrdata):
89  libname = evt.contents.fname
90  step = evt.contents.step
91 
92  if libname is None:
93  return 0
94  n = _basename (_realpath (libname))
95 
96  pid = os.getpid()
97  def vmem():
98  from os import sysconf
99  PAGE_SIZE = sysconf ('SC_PAGE_SIZE') # in bytes
100 
101  from string import split as ssplit
102  m = 0
103  with open('/proc/self/statm') as f:
104  m = int(ssplit (f.readlines()[0])[0])
105  return m * PAGE_SIZE # in bytes
106 
107  if step == 0:
108  self._data[pid][n] = [vmem(), None]
109  else:
110  data = self._data[pid][n]
111  data[1] = vmem()
112  vmem_start = data[0]/1024.
113  vmem_stop = data[1]/1024.
114  dvmem = vmem_stop - vmem_start
115  self.msg.info (
116  "[%d] loading lib: vmem=(%10.1f + %10.1f) kb [%s]",
117  pid, vmem_start, dvmem, n
118  )
119  self.out.writerow ([pid, n, vmem_start, vmem_stop, dvmem])
120  #del self._data[pid][n]
121  return 0

Variable Documentation

◆ __author__

string python.AthDsoLogger.__author__ = "Sebastien Binet <binet@cern.ch>"
private

Definition at line 11 of file AthDsoLogger.py.

◆ __doc__

string python.AthDsoLogger.__doc__ = "log the vmem usage at each dso being dlopen'd"
private

Definition at line 9 of file AthDsoLogger.py.

◆ __version__

string python.AthDsoLogger.__version__ = "$Revision: 1.3 $"
private

Definition at line 10 of file AthDsoLogger.py.

◆ _cb_fct_type

python.AthDsoLogger._cb_fct_type
private

self.lib.fetch_vmem.argtypes = None self.lib.fetch_vmem.restype = ctypes.c_float

Definition at line 40 of file AthDsoLogger.py.

◆ _data

python.AthDsoLogger._data
private

Definition at line 52 of file AthDsoLogger.py.

◆ _fd

python.AthDsoLogger._fd
private

Definition at line 70 of file AthDsoLogger.py.

◆ argtypes

python.AthDsoLogger.argtypes

Definition at line 44 of file AthDsoLogger.py.

◆ cb_fct

python.AthDsoLogger.cb_fct = self.default_cb_fct

Definition at line 59 of file AthDsoLogger.py.

◆ delimiter

python.AthDsoLogger.delimiter

Definition at line 71 of file AthDsoLogger.py.

◆ fct

python.AthDsoLogger.fct = self.lib.ath_dso_cbk_register

Definition at line 43 of file AthDsoLogger.py.

◆ fname

string python.AthDsoLogger.fname = 'vmem-dso.csv'

Definition at line 67 of file AthDsoLogger.py.

◆ msg

python.AthDsoLogger.msg

Definition at line 55 of file AthDsoLogger.py.

◆ out

python.AthDsoLogger.out

Definition at line 71 of file AthDsoLogger.py.

◆ restype

python.AthDsoLogger.restype

Definition at line 45 of file AthDsoLogger.py.

python.AthDsoLogger.default_cb_fct
def default_cb_fct(self, evt, usrdata)
Definition: AthDsoLogger.py:88
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::open
@ open
Definition: BinningType.h:40
python.AthDsoLogger.__del__
def __del__(self)
Definition: AthDsoLogger.py:82
ath_dso_cbk_unregister
int ath_dso_cbk_unregister(ath_dso_event_cbk_t cbk)