def run_single_benchmark(benchmark, **kwargs): command = 'python {}'.format(AVAILABLE_BENCHMARKS[benchmark]) log.info('Executing command {}'.format(command)) sprocess = subprocess.Popen(command, shell=True) pid = sprocess.pid monitor(pid, **kwargs) if sprocess is not None: sprocess.kill()