Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
particle_methods
hysop
Commits
47938c57
Commit
47938c57
authored
3 years ago
by
EXT Jean-Matthieu Etancelin
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-profiling-for-python3' into 'master'
Fix profiling for python3 See merge request
!31
parents
61a971bd
7c3db818
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!31
Fix profiling for python3
Pipeline
#70107
passed
3 years ago
Stage: env
Stage: configure
Stage: build
Stage: install
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hysop/core/graph/computational_graph.py
+13
-6
13 additions, 6 deletions
hysop/core/graph/computational_graph.py
hysop/tools/profiler.py
+2
-2
2 additions, 2 deletions
hysop/tools/profiler.py
with
15 additions
and
8 deletions
hysop/core/graph/computational_graph.py
+
13
−
6
View file @
47938c57
...
...
@@ -529,17 +529,24 @@ class ComputationalGraph(ComputationalGraphNode, metaclass=ABCMeta):
for
(
i
,
op
)
in
enumerate
(
n
):
yield
(
iprefix
+
str
(
i
),
pnprefix
+
op
.
pretty_name
,
nprefix
+
op
.
name
,
op
)
if
isinstance
(
op
,
Problem
):
for
_
in
__recurse_nodes
(
op
.
nodes
,
iprefix
+
str
(
i
)
+
"
:
"
,
pnprefix
+
op
.
pretty_name
+
"
.
"
,
nprefix
+
op
.
name
+
"
.
"
):
yield
_
yield
from
__recurse_nodes
(
op
.
nodes
,
iprefix
+
str
(
i
)
+
"
:
"
,
pnprefix
+
op
.
pretty_name
+
"
.
"
,
nprefix
+
op
.
name
+
"
.
"
)
def
__line
(
_i
,
_pn
,
_op
,
_k
):
strdata
=
(
_i
,
str
(
_op
.
mpi_params
.
task_id
),
_pn
,
type
(
_op
).
__name__
,
_k
.
split
(
'
.
'
)[
-
1
])
values
=
tuple
(
ff
.
format
(
self
.
_profiler
.
all_data
[
_k
][
_
])
for
ff
,
_
in
zip
((
"
{:.5g}
"
,
"
{}
"
,
"
{:.5g}
"
,
"
{:.5g}
"
,
"
{:.5g}
"
,
"
{}
"
),
(
2
,
1
,
3
,
4
,
5
,
0
)))
return
multiline_split
(
strdata
+
values
,
maxlen
,
split_sep
,
replace
,
newline_prefix
)
ops
,
already_printed
=
[],
[]
ops
+=
__line
(
''
,
"
MAIN
"
,
self
,
self
.
name
+
'
.apply
'
)
for
(
i
,
pn
,
n
,
op
)
in
__recurse_nodes
(
self
.
nodes
,
nprefix
=
self
.
name
+
"
.
"
):
for
k
in
self
.
_profiler
.
all_data
.
keys
():
if
n
==
'
.
'
.
join
(
k
.
split
(
'
.
'
)[:
-
1
])
and
not
k
in
already_printed
:
strdata
=
(
i
,
str
(
op
.
mpi_params
.
task_id
),
pn
,
type
(
op
).
__name__
,
k
.
split
(
'
.
'
)[
-
1
])
values
=
tuple
(
ff
.
format
(
self
.
_profiler
.
all_data
[
k
][
_
])
for
ff
,
_
in
zip
((
"
{:.5g}
"
,
"
{}
"
,
"
{:.5g}
"
,
"
{:.5g}
"
,
"
{:.5g}
"
,
"
{}
"
),
(
2
,
1
,
3
,
4
,
5
,
0
)))
ops
+=
multiline_split
(
strdata
+
values
,
maxlen
,
split_sep
,
replace
,
newline_prefix
)
ops
+=
__line
(
i
,
pn
,
op
,
k
)
already_printed
.
append
(
k
)
isize
=
max
(
strlen
(
s
[
0
])
for
s
in
ops
)
...
...
This diff is collapsed.
Click to expand it.
hysop/tools/profiler.py
+
2
−
2
View file @
47938c57
...
...
@@ -229,7 +229,7 @@ class Profiler(object):
nb
=
comm
.
allgather
(
len
(
self
.
table
))
all_names
=
comm
.
allgather
([
_
[
0
]
for
_
in
self
.
table
])
all_times
=
comm
.
allgather
([
_
[
1
]
for
_
in
self
.
table
])
all_calls
=
comm
.
allgather
([
_
[
2
]
for
_
in
self
.
table
])
all_calls
=
comm
.
allgather
([
int
(
_
[
2
]
)
for
_
in
self
.
table
])
all_data
=
{}
# all_data structure : task_size, calls nb, self total, task mean, task min, task max
nelem
=
6
...
...
@@ -243,7 +243,7 @@ class Profiler(object):
all_data
[
n
][
2
]
=
t
all_data
[
n
][
nelem
].
append
(
t
)
for
n
in
all_data
.
keys
():
all_data
[
n
][
1
]
/=
all_data
[
n
][
0
]
all_data
[
n
][
1
]
/
/=
all_data
[
n
][
0
]
all_data
[
n
][
3
]
=
npw
.
average
(
all_data
[
n
][
nelem
])
all_data
[
n
][
4
]
=
npw
.
min
(
all_data
[
n
][
nelem
])
all_data
[
n
][
5
]
=
npw
.
max
(
all_data
[
n
][
nelem
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment