From 0623a281998ee1d7a62c3f904f76888446cb237a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 6 Mar 2019 13:20:52 +0100 Subject: add allocators to globalvars; kill mysql server on exit; save libc versions of requirements --- bench.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'bench.py') diff --git a/bench.py b/bench.py index 6ca4a90..1db8ca0 100755 --- a/bench.py +++ b/bench.py @@ -6,7 +6,6 @@ import importlib import os import subprocess -import src.allocators import src.facter import src.globalvars from src.util import * @@ -62,6 +61,7 @@ def main(): subprocess.run(make_cmd) + # Default allocator definition file allocators_file = os.path.join("build", "allocators", "allocators.py") if args.allocators or os.path.isfile(allocators_file): @@ -69,12 +69,17 @@ def main(): src.globalvars.allocators_file = allocators_file with open(allocators_file, "r") as f: - print_status("Sourcing allocators definition ...") + print_status("Sourcing allocators definitions at", allocators_file, + "...") g = {} exec(f.read(), g) - src.allocators.allocators = g["allocators"] + src.globalvars.allocators = g["allocators"] + else: + print_status("Using system-wide installed allocators ...") + # Normal import fails + importlib.import_module('src.allocators') - print_info("Allocators:", *src.allocators.allocators.keys()) + print_info("Allocators:", *src.globalvars.allocators.keys()) # Create result directory if we save or summarize results need_resultdir = not (args.nosum and args.dont_save) @@ -82,11 +87,10 @@ def main(): if args.resultdir: resdir = os.path.join(args.resultdir) else: - hostname = src.facter.get_hostname() # TODO use saved hostname if args.load and args.runs < 2: pass - resdir = os.path.join("results", hostname, + resdir = os.path.join("results", src.globalvars.facts["hostname"], datetime.datetime.now().strftime("%Y-%m-%dT%H:%M")) try: print_info2("Creating result dir:", resdir) -- cgit v1.2.3