Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ATLAS-EGamma
athena
Commits
461e1454
Commit
461e1454
authored
Nov 30, 2021
by
Ruggero Turra
🎧
Browse files
last try
parent
eb327446
Changes
1
Hide whitespace changes
Inline
Side-by-side
Reconstruction/egamma/egammaMVACalib/python/mem_test.py
View file @
461e1454
...
...
@@ -6,6 +6,7 @@ import ROOT
import
os
import
psutil
import
time
import
gc
__doc__
=
"To print the vmem usage before and after instantiating egammaMVACalibTool"
...
...
@@ -55,22 +56,24 @@ if __name__ == "__main__":
'unconverted'
)
if
args
.
particle_type
==
'all'
else
(
args
.
particle_type
,)
print
(
"Particle Folder Initial [
G
B] After constr. [
G
B] After init. [
G
B]"
)
"Particle Folder Initial [
M
B] After constr. [
M
B] After init. [
M
B]"
)
# this dummy tool is to force the loading of all the shared libraries and other resources
# which should not be counted in the memory usage
dummy_tool
=
create_tool
(
convert_particle_type
(
particle_types_str
[
0
]),
args
.
folder
)
dummy_tool
.
initialize
()
gc
.
disable
()
for
particle_type
in
particle_types_str
:
memory_initial
=
Vmem
()
/
1E
9
# in
G
B
memory_initial
=
Vmem
()
/
1E
6
# in
M
B
tool
=
create_tool
(
convert_particle_type
(
particle_type
),
args
.
folder
)
memory_after_constructor
=
Vmem
()
/
1E
9
memory_after_constructor
=
Vmem
()
/
1E
6
tool
.
initialize
()
memory_final
=
Vmem
()
/
1E
9
memory_final
=
Vmem
()
/
1E
6
print
(
"{:<15s} {:35s} {:13.
2
f} {:1
0.2
f} (
+
{:
2.3
f}) {:
8.2
f} (
+
{:
2.3
f})"
.
format
(
print
(
"{:<15s} {:35s} {:13.
0
f} {:1
1.0
f} ({:
+5.0
f}) {:
9.0
f} ({:
+5.0
f})"
.
format
(
particle_type
,
args
.
folder
,
memory_initial
,
memory_after_constructor
,
memory_after_constructor
-
memory_initial
,
memory_final
,
memory_final
-
memory_after_constructor
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment