aboutsummaryrefslogtreecommitdiff
path: root/src/benchmarks
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-02-11 13:23:55 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-02-11 13:23:55 +0100
commit60b860ce3619d5f165bf8eda6ad596d5d458d1e2 (patch)
tree595626c7efb43dedbe30753357fa64383056357f /src/benchmarks
parent9e2d7eb1cb952b398bd7363ab95ea9f1d4598ab1 (diff)
downloadallocbench-60b860ce3619d5f165bf8eda6ad596d5d458d1e2.tar.gz
allocbench-60b860ce3619d5f165bf8eda6ad596d5d458d1e2.zip
move plotting code from src.benchmark to src.plots
Diffstat (limited to 'src/benchmarks')
-rw-r--r--src/benchmarks/blowup.py12
-rw-r--r--src/benchmarks/cfrac.py26
-rw-r--r--src/benchmarks/espresso.py30
-rw-r--r--src/benchmarks/falsesharing.py39
-rw-r--r--src/benchmarks/fd.py23
-rw-r--r--src/benchmarks/httpd.py46
-rw-r--r--src/benchmarks/larson.py15
-rw-r--r--src/benchmarks/lld.py9
-rw-r--r--src/benchmarks/loop.py48
-rw-r--r--src/benchmarks/raxmlng.py29
10 files changed, 154 insertions, 123 deletions
diff --git a/src/benchmarks/blowup.py b/src/benchmarks/blowup.py
index aca9293..8f8e550 100644
--- a/src/benchmarks/blowup.py
+++ b/src/benchmarks/blowup.py
@@ -17,6 +17,7 @@
"""Definition of the blowup micro benchmark"""
from src.benchmark import Benchmark
+import src.plots as plt
class BenchmarkBlowup(Benchmark):
@@ -53,15 +54,16 @@ class BenchmarkBlowup(Benchmark):
}
}
- self.barplot_single_arg("{VmHWM}/1000",
- ylabel='"VmHWM in MB"',
- title='"blowup test"',
- filepostfix="vmhwm")
+ plt.barplot_single_arg(self,
+ "{VmHWM}/1000",
+ ylabel='"VmHWM in MB"',
+ title='"blowup test"',
+ filepostfix="vmhwm")
del allocators["Ideal-RSS"]
del self.results["stats"]["Ideal-RSS"]
- self.export_stats_to_dataref("VmHWM")
+ plt.export_stats_to_dataref(self, "VmHWM")
blowup = BenchmarkBlowup()
diff --git a/src/benchmarks/cfrac.py b/src/benchmarks/cfrac.py
index dfd87d6..34c0894 100644
--- a/src/benchmarks/cfrac.py
+++ b/src/benchmarks/cfrac.py
@@ -59,6 +59,7 @@ API function as well as memory placement strategies with good data locality.
"""
from src.benchmark import Benchmark
+import src.plots as plt
class BenchmarkCfrac(Benchmark):
@@ -75,13 +76,15 @@ class BenchmarkCfrac(Benchmark):
def summary(self):
# Speed
- self.barplot_single_arg("{task-clock}/1000",
- ylabel='"cpu-second"',
- title='"Cfrac: runtime"',
- filepostfix="time")
+ plt.barplot_single_arg(self,
+ "{task-clock}/1000",
+ ylabel='"cpu-second"',
+ title='"Cfrac: runtime"',
+ filepostfix="time")
# L1 cache misses
- self.barplot_single_arg(
+ plt.barplot_single_arg(
+ self,
"({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel='"L1 misses in %"',
title='"Cfrac l1 cache misses"',
@@ -89,10 +92,11 @@ class BenchmarkCfrac(Benchmark):
yerr=False)
# Memusage
- self.barplot_single_arg("{VmHWM}",
- ylabel='"VmHWM in KB"',
- title='"Cfrac VmHWM"',
- filepostfix="vmhwm")
+ plt.barplot_single_arg(self,
+ "{VmHWM}",
+ ylabel='"VmHWM in KB"',
+ title='"Cfrac VmHWM"',
+ filepostfix="vmhwm")
self.write_tex_table([{
"label": "Runtime [ms]",
@@ -105,9 +109,9 @@ class BenchmarkCfrac(Benchmark):
}],
filepostfix="table")
- self.export_stats_to_dataref("task-clock")
+ plt.export_stats_to_dataref(self, "task-clock")
- self.export_stats_to_dataref("VmHWM")
+ plt.export_stats_to_dataref(self, "VmHWM")
cfrac = BenchmarkCfrac()
diff --git a/src/benchmarks/espresso.py b/src/benchmarks/espresso.py
index 2f8b8bf..1c9d4d2 100644
--- a/src/benchmarks/espresso.py
+++ b/src/benchmarks/espresso.py
@@ -59,6 +59,7 @@ import os
from src.benchmark import Benchmark
import src.globalvars
+import src.plots as plt
class BenchmarkEspresso(Benchmark):
@@ -79,13 +80,15 @@ class BenchmarkEspresso(Benchmark):
def summary(self):
# Speed
- self.barplot_single_arg("{task-clock}/1000",
- ylabel='"cpu-second"',
- title='"Espresso: runtime"',
- filepostfix="time")
+ plt.barplot_single_arg(self,
+ "{task-clock}/1000",
+ ylabel='"cpu-second"',
+ title='"Espresso: runtime"',
+ filepostfix="time")
# L1 cache misses
- self.barplot_single_arg(
+ plt.barplot_single_arg(
+ self,
"({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel='"L1 misses in %"',
title='"Espresso l1 cache misses"',
@@ -93,12 +96,13 @@ class BenchmarkEspresso(Benchmark):
yerr=False)
# Memusage
- self.barplot_single_arg("{VmHWM}",
- ylabel='"VmHWM in KB"',
- title='"Espresso VmHWM"',
- filepostfix="vmhwm")
+ plt.barplot_single_arg(self,
+ "{VmHWM}",
+ ylabel='"VmHWM in KB"',
+ title='"Espresso VmHWM"',
+ filepostfix="vmhwm")
- self.write_tex_table([{
+ plt.write_tex_table(self, [{
"label": "Runtime [ms]",
"expression": "{task-clock}",
"sort": "<"
@@ -107,11 +111,11 @@ class BenchmarkEspresso(Benchmark):
"expression": "{VmHWM}",
"sort": "<"
}],
- filepostfix="table")
+ filepostfix="table")
- self.export_stats_to_dataref("task-clock")
+ plt.export_stats_to_dataref(self, "task-clock")
- self.export_stats_to_dataref("VmHWM")
+ plt.export_stats_to_dataref(self, "VmHWM")
espresso = BenchmarkEspresso()
diff --git a/src/benchmarks/falsesharing.py b/src/benchmarks/falsesharing.py
index 530ca99..626104a 100644
--- a/src/benchmarks/falsesharing.py
+++ b/src/benchmarks/falsesharing.py
@@ -23,6 +23,7 @@ import numpy as np
from src.benchmark import Benchmark
from src.globalvars import summary_file_ext
+import src.plots as plt
TIME_RE = re.compile("^Time elapsed = (?P<time>\\d*\\.\\d*) seconds.$")
@@ -78,14 +79,16 @@ class BenchmarkFalsesharing(Benchmark):
del self.results["stats"]
self.calc_desc_statistics()
- self.plot_fixed_arg("{speedup}",
- ylabel="'Speedup'",
- title="'Speedup: ' + arg + ' ' + str(arg_value)",
- filepostfix="speedup",
- autoticks=False,
- fixed=["bench"])
+ plt.plot_fixed_arg(self,
+ "{speedup}",
+ ylabel="'Speedup'",
+ title="'Speedup: ' + arg + ' ' + str(arg_value)",
+ filepostfix="speedup",
+ autoticks=False,
+ fixed=["bench"])
- self.plot_fixed_arg(
+ plt.plot_fixed_arg(
+ self,
"{l1chache_misses}",
ylabel="'l1 cache misses in %'",
title="'cache misses: ' + arg + ' ' + str(arg_value)",
@@ -93,23 +96,23 @@ class BenchmarkFalsesharing(Benchmark):
autoticks=False,
fixed=["bench"])
- self.plot_fixed_arg(
- "({LLC-load-misses}/{LLC-loads})*100",
- ylabel="'llc cache misses in %'",
- title="'LLC misses: ' + arg + ' ' + str(arg_value)",
- filepostfix="llc-misses",
- autoticks=False,
- fixed=["bench"])
+ plt.plot_fixed_arg(self,
+ "({LLC-load-misses}/{LLC-loads})*100",
+ ylabel="'llc cache misses in %'",
+ title="'LLC misses: ' + arg + ' ' + str(arg_value)",
+ filepostfix="llc-misses",
+ autoticks=False,
+ fixed=["bench"])
- self.write_tex_table([{
+ plt.write_tex_table(self, [{
"label": "Speedup",
"expression": "{speedup}",
"sort": ">"
}],
- filepostfix="speedup.table")
+ filepostfix="speedup.table")
- self.export_stats_to_csv("speedup", "time")
- self.export_stats_to_csv("l1chache_misses", "l1-misses")
+ plt.export_stats_to_csv(self, "speedup", "time")
+ plt.export_stats_to_csv(self, "l1chache_misses", "l1-misses")
falsesharing = BenchmarkFalsesharing()
diff --git a/src/benchmarks/fd.py b/src/benchmarks/fd.py
index 4fab958..bede21a 100644
--- a/src/benchmarks/fd.py
+++ b/src/benchmarks/fd.py
@@ -22,6 +22,7 @@ from urllib.request import urlretrieve
from src.artifact import ArchiveArtifact, GitArtifact
from src.benchmark import Benchmark
+import src.plots as plt
from src.util import print_info
@@ -66,19 +67,21 @@ class BenchmarkFd(Benchmark):
os.link(src, dest)
def summary(self):
- self.barplot_single_arg("{task-clock}",
- ylabel='"runtime in ms"',
- title='"fd runtime"',
- filepostfix="runtime")
+ plt.barplot_single_arg(self,
+ "{task-clock}",
+ ylabel='"runtime in ms"',
+ title='"fd runtime"',
+ filepostfix="runtime")
- self.export_stats_to_dataref("task-clock")
+ plt.export_stats_to_dataref(self, "task-clock")
- self.barplot_single_arg("{VmHWM}",
- ylabel='"VmHWM in KB"',
- title='"fd memusage"',
- filepostfix="memusage")
+ plt.barplot_single_arg(self,
+ "{VmHWM}",
+ ylabel='"VmHWM in KB"',
+ title='"fd memusage"',
+ filepostfix="memusage")
- self.export_stats_to_dataref("VmHWM")
+ plt.export_stats_to_dataref(self, "VmHWM")
fd = BenchmarkFd()
diff --git a/src/benchmarks/httpd.py b/src/benchmarks/httpd.py
index 64f8e11..2a848c5 100644
--- a/src/benchmarks/httpd.py
+++ b/src/benchmarks/httpd.py
@@ -20,6 +20,7 @@ import re
from src.benchmark import Benchmark
import src.facter
+import src.plots as plt
class BenchmarkHTTPD(Benchmark):
@@ -59,28 +60,29 @@ class BenchmarkHTTPD(Benchmark):
"Requests per second:\\s*(\\d*\\.\\d*) .*", stdout).group(1)
def summary(self):
- allocators = self.results["allocators"]
-
- self.plot_fixed_arg("{requests}",
- xlabel='"threads"',
- ylabel='"requests/s"',
- autoticks=False,
- filepostfix="requests",
- title='perm.site + ": requests/s"')
-
- self.plot_fixed_arg("{nginx_vmhwm}",
- xlabel='"threads"',
- ylabel='"VmHWM in KB"',
- title='perm.site + ": nginx memory usage"',
- filepostfix="httpd_vmhwm",
- autoticks=False)
-
- self.plot_fixed_arg("{php-fpm_vmhwm}",
- xlabel='"threads"',
- ylabel='"VmHWM in KB"',
- title='perm.site + ": php-fpm memory usage"',
- filepostfix="php-fpm_vmhwm",
- autoticks=False)
+ plt.plot_fixed_arg(self,
+ "{requests}",
+ xlabel='"threads"',
+ ylabel='"requests/s"',
+ autoticks=False,
+ filepostfix="requests",
+ title='perm.site + ": requests/s"')
+
+ plt.plot_fixed_arg(self,
+ "{nginx_vmhwm}",
+ xlabel='"threads"',
+ ylabel='"VmHWM in KB"',
+ title='perm.site + ": nginx memory usage"',
+ filepostfix="httpd_vmhwm",
+ autoticks=False)
+
+ plt.plot_fixed_arg(self,
+ "{php-fpm_vmhwm}",
+ xlabel='"threads"',
+ ylabel='"VmHWM in KB"',
+ title='perm.site + ": php-fpm memory usage"',
+ filepostfix="php-fpm_vmhwm",
+ autoticks=False)
httpd = BenchmarkHTTPD()
diff --git a/src/benchmarks/larson.py b/src/benchmarks/larson.py
index 6e55fbe..8fce9ed 100644
--- a/src/benchmarks/larson.py
+++ b/src/benchmarks/larson.py
@@ -48,6 +48,7 @@ false sharing because it uses multiple threads, which pass memory around.
import re
from src.benchmark import Benchmark
+import src.plots as plt
THROUGHPUT_RE = re.compile(
"^Throughput =\\s*(?P<throughput>\\d+) operations per second.$")
@@ -80,12 +81,14 @@ class BenchmarkLarson(Benchmark):
def summary(self):
# Plot threads->throughput and maxsize->throughput
- self.plot_fixed_arg("{throughput}/1000000",
- ylabel="'MOPS/s'",
- title="'Larson: ' + arg + ' ' + str(arg_value)",
- filepostfix="throughput")
-
- self.plot_fixed_arg(
+ plt.plot_fixed_arg(self,
+ "{throughput}/1000000",
+ ylabel="'MOPS/s'",
+ title="'Larson: ' + arg + ' ' + str(arg_value)",
+ filepostfix="throughput")
+
+ plt.plot_fixed_arg(
+ self,
"({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel="'l1 cache misses in %'",
title="'Larson cache misses: ' + arg + ' ' + str(arg_value)",
diff --git a/src/benchmarks/lld.py b/src/benchmarks/lld.py
index 3657896..b2da35b 100644
--- a/src/benchmarks/lld.py
+++ b/src/benchmarks/lld.py
@@ -204,6 +204,7 @@ import matplotlib.pyplot as plt
from src.artifact import ArchiveArtifact
from src.benchmark import Benchmark
import src.facter
+import src.plots
from src.globalvars import summary_file_ext
@@ -283,17 +284,17 @@ class BenchmarkLld(Benchmark):
plt.clf()
# self.export_stats_to_csv("VmHWM")
- self.export_stats_to_csv("task-clock")
+ src.plots.export_stats_to_csv("task-clock")
# self.export_stats_to_dataref("VmHWM")
- self.export_stats_to_dataref("task-clock")
+ src.plots.export_stats_to_dataref("task-clock")
- self.write_tex_table([{
+ src.plots.write_tex_table([{
"label": "Runtime [ms]",
"expression": "{task-clock}",
"sort": "<"
}],
- filepostfix="table")
+ filepostfix="table")
lld = BenchmarkLld()
diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py
index a969f4a..75c56ee 100644
--- a/src/benchmarks/loop.py
+++ b/src/benchmarks/loop.py
@@ -35,6 +35,7 @@ Interpretation:
"""
from src.benchmark import Benchmark
+import src.plots as plt
class BenchmarkLoop(Benchmark):
@@ -57,14 +58,16 @@ class BenchmarkLoop(Benchmark):
def summary(self):
# Speed
- self.plot_fixed_arg("perm.nthreads / ({task-clock}/1000)",
- ylabel='"MOPS/cpu-second"',
- title='"Loop: " + arg + " " + str(arg_value)',
- filepostfix="time",
- autoticks=False)
+ plt.plot_fixed_arg(self,
+ "perm.nthreads / ({task-clock}/1000)",
+ ylabel='"MOPS/cpu-second"',
+ title='"Loop: " + arg + " " + str(arg_value)',
+ filepostfix="time",
+ autoticks=False)
# L1 cache misses
- self.plot_fixed_arg(
+ plt.plot_fixed_arg(
+ self,
"({L1-dcache-load-misses}/{L1-dcache-loads})*100",
ylabel='"L1 misses in %"',
title='"Loop l1 cache misses: " + arg + " " + str(arg_value)',
@@ -72,29 +75,34 @@ class BenchmarkLoop(Benchmark):
autoticks=False)
# Speed Matrix
- self.write_best_doublearg_tex_table(
- "perm.nthreads / ({task-clock}/1000)", filepostfix="time.matrix")
+ plt.write_best_doublearg_tex_table(
+ self,
+ "perm.nthreads / ({task-clock}/1000)",
+ filepostfix="time.matrix")
- self.write_tex_table([{
+ plt.write_tex_table(self, [{
"label": "MOPS/s",
"expression": "perm.nthreads / ({task-clock}/1000)",
"sort": ">"
}],
- filepostfix="mops.table")
+ filepostfix="mops.table")
- self.export_stats_to_csv("task-clock")
- self.export_stats_to_dataref("task-clock")
+ plt.export_stats_to_csv(self, "task-clock")
+ plt.export_stats_to_dataref(self, "task-clock")
# pgfplot test
- self.pgfplot_linear(self.iterate_args_fixed({"maxsize": 1024}, args=self.results["args"]),
- "int(perm.nthreads)",
- "perm.nthreads / ({task-clock}/1000)",
- xlabel='"Threads"',
- ylabel='"MOPS/cpu-second"',
- title='"Loop: 1024B"',
- postfix='mops_1024B')
+ plt.pgfplot_linear(self,
+ self.iterate_args_fixed({"maxsize": 1024},
+ args=self.results["args"]),
+ "int(perm.nthreads)",
+ "perm.nthreads / ({task-clock}/1000)",
+ xlabel='"Threads"',
+ ylabel='"MOPS/cpu-second"',
+ title='"Loop: 1024B"',
+ postfix='mops_1024B')
# create pgfplot legend
- self.pgfplot_legend()
+ plt.pgfplot_legend(self)
+
loop = BenchmarkLoop()
diff --git a/src/benchmarks/raxmlng.py b/src/benchmarks/raxmlng.py
index 05a6ca7..228c220 100644
--- a/src/benchmarks/raxmlng.py
+++ b/src/benchmarks/raxmlng.py
@@ -18,11 +18,10 @@
import os
import re
-import sys
-from urllib.request import urlretrieve
from src.artifact import GitArtifact
from src.benchmark import Benchmark
+import src.plots as plt
from src.util import print_info, run_cmd
RUNTIME_RE = re.compile("Elapsed time: (?P<runtime>(\\d*.\\d*)) seconds")
@@ -58,8 +57,8 @@ class BenchmarkRaxmlng(Benchmark):
os.makedirs(raxmlng_builddir, exist_ok=True)
# building raxml-ng
- run_cmd( ["cmake", ".."], cwd=raxmlng_builddir)
- run_cmd( ["make"], cwd=raxmlng_builddir)
+ run_cmd(["cmake", ".."], cwd=raxmlng_builddir)
+ run_cmd(["make"], cwd=raxmlng_builddir)
# create symlinks
for exe in ["raxml-ng"]:
@@ -83,19 +82,21 @@ class BenchmarkRaxmlng(Benchmark):
result["runtime"] = RUNTIME_RE.search(stdout).group("runtime")
def summary(self):
- self.barplot_single_arg("{runtime}",
- ylabel='"runtime in s"',
- title='"raxml-ng tree inference benchmark"',
- filepostfix="runtime")
+ plt.barplot_single_arg(self,
+ "{runtime}",
+ ylabel='"runtime in s"',
+ title='"raxml-ng tree inference benchmark"',
+ filepostfix="runtime")
- self.export_stats_to_dataref("runtime")
+ plt.export_stats_to_dataref(self, "runtime")
- self.barplot_single_arg("{VmHWM}",
- ylabel='"VmHWM in KB"',
- title='"raxml-ng memusage"',
- filepostfix="memusage")
+ plt.barplot_single_arg(self,
+ "{VmHWM}",
+ ylabel='"VmHWM in KB"',
+ title='"raxml-ng memusage"',
+ filepostfix="memusage")
- self.export_stats_to_dataref("VmHWM")
+ plt.export_stats_to_dataref(self, "VmHWM")
raxmlng = BenchmarkRaxmlng()