diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2018-07-21 18:23:31 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2018-07-21 18:23:31 +0200 |
| commit | 7d0ad60f314a438a5d658a863b286031d787fd62 (patch) | |
| tree | c03ab6c85a6b8fe6128e639c60b86a02f298b034 | |
| parent | 5fe4d2b94edf526ed9b53d764f2962d895f9509e (diff) | |
| download | allocbench-7d0ad60f314a438a5d658a863b286031d787fd62.tar.gz allocbench-7d0ad60f314a438a5d658a863b286031d787fd62.zip | |
don't use custom environment
| -rw-r--r-- | bench_conprod.py | 6 | ||||
| -rw-r--r-- | bench_loop.py | 6 | ||||
| -rw-r--r-- | bench_mysql.py | 10 |
3 files changed, 8 insertions, 14 deletions
diff --git a/bench_conprod.py b/bench_conprod.py index ef7676f..0ad43ed 100644 --- a/bench_conprod.py +++ b/bench_conprod.py @@ -53,16 +53,14 @@ class Benchmark_ConProd( Benchmark ): for tname, t in self.targets.items(): result = {"VSZ" : [] , "RSS" : []} - env = {"LD_PRELOAD" : t[1]} if t[1] != "" else None - if env and "LD_LIBRARY_PATH" in os.environ: - env["LD_LIBRARY_PATH"] = os.environ["LD_LIBRARY_PATH"] + os.environ["LD_PRELOAD"] = t[1] target_cmd = cmd.format(t[0], *args).split(" ") if verbose: print("\n" + tname, t, "\n", " ".join(target_cmd), "\n") p = subprocess.Popen(target_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, - env=env, universal_newlines=True) + universal_newlines=True) while p.poll() == None: ps = subprocess.run(["ps", "-F", "--ppid", str(p.pid)], stdout=subprocess.PIPE) diff --git a/bench_loop.py b/bench_loop.py index 6724890..c0162e3 100644 --- a/bench_loop.py +++ b/bench_loop.py @@ -54,16 +54,14 @@ class Benchmark_Loop( Benchmark ): for tname, t in self.targets.items(): result = {"VSZ": [], "RSS" : []} - env = {"LD_PRELOAD" : t[1]} if t[1] != "" else None - if env and "LD_LIBRARY_PATH" in os.environ: - env["LD_LIBRARY_PATH"] = os.environ["LD_LIBRARY_PATH"] + os.environ["LD_PRELOAD"] = t[1] target_cmd = cmd.format(t[0], *args).split(" ") if verbose: print("\n" + tname, t, "\n", " ".join(target_cmd), "\n") p = subprocess.Popen(target_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, - env=env, universal_newlines=True) + universal_newlines=True) while p.poll() == None: ps = subprocess.run(["ps", "-F", "--ppid", str(p.pid)], stdout=subprocess.PIPE) diff --git a/bench_mysql.py b/bench_mysql.py index 7127317..f4e56e9 100644 --- a/bench_mysql.py +++ b/bench_mysql.py @@ -36,12 +36,12 @@ class Benchmark_MYSQL( Benchmark ): self.results = {"args": {"nthreads" : self.nthreads}, "targets" : self.targets} - def start_and_wait_for_server(self, env, verbose, log=None): + def start_and_wait_for_server(self, verbose, log=None): if not log: log = os.devnull with open(log, "ab") as f: - self.server = subprocess.Popen(server_cmd, env=env, + self.server = subprocess.Popen(server_cmd, stdout=f, stderr=f, universal_newlines=True) @@ -95,11 +95,9 @@ class Benchmark_MYSQL( Benchmark ): n = len(self.nthreads) for tname, t in self.targets.items(): # No custom build mysqld server supported yet. - env = {"LD_PRELOAD" : t[1]} if t[1] != "" else None - if env and "LD_LIBRARY_PATH" in os.environ: - env["LD_LIBRARY_PATH"] = os.environ["LD_LIBRARY_PATH"] + os.environ["LD_PRELOAD"] = t[1] # set LD_PRELOAD - if not self.start_and_wait_for_server(env, verbose, "mysqld.log"): + if not self.start_and_wait_for_server(verbose, "mysqld.log"): print("Can't start server for", tname + ".") print("Aborting Benchmark.") return False |
