diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-03-06 13:20:52 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-03-06 13:20:52 +0100 |
| commit | 0623a281998ee1d7a62c3f904f76888446cb237a (patch) | |
| tree | dee8d03233c2d867106e9d4a346ca12742afc8c8 /src/benchmark.py | |
| parent | 6027198427d77ae48932104eed2615968ae74616 (diff) | |
| download | allocbench-0623a281998ee1d7a62c3f904f76888446cb237a.tar.gz allocbench-0623a281998ee1d7a62c3f904f76888446cb237a.zip | |
add allocators to globalvars; kill mysql server on exit; save libc versions of requirements
Diffstat (limited to 'src/benchmark.py')
| -rw-r--r-- | src/benchmark.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/benchmark.py b/src/benchmark.py index 18934f7..7d3207f 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -9,7 +9,6 @@ import pickle import shutil import subprocess -from src.allocators import allocators import src.globalvars from src.util import * @@ -25,7 +24,7 @@ class Benchmark (object): "measure_cmd": "perf stat -x, -d", "cmd": "true", - "allocators": allocators, + "allocators": src.globalvars.allocators, } @staticmethod @@ -41,7 +40,7 @@ class Benchmark (object): steps = 10 # Special thread counts - nthreads = set([1, cpus/2, cpus, cpus*factor]) + nthreads = set([1, int(cpus/2), cpus, cpus*factor]) nthreads.update(range(steps, cpus * factor + 1, steps)) nthreads = list(nthreads) nthreads.sort() @@ -64,6 +63,7 @@ class Benchmark (object): self.results = {} self.results["args"] = self.args self.results["allocators"] = self.allocators + self.results["facts"] = {"libcs": {}} self.results.update({t: {} for t in self.allocators}) if not hasattr(self, "requirements"): @@ -125,13 +125,17 @@ class Benchmark (object): if not is_exe(r): print_error("requirement:", r, "not found") return False + else: + self.results["facts"]["libcs"][exe_file] = src.facter.get_libc_version(bin=exe_file) # Search in PATH else: found = False for path in os.environ["PATH"].split(os.pathsep): exe_file = os.path.join(path, r) if is_exe(exe_file): + self.results["facts"]["libcs"][exe_file] = src.facter.get_libc_version(bin=exe_file) found = True + break if not found: print_error("requirement:", r, "not found") |
