diff --git a/hwbench/bench/benchmark.py b/hwbench/bench/benchmark.py index 2978465..7ced393 100644 --- a/hwbench/bench/benchmark.py +++ b/hwbench/bench/benchmark.py @@ -138,7 +138,7 @@ def pre_run(self): monitoring = "(M)" print( "[{}] {}/{}/{}{}: {:3d} stressor{} for {}s{}".format( - p.get_name(), + p.get_name_with_position(), self.engine_module.get_engine().get_name(), self.engine_module.get_name(), p.get_engine_module_parameter(), diff --git a/hwbench/bench/benchmarks.py b/hwbench/bench/benchmarks.py index 4e6194f..67560a6 100644 --- a/hwbench/bench/benchmarks.py +++ b/hwbench/bench/benchmarks.py @@ -265,11 +265,9 @@ def run(self): ) # Save each benchmark result - results[ - "{}_{}".format( - benchmark.get_parameters().get_name(), benchmark.get_job_number() - ) - ] = benchmark.run() + results[benchmark.get_parameters().get_name_with_position()] = ( + benchmark.run() + ) return results def dump(self): @@ -278,7 +276,7 @@ def dump(self): engine = bench.get_enginemodule().get_engine() em = bench.get_enginemodule() param = bench.get_parameters() - print(f"[{param.get_name()}_{bench.get_job_number()}]", file=f) + print(f"[{param.get_name_with_position()}]", file=f) print(f"runtime={param.get_runtime()}", file=f) print(f"monitoring={param.get_monitoring_config()}", file=f) print(f"engine={engine.get_name()}", file=f) diff --git a/hwbench/bench/parameters.py b/hwbench/bench/parameters.py index 84a33e7..64073f4 100644 --- a/hwbench/bench/parameters.py +++ b/hwbench/bench/parameters.py @@ -50,6 +50,11 @@ def get_pinned_cpu(self): def get_name(self) -> str: return self.job_name + def get_name_with_position(self) -> str: + if not self.benchmark: + return self.get_name() + return f"{self.get_name()}_{self.benchmark.get_job_number()}" + def get_engine_instances_count(self) -> int: return self.engine_instances