Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
a01c2d51
Commit
a01c2d51
authored
4 years ago
by
Mladen Ivkovic
Browse files
Options
Downloads
Patches
Plain Diff
moved isTaskRT up to same function family, ran black over plot_task_dependencies.py
parent
e55a4edd
No related branches found
No related tags found
1 merge request
!1155
RT injection task
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/plot_task_dependencies.py
+29
-29
29 additions, 29 deletions
tools/plot_task_dependencies.py
with
29 additions
and
29 deletions
tools/plot_task_dependencies.py
+
29
−
29
View file @
a01c2d51
...
...
@@ -15,9 +15,12 @@ def parseOption():
parser
=
OptionParser
()
parser
.
add_option
(
"
-c
"
,
"
--with-calls
"
,
dest
=
"
with_calls
"
,
"
-c
"
,
"
--with-calls
"
,
dest
=
"
with_calls
"
,
help
=
"
Add the function calls in the graph
"
,
action
=
"
store_true
"
)
action
=
"
store_true
"
,
)
opt
,
files
=
parser
.
parse_args
()
if
len
(
files
)
!=
1
:
...
...
@@ -88,14 +91,12 @@ def appendSingleData(data0, datai):
# get data
ta
=
datai
[
"
task_in
"
][
i
]
tb
=
datai
[
"
task_out
"
][
i
]
ind
=
np
.
logical_and
(
data0
[
"
task_in
"
]
==
ta
,
data0
[
"
task_out
"
]
==
tb
)
ind
=
np
.
logical_and
(
data0
[
"
task_in
"
]
==
ta
,
data0
[
"
task_out
"
]
==
tb
)
# check number of ta->tb
N
=
np
.
sum
(
ind
)
if
N
>
1
:
raise
Exception
(
"
Same dependency written multiple times %s->%s
"
%
(
ta
,
tb
))
raise
Exception
(
"
Same dependency written multiple times %s->%s
"
%
(
ta
,
tb
))
# if not present in data0
if
N
==
0
:
data0
.
append
(
row
)
...
...
@@ -129,7 +130,7 @@ def appendData(data):
return
data
[
0
]
# add number link to data[0]
for
i
in
range
(
N
-
1
):
for
i
in
range
(
N
-
1
):
i
+=
1
data
[
0
]
=
appendSingleData
(
data
[
0
],
data
[
i
])
...
...
@@ -150,6 +151,7 @@ def taskIsBlackHoles(name):
return
True
return
False
def
taskIsStars
(
name
):
"""
Does the task concern stars?
...
...
@@ -167,6 +169,7 @@ def taskIsStars(name):
return
False
def
taskIsHydro
(
name
):
"""
Does the task concern the hydro?
...
...
@@ -197,7 +200,7 @@ def taskIsHydro(name):
"
ghost_out
"
,
"
extra_ghost
"
,
"
cooling
"
,
"
star_formation
"
"
star_formation
"
,
]
if
name
in
task_name
:
return
True
...
...
@@ -221,6 +224,21 @@ def taskIsGravity(name):
return
False
def
taskIsRT
(
name
):
"""
Does the task concern Radiative Transfer?
Parameters
----------
name: str
Task name
"""
if
"
_rt
"
in
name
:
return
True
return
False
def
getFunctionCalls
(
name
):
txt
=
None
if
name
==
"
ghost
"
:
...
...
@@ -277,21 +295,6 @@ def getFunctionCalls(name):
return
pre
+
txt
+
app
def
taskIsRT
(
name
):
"""
Does the task concern Radiative Transfer?
Parameters
----------
name: str
Task name
"""
if
"
_rt
"
in
name
:
return
True
return
False
def
writeTask
(
f
,
name
,
implicit
,
mpi
,
with_calls
):
"""
Write the special task (e.g. implicit and mpi)
...
...
@@ -391,8 +394,7 @@ def writeHeader(f, data, git, opt):
continue
written
.
append
(
ta
)
writeTask
(
f
,
ta
,
data
[
"
implicit_in
"
][
i
],
data
[
"
mpi_in
"
][
i
],
opt
.
with_calls
)
writeTask
(
f
,
ta
,
data
[
"
implicit_in
"
][
i
],
data
[
"
mpi_in
"
][
i
],
opt
.
with_calls
)
# do task out
for
i
in
range
(
N
):
...
...
@@ -401,8 +403,7 @@ def writeHeader(f, data, git, opt):
continue
written
.
append
(
tb
)
writeTask
(
f
,
tb
,
data
[
"
implicit_out
"
][
i
],
data
[
"
mpi_out
"
][
i
],
opt
.
with_calls
)
writeTask
(
f
,
tb
,
data
[
"
implicit_out
"
][
i
],
data
[
"
mpi_out
"
][
i
],
opt
.
with_calls
)
f
.
write
(
"
\n
"
)
...
...
@@ -505,8 +506,7 @@ def writeDependencies(f, data):
arrow
=
""
if
data
[
"
number_rank
"
][
i
]
!=
max_rank
:
arrow
=
"
,style=dashed
"
f
.
write
(
"
\t
%s->%s[label=%i%s]
\n
"
%
(
ta
,
tb
,
number_link
,
arrow
))
f
.
write
(
"
\t
%s->%s[label=%i%s]
\n
"
%
(
ta
,
tb
,
number_link
,
arrow
))
def
writeFooter
(
f
):
...
...
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