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
a7f901a4
Commit
a7f901a4
authored
7 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Read the header to recover the CPU frequency
parent
63098d78
No related branches found
No related tags found
1 merge request
!375
Threadpool task plots
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/plot_threadpool.py
+11
-5
11 additions, 5 deletions
examples/plot_threadpool.py
with
11 additions
and
5 deletions
examples/plot_threadpool.py
+
11
−
5
View file @
a7f901a4
...
@@ -99,6 +99,17 @@ colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
...
@@ -99,6 +99,17 @@ colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
"
magenta
"
,
"
hotpink
"
,
"
pink
"
,
"
orange
"
,
"
lightgreen
"
]
"
magenta
"
,
"
hotpink
"
,
"
pink
"
,
"
orange
"
,
"
lightgreen
"
]
maxcolours
=
len
(
colours
)
maxcolours
=
len
(
colours
)
# Read header. First two lines.
with
open
(
infile
)
as
infid
:
head
=
[
next
(
infid
)
for
x
in
xrange
(
2
)]
header
=
head
[
1
][
2
:].
strip
()
header
=
eval
(
header
)
nthread
=
int
(
header
[
'
num_threads
'
])
CPU_CLOCK
=
float
(
header
[
'
cpufreq
'
])
/
1000.0
print
"
Number of threads:
"
,
nthread
if
args
.
verbose
:
print
"
CPU frequency:
"
,
CPU_CLOCK
*
1000.0
# Read input.
# Read input.
data
=
pl
.
genfromtxt
(
infile
,
dtype
=
None
,
delimiter
=
"
"
)
data
=
pl
.
genfromtxt
(
infile
,
dtype
=
None
,
delimiter
=
"
"
)
...
@@ -121,17 +132,12 @@ funcs = pl.array(funcs)
...
@@ -121,17 +132,12 @@ funcs = pl.array(funcs)
threads
=
pl
.
array
(
threads
)
threads
=
pl
.
array
(
threads
)
chunks
=
pl
.
array
(
chunks
)
chunks
=
pl
.
array
(
chunks
)
nthread
=
int
(
max
(
threads
))
+
1
print
"
Number of threads:
"
,
nthread
# Recover the start and end time
# Recover the start and end time
tic_step
=
min
(
tics
)
tic_step
=
min
(
tics
)
toc_step
=
max
(
tocs
)
toc_step
=
max
(
tocs
)
# Not known.
# Not known.
CPU_CLOCK
=
2200067.0
if
args
.
verbose
:
print
"
CPU frequency:
"
,
CPU_CLOCK
*
1000.0
# Calculate the time range, if not given.
# Calculate the time range, if not given.
delta_t
=
delta_t
*
CPU_CLOCK
delta_t
=
delta_t
*
CPU_CLOCK
...
...
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