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
cb374bbc
Commit
cb374bbc
authored
7 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Don't plot the fake thread we just use its range to colour the background
parent
d7bb1cc1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!375
Threadpool task plots
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/plot_threadpool.py
+12
-0
12 additions, 0 deletions
examples/plot_threadpool.py
with
12 additions
and
0 deletions
examples/plot_threadpool.py
+
12
−
0
View file @
cb374bbc
...
...
@@ -209,6 +209,18 @@ fig = pl.figure()
ax
=
fig
.
add_subplot
(
1
,
1
,
1
)
ax
.
set_xlim
(
-
delta_t
*
0.01
/
CPU_CLOCK
,
delta_t
*
1.01
/
CPU_CLOCK
)
ax
.
set_ylim
(
0
,
nthread
)
# Fake thread is used to colour the whole range, do that first.
tictocs
=
[]
colours
=
[]
j
=
0
for
task
in
tasks
[
nthread
-
1
]:
tictocs
.
append
((
task
[
"
tic
"
],
task
[
"
toc
"
]
-
task
[
"
tic
"
]))
colours
.
append
(
task
[
"
colour
"
])
ax
.
broken_barh
(
tictocs
,
[
0
,(
nthread
-
1
)],
facecolors
=
colours
,
linewidth
=
0
,
alpha
=
0.15
)
# And we don't plot the fake thread.
nthread
=
nthread
-
1
for
i
in
range
(
nthread
):
# Collect ranges and colours into arrays.
...
...
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