aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-08-26 18:11:31 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-08-26 18:11:31 +0200
commit7561d43ee606bb402d50aad78fcc4ad53274d3cd (patch)
tree280e297abc3e227e7c40f4fe65bcd57f1b9348f3
parentfdf1371bb0c1aa4432e33f91811068d2786ecda8 (diff)
downloadallocbench-7561d43ee606bb402d50aad78fcc4ad53274d3cd.tar.gz
allocbench-7561d43ee606bb402d50aad78fcc4ad53274d3cd.zip
add error bars to barplot_single_arg
-rw-r--r--src/benchmark.py11
-rw-r--r--src/benchmarks/cfrac.py3
-rw-r--r--src/benchmarks/espresso.py3
-rw-r--r--src/benchmarks/larson.py3
-rw-r--r--src/benchmarks/lld.py4
-rw-r--r--src/benchmarks/loop.py3
-rw-r--r--src/benchmarks/t_test1.py3
7 files changed, 22 insertions, 8 deletions
diff --git a/src/benchmark.py b/src/benchmark.py
index dddee69..46177a7 100644
--- a/src/benchmark.py
+++ b/src/benchmark.py
@@ -514,7 +514,7 @@ class Benchmark (object):
def barplot_single_arg(self, yval, ylabel="'y-label'", xlabel="'x-label'",
title="'default title'", filepostfix="", sumdir="",
- arg="", scale=None, file_ext="png"):
+ arg="", scale=None, file_ext="png", yerr=True):
args = self.results["args"]
allocators = self.results["allocators"]
@@ -526,6 +526,10 @@ class Benchmark (object):
for i, allocator in enumerate(allocators):
x_vals = list(range(i, narg * (nallocators+1), nallocators+1))
y_vals = []
+ y_errs = None
+ if yerr:
+ y_errs = []
+
for perm in self.iterate_args(args=args):
if scale:
if scale == allocator:
@@ -537,7 +541,10 @@ class Benchmark (object):
else:
y_vals.append(eval(yval.format(**self.results["stats"][allocator][perm]["mean"])))
- plt.bar(x_vals, y_vals, width=1, label=allocator,
+ if yerr:
+ y_errs.append(eval(yval.format(**self.results["stats"][allocator][perm]["std"])))
+
+ plt.bar(x_vals, y_vals, width=1, label=allocator, yerr=y_errs,
color=allocators[allocator]["color"])
plt.legend(loc="best")
diff --git a/src/benchmarks/cfrac.py b/src/benchmarks/cfrac.py
index cc24945..44bd213 100644
--- a/src/benchmarks/cfrac.py
+++ b/src/benchmarks/cfrac.py
@@ -23,7 +23,8 @@ class Benchmark_Cfrac(Benchmark):
self.barplot_single_arg("({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel='"L1 misses in %"',
title='"Cfrac l1 cache misses"',
- filepostfix="l1misses")
+ filepostfix="l1misses",
+ yerr=False)
# Memusage
self.barplot_single_arg("{VmHWM}",
diff --git a/src/benchmarks/espresso.py b/src/benchmarks/espresso.py
index d8470aa..b06d823 100644
--- a/src/benchmarks/espresso.py
+++ b/src/benchmarks/espresso.py
@@ -26,7 +26,8 @@ class Benchmark_Espresso(Benchmark):
self.barplot_single_arg("({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel='"L1 misses in %"',
title='"Espresso l1 cache misses"',
- filepostfix="l1misses")
+ filepostfix="l1misses",
+ yerr=False)
# Memusage
self.barplot_single_arg("{VmHWM}",
diff --git a/src/benchmarks/larson.py b/src/benchmarks/larson.py
index a5c4a02..5ff74fb 100644
--- a/src/benchmarks/larson.py
+++ b/src/benchmarks/larson.py
@@ -43,7 +43,8 @@ class Benchmark_Larson(Benchmark):
self.plot_fixed_arg("({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel="'l1 cache misses in %'",
title="'Larson cache misses: ' + arg + ' ' + str(arg_value)",
- filepostfix="cachemisses")
+ filepostfix="cachemisses",
+ yerr=False)
larson = Benchmark_Larson()
diff --git a/src/benchmarks/lld.py b/src/benchmarks/lld.py
index 9dad6cc..1575ddd 100644
--- a/src/benchmarks/lld.py
+++ b/src/benchmarks/lld.py
@@ -78,7 +78,9 @@ class BenchmarkLld(Benchmark):
for perm in self.iterate_args(args=args):
for i, allocator in enumerate(allocators):
- plt.bar([i], self.results["stats"][allocator][perm]["mean"]["task-clock"],
+ plt.bar([i],
+ self.results["stats"][allocator][perm]["mean"]["task-clock"],
+ yerr=self.results["stats"][allocator][perm]["std"]["task-clock"],
label=allocator, color=allocators[allocator]["color"])
plt.legend(loc="best")
diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py
index 58d4935..80aadae 100644
--- a/src/benchmarks/loop.py
+++ b/src/benchmarks/loop.py
@@ -40,7 +40,8 @@ class Benchmark_Loop(Benchmark):
ylabel='"L1 misses in %"',
title='"Loop l1 cache misses: " + arg + " " + str(arg_value)',
filepostfix="l1misses",
- autoticks=False)
+ autoticks=False,
+ yerr=False)
# Speed Matrix
self.write_best_doublearg_tex_table("perm.nthreads / ({task-clock}/1000)",
diff --git a/src/benchmarks/t_test1.py b/src/benchmarks/t_test1.py
index a2a6e0b..03da284 100644
--- a/src/benchmarks/t_test1.py
+++ b/src/benchmarks/t_test1.py
@@ -41,7 +41,8 @@ class Benchmark_t_test1(Benchmark):
ylabel='"L1 misses in %"',
title='"T-Test1 l1 cache misses: " + arg + " " + str(arg_value)',
filepostfix="l1misses",
- autoticks=False)
+ autoticks=False,
+ yerr=False)
# Speed Matrix
self.write_best_doublearg_tex_table(yval,