From 7a6188978ae62b523fe667bf40fbfa609748c9f0 Mon Sep 17 00:00:00 2001 From: Derek Feichtinger Date: Wed, 15 Jul 2026 14:34:38 +0200 Subject: [PATCH] Implement an imperfect cpu_eff correction for nomultithread --- slurm-eff-tool.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slurm-eff-tool.py b/slurm-eff-tool.py index 8bd775d..2f50641 100755 --- a/slurm-eff-tool.py +++ b/slurm-eff-tool.py @@ -937,6 +937,13 @@ def build_job_records(rows: list[dict[str, str]]) -> list[JobRecord]: # related to 2 hyperthreads, and cputime_raw should have been doubled # for these cases cpu_eff = pct(totalcpu, cputime_raw) + # We correct for cases where users specify nomultithread, and where + # only 1 in 2 CPUs is used. WARNING: This is not perfect!!! Also, we + # store this in the cache, so not recalculated from original values + # when reading back from cache! + if cpu_eff and req_ntasks == alloc_cpus / 2 and cpu_eff <=50: + cpu_eff = 2 * cpu_eff + time_eff = pct(elapsed, timelimit_seconds) # Old metric: