Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthias Mayr
limbo
Commits
c2bd4e76
Commit
c2bd4e76
authored
Jul 05, 2017
by
Jean-Baptiste Mouret
Browse files
misc
parent
f1f573c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
waf_tools/benchmarks.py
View file @
c2bd4e76
...
...
@@ -4,6 +4,7 @@ import subprocess
import
time
import
threading
from
waflib
import
Logs
import
plot_bo_benchmarks
json_ok
=
True
try
:
...
...
@@ -39,7 +40,8 @@ def run_bo_benchmarks(ctx):
Logs
.
pprint
(
'NORMAL'
,
'%s Running: %s for the %s th time %s'
%
(
HEADER
,
fname
,
str
(
i
),
NC
))
s
=
"cd "
+
directory
+
";./"
+
fname
retcode
=
subprocess
.
call
(
s
,
shell
=
True
,
env
=
None
)
# plot all
plot_bo_benchmarks
.
plot_all
()
def
compile_regression_benchmarks
(
bld
,
json_file
):
...
...
waf_tools/plot_bo_benchmarks.py
View file @
c2bd4e76
...
...
@@ -8,11 +8,7 @@ import brewer2mpl
bmap
=
brewer2mpl
.
get_map
(
'Set2'
,
'qualitative'
,
8
)
colors
=
bmap
.
mpl_colors
print
len
(
colors
)
print
colors
params
=
{
'axes.labelsize'
:
8
,
'text.fontsize'
:
8
,
...
...
@@ -25,7 +21,7 @@ params = {
rcParams
.
update
(
params
)
def
load_data
():
files
=
glob
(
"
../
benchmark_results/*/*/*.dat"
)
files
=
glob
(
"benchmark_results/*/*/*.dat"
)
data
=
defaultdict
(
lambda
:
defaultdict
(
dict
))
for
f
in
files
:
fs
=
f
.
split
(
"/"
)
...
...
@@ -102,12 +98,16 @@ def plot(func_name, data):
ax
.
set_yticklabels
([])
ax
.
set_title
(
"Wall clock time"
)
fig
.
savefig
(
"
../
benchmark_results/"
+
func_name
.
split
(
'.'
)[
0
]
+
".png"
)
fig
.
savefig
(
"benchmark_results/"
+
func_name
.
split
(
'.'
)[
0
]
+
".png"
)
def
main
():
def
plot_all
():
print
(
'loading data...'
)
data
=
load_data
()
print
(
'data loaded'
)
for
k
in
data
.
keys
():
print
(
'plotting for '
+
k
+
'...'
)
plot
(
k
,
data
)
main
()
\ No newline at end of file
if
__name__
==
"__main__"
:
plot_all
()
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment