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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
a01c2d51
Commit
a01c2d51
authored
Sep 3, 2020
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
Show 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():
...
@@ -15,9 +15,12 @@ def parseOption():
parser
=
OptionParser
()
parser
=
OptionParser
()
parser
.
add_option
(
parser
.
add_option
(
"
-c
"
,
"
--with-calls
"
,
dest
=
"
with_calls
"
,
"
-c
"
,
"
--with-calls
"
,
dest
=
"
with_calls
"
,
help
=
"
Add the function calls in the graph
"
,
help
=
"
Add the function calls in the graph
"
,
action
=
"
store_true
"
)
action
=
"
store_true
"
,
)
opt
,
files
=
parser
.
parse_args
()
opt
,
files
=
parser
.
parse_args
()
if
len
(
files
)
!=
1
:
if
len
(
files
)
!=
1
:
...
@@ -88,14 +91,12 @@ def appendSingleData(data0, datai):
...
@@ -88,14 +91,12 @@ def appendSingleData(data0, datai):
# get data
# get data
ta
=
datai
[
"
task_in
"
][
i
]
ta
=
datai
[
"
task_in
"
][
i
]
tb
=
datai
[
"
task_out
"
][
i
]
tb
=
datai
[
"
task_out
"
][
i
]
ind
=
np
.
logical_and
(
data0
[
"
task_in
"
]
==
ta
,
ind
=
np
.
logical_and
(
data0
[
"
task_in
"
]
==
ta
,
data0
[
"
task_out
"
]
==
tb
)
data0
[
"
task_out
"
]
==
tb
)
# check number of ta->tb
# check number of ta->tb
N
=
np
.
sum
(
ind
)
N
=
np
.
sum
(
ind
)
if
N
>
1
:
if
N
>
1
:
raise
Exception
(
"
Same dependency written multiple times %s->%s
"
%
raise
Exception
(
"
Same dependency written multiple times %s->%s
"
%
(
ta
,
tb
))
(
ta
,
tb
))
# if not present in data0
# if not present in data0
if
N
==
0
:
if
N
==
0
:
data0
.
append
(
row
)
data0
.
append
(
row
)
...
@@ -150,6 +151,7 @@ def taskIsBlackHoles(name):
...
@@ -150,6 +151,7 @@ def taskIsBlackHoles(name):
return
True
return
True
return
False
return
False
def
taskIsStars
(
name
):
def
taskIsStars
(
name
):
"""
"""
Does the task concern stars?
Does the task concern stars?
...
@@ -167,6 +169,7 @@ def taskIsStars(name):
...
@@ -167,6 +169,7 @@ def taskIsStars(name):
return
False
return
False
def
taskIsHydro
(
name
):
def
taskIsHydro
(
name
):
"""
"""
Does the task concern the hydro?
Does the task concern the hydro?
...
@@ -197,7 +200,7 @@ def taskIsHydro(name):
...
@@ -197,7 +200,7 @@ def taskIsHydro(name):
"
ghost_out
"
,
"
ghost_out
"
,
"
extra_ghost
"
,
"
extra_ghost
"
,
"
cooling
"
,
"
cooling
"
,
"
star_formation
"
"
star_formation
"
,
]
]
if
name
in
task_name
:
if
name
in
task_name
:
return
True
return
True
...
@@ -221,6 +224,21 @@ def taskIsGravity(name):
...
@@ -221,6 +224,21 @@ def taskIsGravity(name):
return
False
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
):
def
getFunctionCalls
(
name
):
txt
=
None
txt
=
None
if
name
==
"
ghost
"
:
if
name
==
"
ghost
"
:
...
@@ -277,21 +295,6 @@ def getFunctionCalls(name):
...
@@ -277,21 +295,6 @@ def getFunctionCalls(name):
return
pre
+
txt
+
app
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
):
def
writeTask
(
f
,
name
,
implicit
,
mpi
,
with_calls
):
"""
"""
Write the special task (e.g. implicit and mpi)
Write the special task (e.g. implicit and mpi)
...
@@ -391,8 +394,7 @@ def writeHeader(f, data, git, opt):
...
@@ -391,8 +394,7 @@ def writeHeader(f, data, git, opt):
continue
continue
written
.
append
(
ta
)
written
.
append
(
ta
)
writeTask
(
f
,
ta
,
data
[
"
implicit_in
"
][
i
],
data
[
"
mpi_in
"
][
i
],
writeTask
(
f
,
ta
,
data
[
"
implicit_in
"
][
i
],
data
[
"
mpi_in
"
][
i
],
opt
.
with_calls
)
opt
.
with_calls
)
# do task out
# do task out
for
i
in
range
(
N
):
for
i
in
range
(
N
):
...
@@ -401,8 +403,7 @@ def writeHeader(f, data, git, opt):
...
@@ -401,8 +403,7 @@ def writeHeader(f, data, git, opt):
continue
continue
written
.
append
(
tb
)
written
.
append
(
tb
)
writeTask
(
f
,
tb
,
data
[
"
implicit_out
"
][
i
],
data
[
"
mpi_out
"
][
i
],
writeTask
(
f
,
tb
,
data
[
"
implicit_out
"
][
i
],
data
[
"
mpi_out
"
][
i
],
opt
.
with_calls
)
opt
.
with_calls
)
f
.
write
(
"
\n
"
)
f
.
write
(
"
\n
"
)
...
@@ -505,8 +506,7 @@ def writeDependencies(f, data):
...
@@ -505,8 +506,7 @@ def writeDependencies(f, data):
arrow
=
""
arrow
=
""
if
data
[
"
number_rank
"
][
i
]
!=
max_rank
:
if
data
[
"
number_rank
"
][
i
]
!=
max_rank
:
arrow
=
"
,style=dashed
"
arrow
=
"
,style=dashed
"
f
.
write
(
"
\t
%s->%s[label=%i%s]
\n
"
%
f
.
write
(
"
\t
%s->%s[label=%i%s]
\n
"
%
(
ta
,
tb
,
number_link
,
arrow
))
(
ta
,
tb
,
number_link
,
arrow
))
def
writeFooter
(
f
):
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
sign in
to comment