From 60b860ce3619d5f165bf8eda6ad596d5d458d1e2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 11 Feb 2020 13:23:55 +0100 Subject: move plotting code from src.benchmark to src.plots --- src/benchmarks/blowup.py | 12 ++++++----- src/benchmarks/cfrac.py | 26 +++++++++++++---------- src/benchmarks/espresso.py | 30 ++++++++++++++------------ src/benchmarks/falsesharing.py | 39 ++++++++++++++++++---------------- src/benchmarks/fd.py | 23 +++++++++++--------- src/benchmarks/httpd.py | 46 +++++++++++++++++++++------------------- src/benchmarks/larson.py | 15 +++++++------ src/benchmarks/lld.py | 9 ++++---- src/benchmarks/loop.py | 48 ++++++++++++++++++++++++------------------ src/benchmarks/raxmlng.py | 29 +++++++++++++------------ 10 files changed, 154 insertions(+), 123 deletions(-) (limited to 'src/benchmarks') 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