diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-07-13 12:01:19 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-07-13 12:01:19 +0200 |
| commit | cfc16837f6350844b3f3043118685e4f310f8b0e (patch) | |
| tree | dce1d82b4d23b1227abc6ebe78ddb8664ec59258 | |
| parent | f017841a59b7aca49f8cdc9fe8cb70ab146bd6c5 (diff) | |
| download | allocbench-cfc16837f6350844b3f3043118685e4f310f8b0e.tar.gz allocbench-cfc16837f6350844b3f3043118685e4f310f8b0e.zip | |
[benchmarks] add/fix docstrings and remove unused imports
| -rw-r--r-- | allocbench/benchmarks/cfrac.py | 3 | ||||
| -rw-r--r-- | allocbench/benchmarks/espresso.py | 2 | ||||
| -rw-r--r-- | allocbench/benchmarks/falsesharing.py | 3 | ||||
| -rw-r--r-- | allocbench/benchmarks/httpd.py | 1 | ||||
| -rw-r--r-- | allocbench/benchmarks/keydb.py | 2 | ||||
| -rw-r--r-- | allocbench/benchmarks/larson.py | 1 | ||||
| -rw-r--r-- | allocbench/benchmarks/loop.py | 1 | ||||
| -rw-r--r-- | allocbench/benchmarks/mysql.py | 3 | ||||
| -rw-r--r-- | allocbench/benchmarks/raxmlng.py | 2 | ||||
| -rw-r--r-- | allocbench/benchmarks/rdtsc.py | 1 | ||||
| -rw-r--r-- | allocbench/benchmarks/redis.py | 2 |
11 files changed, 15 insertions, 6 deletions
diff --git a/allocbench/benchmarks/cfrac.py b/allocbench/benchmarks/cfrac.py index e6a2caf..e185084 100644 --- a/allocbench/benchmarks/cfrac.py +++ b/allocbench/benchmarks/cfrac.py @@ -15,7 +15,8 @@ # You should have received a copy of the GNU General Public License # along with allocbench. If not, see <http://www.gnu.org/licenses/>. """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. +described by Zorn and Grunwald in their paper "Empirical Measurements of Six Allocation-intensive +C Programs" in 1992. It is mentioned in: * Dirk Grunwald et al. - 1992 - CustoMalloc: Efficient Synthesized Memory Allocators diff --git a/allocbench/benchmarks/espresso.py b/allocbench/benchmarks/espresso.py index 4ed87f5..4143b61 100644 --- a/allocbench/benchmarks/espresso.py +++ b/allocbench/benchmarks/espresso.py @@ -55,8 +55,6 @@ The relevant non functional allocator properties are the raw speed of the API function as well as memory placement strategies with good data locality. """ -import os - from allocbench.benchmark import Benchmark from allocbench.directories import get_allocbench_benchmark_src_dir diff --git a/allocbench/benchmarks/falsesharing.py b/allocbench/benchmarks/falsesharing.py index 309c17d..ba91fe5 100644 --- a/allocbench/benchmarks/falsesharing.py +++ b/allocbench/benchmarks/falsesharing.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see <http://www.gnu.org/licenses/>. -"""Definition of the falsesahring benchmark""" +"""Definition of the falsesharing benchmark""" import re @@ -45,6 +45,7 @@ class BenchmarkFalsesharing(Benchmark): @staticmethod def process_output(result, stdout, stderr, allocator, perm): # pylint: disable=too-many-arguments, unused-argument + """Extract and store the needed time from stdout""" result["time"] = TIME_RE.match(stdout).group("time") def summary(self): diff --git a/allocbench/benchmarks/httpd.py b/allocbench/benchmarks/httpd.py index 8ce7002..5850e81 100644 --- a/allocbench/benchmarks/httpd.py +++ b/allocbench/benchmarks/httpd.py @@ -53,6 +53,7 @@ class BenchmarkHTTPD(Benchmark): @staticmethod def process_output(result, stdout, stderr, allocator, perm): # pylint: disable=too-many-arguments, unused-argument + """Extract total time and handled requests from ab's output""" result["time"] = re.search( "Time taken for tests:\\s*(\\d*\\.\\d*) seconds", stdout).group(1) result["requests"] = re.search( diff --git a/allocbench/benchmarks/keydb.py b/allocbench/benchmarks/keydb.py index 4aa9914..12023fc 100644 --- a/allocbench/benchmarks/keydb.py +++ b/allocbench/benchmarks/keydb.py @@ -96,6 +96,7 @@ class BenchmarkKeyDB(Benchmark): @staticmethod def process_output(result, stdout, stderr, allocator, perm): # pylint: disable=too-many-arguments, unused-argument + """Extract measured values from memtier""" cmds = ["Sets", "Gets", "Waits", "Totals"] stats = ["ops", "hits", "misses", "latency", "throughput"] for line in stdout.splitlines(): @@ -108,6 +109,7 @@ class BenchmarkKeyDB(Benchmark): @staticmethod def cleanup(): + """Remove regular database dump if needed""" if os.path.exists("dump.rdb"): os.remove("dump.rdb") diff --git a/allocbench/benchmarks/larson.py b/allocbench/benchmarks/larson.py index 2b7bfc8..78bd347 100644 --- a/allocbench/benchmarks/larson.py +++ b/allocbench/benchmarks/larson.py @@ -72,6 +72,7 @@ class BenchmarkLarson(Benchmark): @staticmethod def process_output(result, stdout, stderr, target, perm): # pylint: disable=too-many-arguments, unused-argument + """Extract and store throughput from larson's output""" for line in stdout.splitlines(): res = THROUGHPUT_RE.match(line) if res: diff --git a/allocbench/benchmarks/loop.py b/allocbench/benchmarks/loop.py index bbfbb52..b4dd26e 100644 --- a/allocbench/benchmarks/loop.py +++ b/allocbench/benchmarks/loop.py @@ -57,6 +57,7 @@ class BenchmarkLoop(Benchmark): @staticmethod def process_output(result, stdout, stderr, alloc, perm): # pylint: disable=too-many-arguments, unused-argument + """Calculate million operation per second from the total run time""" result["mops"] = perm.threads / float(result["task-clock"]) def summary(self): diff --git a/allocbench/benchmarks/mysql.py b/allocbench/benchmarks/mysql.py index bf6d100..be5c435 100644 --- a/allocbench/benchmarks/mysql.py +++ b/allocbench/benchmarks/mysql.py @@ -78,8 +78,6 @@ import shutil from subprocess import CalledProcessError import sys -import numpy as np - from allocbench.benchmark import Benchmark import allocbench.facter as facter from allocbench.util import print_status, print_debug, print_info2, print_warn, run_cmd @@ -187,6 +185,7 @@ class BenchmarkMYSQL(Benchmark): @staticmethod def process_output(result, stdout, stderr, allocator, perm): # pylint: disable=too-many-arguments, unused-argument + """Extract transactions and descriptive statistics from sysbench's output""" result["transactions"] = re.search("transactions:\\s*(\\d*)", stdout).group(1) result["queries"] = re.search("queries:\\s*(\\d*)", stdout).group(1) diff --git a/allocbench/benchmarks/raxmlng.py b/allocbench/benchmarks/raxmlng.py index 1935cf0..924ad04 100644 --- a/allocbench/benchmarks/raxmlng.py +++ b/allocbench/benchmarks/raxmlng.py @@ -73,12 +73,14 @@ class BenchmarkRaxmlng(Benchmark): @staticmethod def cleanup(): + """Delete data written to the file system""" for direntry in os.listdir(): if direntry.startswith("prim.raxml"): os.remove(direntry) @staticmethod def process_output(result, stdout, stderr, allocator, perm): # pylint: disable=too-many-arguments, unused-argument, no-self-use + """extract the runtime from raxmlng's output""" result["runtime"] = RUNTIME_RE.search(stdout).group("runtime") def summary(self): diff --git a/allocbench/benchmarks/rdtsc.py b/allocbench/benchmarks/rdtsc.py index 5a85bde..943d76a 100644 --- a/allocbench/benchmarks/rdtsc.py +++ b/allocbench/benchmarks/rdtsc.py @@ -45,6 +45,7 @@ class BenchmarkRdtsc(Benchmark): @staticmethod def process_output(result, stdout, stderr, alloc, perm): # pylint: disable=too-many-arguments, unused-argument + """Collect cycles needed during all iterations and calcullate mean""" all_cycles = [] for line in stdout.splitlines(): all_cycles.append(int(line.split()[1])) diff --git a/allocbench/benchmarks/redis.py b/allocbench/benchmarks/redis.py index a6c6530..f00efe8 100644 --- a/allocbench/benchmarks/redis.py +++ b/allocbench/benchmarks/redis.py @@ -72,10 +72,12 @@ class BenchmarkRedis(Benchmark): @staticmethod def process_output(result, stdout, stderr, allocator, perm): # pylint: disable=too-many-arguments, unused-argument + """Extract handled requests from redis-bench""" result["requests"] = REQUESTS_RE.search(stdout).group("requests") @staticmethod def cleanup(): + """Remove regular database dump if needed""" if os.path.exists("dump.rdb"): os.remove("dump.rdb") |
