|
ATLAS Offline Software
|
◆ comp_delta()
def python.IoTestsLib.comp_delta |
( |
|
d, |
|
|
|
verbose = False |
|
) |
| |
Definition at line 46 of file IoTestsLib.py.
49 assert len(d[
'start']) == 3
50 assert len(d[
'stop']) == 3
53 delta = {
'cpu' : d[
'stop'][0] - d[
'start'][0],
54 'vmem': d[
'stop'][1] - d[
'start'][1],
55 'rss' : d[
'stop'][2] - d[
'start'][2],
59 delta[
'nbytes'] = d[
'nbytes']
60 print (
"==> cpu: %(cpu)8.3f ms vmem: %(vmem)i kB rss: %(rss)i kB nbytes: %(nbytes)i kB" % delta)
◆ import_ROOT()
def python.IoTestsLib.import_ROOT |
( |
| ) |
|
Definition at line 63 of file IoTestsLib.py.
66 if '-b' not in sys.argv:
67 sys.argv.insert(1,
'-b')
◆ io_test1_read()
def python.IoTestsLib.io_test1_read |
( |
|
fname, |
|
|
|
verbose = False |
|
) |
| |
Definition at line 99 of file IoTestsLib.py.
100 f = ROOT.TFile.Open(fname,
'READ')
102 assert t,
"could not find tree 't'"
103 nevts = t.GetEntries()
105 print (
"::: reading [%s] (%i events) [sz=%s kB]" % (fname, nevts,
108 get_entry = t.GetEntry
110 for ievt
in range(nevts):
117 assert len(t.data) > 0
123 return {
'start' : start,
125 'nbytes': tot_bytes//1024}
◆ io_test1_write()
def python.IoTestsLib.io_test1_write |
( |
|
fname, |
|
|
|
nevts = 1000 , |
|
|
|
sz = 1000 , |
|
|
|
dtype = 'i' |
|
) |
| |
testing writing 1000 evts with arrays of 1000- integers
Definition at line 74 of file IoTestsLib.py.
75 """testing writing 1000 evts with arrays of 1000- integers
77 f = ROOT.TFile.Open(fname,
'RECREATE')
78 t = ROOT.TTree(
't',
't')
82 data = carray(dtype, imax*[ 0 ] )
84 t.Branch(
'i', data,
'data[%d]/%s'%(imax, _py_dtype_to_root[dtype]) )
86 from random
import randint
89 for i
in range(nevts):
91 data[j] = randint(0, sz)
◆ io_test2_read()
def python.IoTestsLib.io_test2_read |
( |
|
fname, |
|
|
|
verbose = False |
|
) |
| |
Definition at line 157 of file IoTestsLib.py.
158 f = ROOT.TFile.Open(fname,
'READ')
160 assert t,
"could not find tree 't'"
161 nevts = t.GetEntries()
163 print (
"::: reading [%s] (%i events) [sz=%s kB]" % (fname, nevts,
166 get_entry = t.GetEntry
168 for ievt
in range(nevts):
175 assert len(t.data) > 0
181 return {
'start' : start,
183 'nbytes': tot_bytes//1024}
◆ io_test2_write()
def python.IoTestsLib.io_test2_write |
( |
|
fname, |
|
|
|
nevts = 1000 , |
|
|
|
sz = 1000 , |
|
|
|
dtype = 'i' |
|
) |
| |
testing writing 1000 evts with arrays of (variable length) 1000- ints
Definition at line 128 of file IoTestsLib.py.
129 """testing writing 1000 evts with arrays of (variable length) 1000- ints
131 f = ROOT.TFile.Open(fname,
'RECREATE')
132 t = ROOT.TTree(
't',
't')
137 n = carray(
'i', [ 0 ] )
138 data = carray( dtype, imax*[ 0 ] )
139 t.Branch(
'sz', n,
'sz/I' )
140 t.Branch(
'data', data,
'data[sz]/%s'%_py_dtype_to_root[dtype])
142 from random
import randint
145 for i
in range(nevts):
146 jmax = randint(1, sz)
148 for j
in range(jmax):
149 data[j] = randint(0, sz)
◆ pymon()
def python.IoTestsLib.pymon |
( |
| ) |
|
returns (cpu[ms], vmem[kb], rss[kb])
Definition at line 33 of file IoTestsLib.py.
34 """returns (cpu[ms], vmem[kb], rss[kb])
36 from resource
import getrusage, RUSAGE_SELF
37 from string
import split
as ssplit
38 cpu = getrusage(RUSAGE_SELF)
39 mem =
open(
'/proc/self/statm',
'r')
40 cpu = (cpu.ru_utime+cpu.ru_stime) * 1e3
41 mem = ssplit(mem.readlines()[0])
42 vmem =
int(mem[0])*_pagesz
43 rss =
int(mem[1])*_pagesz
◆ __author__
string python.IoTestsLib.__author__ = "Sebastien Binet <binet@cern.ch>" |
|
private |
◆ __doc__
string python.IoTestsLib.__doc__ |
|
private |
Initial value:
2 a set of simple minded functions to test ROOT I/O (from python)
Definition at line 10 of file IoTestsLib.py.
◆ __version__
string python.IoTestsLib.__version__ = "$Revision: 1.1 $" |
|
private |
◆ _pagesz
int python.IoTestsLib._pagesz = sysconf('SC_PAGE_SIZE') // 1024 |
|
private |
◆ _py_dtype_to_root
dictionary python.IoTestsLib._py_dtype_to_root |
|
private |
◆ fname
string python.IoTestsLib.fname = '/tmp/out_test1_ints.root' |
◆ mon_data
dictionary python.IoTestsLib.mon_data = {} |
◆ nreads
int python.IoTestsLib.nreads = 10 |
tests ------------------------------------------------------------------—
Definition at line 191 of file IoTestsLib.py.
◆ ROOT
def io_test2_write(fname, nevts=1000, sz=1000, dtype='i')
def io_test1_read(fname, verbose=False)
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
void fill(H5::Group &out_file, size_t iterations)
def comp_delta(d, verbose=False)
def io_test1_write(fname, nevts=1000, sz=1000, dtype='i')
def io_test2_read(fname, verbose=False)