From c9d168d6d45d57304c7dcbe4c5cbaf949385764c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 11 Dec 2019 21:31:38 +0100 Subject: fmt benchmark definitions with yapf --- src/benchmarks/blowup.py | 11 +++-- src/benchmarks/cfrac.py | 28 +++++++------ src/benchmarks/espresso.py | 36 ++++++++++------- src/benchmarks/falsesharing.py | 60 ++++++++++++++++------------ src/benchmarks/fd.py | 17 ++++---- src/benchmarks/larson.py | 20 +++++----- src/benchmarks/lld.py | 58 +++++++++++++++------------ src/benchmarks/loop.py | 33 ++++++++------- src/benchmarks/mysql.py | 91 ++++++++++++++++++++++++++---------------- src/benchmarks/raxmlng.py | 43 ++++++++++---------- src/benchmarks/realloc.py | 1 - src/benchmarks/redis.py | 26 ++++++------ src/benchmarks/t_test1.py | 27 +++++++------ 13 files changed, 258 insertions(+), 193 deletions(-) diff --git a/src/benchmarks/blowup.py b/src/benchmarks/blowup.py index d55a0d7..aca9293 100644 --- a/src/benchmarks/blowup.py +++ b/src/benchmarks/blowup.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Definition of the blowup micro benchmark""" from src.benchmark import Benchmark @@ -45,8 +44,14 @@ class BenchmarkBlowup(Benchmark): allocators["Ideal-RSS"] = {"color": "xkcd:gold"} self.results["stats"]["Ideal-RSS"] = {} for perm in self.iterate_args(args=self.results["args"]): - self.results["stats"]["Ideal-RSS"][perm] = {"mean": {"VmHWM": 1024 * 100}, - "std" : {"VmHWM": 0}} + self.results["stats"]["Ideal-RSS"][perm] = { + "mean": { + "VmHWM": 1024 * 100 + }, + "std": { + "VmHWM": 0 + } + } self.barplot_single_arg("{VmHWM}/1000", ylabel='"VmHWM in MB"', diff --git a/src/benchmarks/cfrac.py b/src/benchmarks/cfrac.py index e594055..dfd87d6 100644 --- a/src/benchmarks/cfrac.py +++ b/src/benchmarks/cfrac.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """cfrac is a single threaded implementation of the continued fraction factorization algorithm, described by Zorn and Grunwald in their paper "Empirical Measurements of Six Allocation-intensive C Programs" in 1992. @@ -61,6 +60,7 @@ API function as well as memory placement strategies with good data locality. from src.benchmark import Benchmark + class BenchmarkCfrac(Benchmark): """Definition of the cfrac benchmark""" def __init__(self): @@ -81,11 +81,12 @@ class BenchmarkCfrac(Benchmark): filepostfix="time") # L1 cache misses - self.barplot_single_arg("({L1-dcache-load-misses}/{L1-dcache-loads})*100", - ylabel='"L1 misses in %"', - title='"Cfrac l1 cache misses"', - filepostfix="l1misses", - yerr=False) + self.barplot_single_arg( + "({L1-dcache-load-misses}/{L1-dcache-loads})*100", + ylabel='"L1 misses in %"', + title='"Cfrac l1 cache misses"', + filepostfix="l1misses", + yerr=False) # Memusage self.barplot_single_arg("{VmHWM}", @@ -93,12 +94,15 @@ class BenchmarkCfrac(Benchmark): title='"Cfrac VmHWM"', filepostfix="vmhwm") - self.write_tex_table([{"label": "Runtime [ms]", - "expression": "{task-clock}", - "sort": "<"}, - {"label": "Memusage [KB]", - "expression": "{VmHWM}", - "sort": "<"}], + self.write_tex_table([{ + "label": "Runtime [ms]", + "expression": "{task-clock}", + "sort": "<" + }, { + "label": "Memusage [KB]", + "expression": "{VmHWM}", + "sort": "<" + }], filepostfix="table") self.export_stats_to_dataref("task-clock") diff --git a/src/benchmarks/espresso.py b/src/benchmarks/espresso.py index bd94b29..2f8b8bf 100644 --- a/src/benchmarks/espresso.py +++ b/src/benchmarks/espresso.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """espresso is a single threaded programmable logic array analyzer, described by Zorn and Grunwald their paper "Empirical Measurements of Six Allocation-intensive C Programs" in 1992. @@ -61,14 +60,19 @@ import os from src.benchmark import Benchmark import src.globalvars + class BenchmarkEspresso(Benchmark): """Definition of the espresso benchmark for allocbench""" def __init__(self): name = "espresso" self.cmd = "espresso{binary_suffix} {file}" - self.args = {"file": [os.path.join(src.globalvars.benchsrcdir, name, - "largest.espresso")]} + self.args = { + "file": [ + os.path.join(src.globalvars.benchsrcdir, name, + "largest.espresso") + ] + } self.requirements = ["espresso"] super().__init__(name) @@ -81,11 +85,12 @@ class BenchmarkEspresso(Benchmark): filepostfix="time") # L1 cache misses - self.barplot_single_arg("({L1-dcache-load-misses}/{L1-dcache-loads})*100", - ylabel='"L1 misses in %"', - title='"Espresso l1 cache misses"', - filepostfix="l1misses", - yerr=False) + self.barplot_single_arg( + "({L1-dcache-load-misses}/{L1-dcache-loads})*100", + ylabel='"L1 misses in %"', + title='"Espresso l1 cache misses"', + filepostfix="l1misses", + yerr=False) # Memusage self.barplot_single_arg("{VmHWM}", @@ -93,12 +98,15 @@ class BenchmarkEspresso(Benchmark): title='"Espresso VmHWM"', filepostfix="vmhwm") - self.write_tex_table([{"label": "Runtime [ms]", - "expression": "{task-clock}", - "sort": "<"}, - {"label": "Memusage [KB]", - "expression": "{VmHWM}", - "sort": "<"}], + self.write_tex_table([{ + "label": "Runtime [ms]", + "expression": "{task-clock}", + "sort": "<" + }, { + "label": "Memusage [KB]", + "expression": "{VmHWM}", + "sort": "<" + }], filepostfix="table") self.export_stats_to_dataref("task-clock") diff --git a/src/benchmarks/falsesharing.py b/src/benchmarks/falsesharing.py index 671dbc8..530ca99 100644 --- a/src/benchmarks/falsesharing.py +++ b/src/benchmarks/falsesharing.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Definition of the falsesahring benchmark""" import re @@ -25,7 +24,6 @@ import numpy as np from src.benchmark import Benchmark from src.globalvars import summary_file_ext - TIME_RE = re.compile("^Time elapsed = (?P