FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-taskflow/image/plot.py at master · clin99/cpp-taskflow · GitHub
clin99
/
cpp-taskflow
Public
forked from
taskflow/taskflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
7
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-taskflow
/
image
/
plot.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
84 lines (66 loc) · 2.11 KB
Breadcrumbs
cpp-taskflow
/
image
/
plot.py
Copy path
File metadata and controls
84 lines (66 loc) · 2.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import
matplotlib
.
pyplot
as
plt
import
numpy
as
np
import
matplotlib
.
mlab
as
mlab
import
matplotlib
.
gridspec
as
gridspec
# Fixing random state for reproducibility
costs
=
[
5326
,
1608
,
920
]
plt
.
subplot
(
131
)
x
=
np
.
arange
(
3
)
#plt.plot(costs, label='v1 (OpenMP)', color='black')
plt
.
bar
(
x
,
costs
)
plt
.
title
(
'Development Cost'
,
fontsize
=
22
)
plt
.
xlabel
(
'task model'
,
fontsize
=
18
)
plt
.
ylabel
(
'$USD'
,
fontsize
=
16
)
plt
.
xticks
(
x
, (
'OpenMP'
,
'TBB'
,
'Cpp-Taskflow'
))
plt
.
legend
()
# Fixing random state for reproducibility
raw
=
[
line
.
strip
()
for
line
in
open
(
"graph_algorithm.txt"
)]
graph_sizes
=
[]
omp_runtimes
=
[]
tbb_runtimes
=
[]
ctf_runtimes
=
[]
# extract the output data
i
=
0
for
line
in
raw
:
token
=
line
.
split
();
assert
(
len
(
token
)
==
4
)
graph_sizes
.
append
(
int
(
token
[
0
]))
omp_runtimes
.
append
(
float
(
token
[
1
]))
tbb_runtimes
.
append
(
float
(
token
[
2
]))
ctf_runtimes
.
append
(
float
(
token
[
3
]))
i
=
i
+
1
plt
.
subplot
(
132
)
plt
.
plot
(
graph_sizes
,
omp_runtimes
,
label
=
'OpenMP'
)
plt
.
plot
(
graph_sizes
,
tbb_runtimes
,
label
=
'TBB'
)
plt
.
plot
(
graph_sizes
,
ctf_runtimes
,
label
=
'Cpp-Taskflow'
)
plt
.
title
(
'Graph Algorithm'
,
fontsize
=
22
)
plt
.
xlabel
(
'graph size (|V|+|E| ~ # tasks)'
,
fontsize
=
18
)
plt
.
ylabel
(
'cpu runtime (ms)'
,
fontsize
=
16
)
#plt.xticks(np.arange(len(graph_sizes)), graph_sizes)
plt
.
legend
(
fontsize
=
16
)
# Fixing random state for reproducibility
raw
=
[
line
.
strip
()
for
line
in
open
(
"matrix_operation.txt"
)]
graph_sizes
=
[]
omp_runtimes
=
[]
tbb_runtimes
=
[]
ctf_runtimes
=
[]
# extract the output data
i
=
0
for
line
in
raw
:
token
=
line
.
split
();
assert
(
len
(
token
)
==
4
)
graph_sizes
.
append
(
int
(
token
[
0
]))
omp_runtimes
.
append
(
float
(
token
[
1
]))
tbb_runtimes
.
append
(
float
(
token
[
2
]))
ctf_runtimes
.
append
(
float
(
token
[
3
]))
i
=
i
+
1
plt
.
subplot
(
133
)
plt
.
plot
(
graph_sizes
,
omp_runtimes
,
label
=
'OpenMP'
)
plt
.
plot
(
graph_sizes
,
tbb_runtimes
,
label
=
'TBB'
)
plt
.
plot
(
graph_sizes
,
ctf_runtimes
,
label
=
'Cpp-Taskflow'
)
plt
.
title
(
'Matrix Operation'
,
fontsize
=
22
)
plt
.
xlabel
(
'partition count (# tasks)'
,
fontsize
=
18
)
plt
.
ylabel
(
'cpu runtime (ms)'
,
fontsize
=
16
)
#plt.xticks(np.arange(len(graph_sizes)), graph_sizes)
plt
.
legend
(
fontsize
=
16
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL