corrected CPU waste calculation. Failed jobs counted as waste

This commit is contained in:
2026-06-26 18:08:07 +02:00
parent fd66073623
commit dcc0d2cd7d
+10 -2
View File
@@ -831,7 +831,11 @@ def make_single_row(rec: JobRecord, dflt_mpcpu: float) -> OutputRow:
waste_cpu = None
if rec.cpu_eff is not None:
waste_cpu = walltime * (100-rec.cpu_eff) * rec.cpus
# We count failed jobs as wasted CPU!
if rec.state != state_mappings['COMPLETED']:
waste_cpu = walltime * rec.cpus
else:
waste_cpu = walltime * (100-rec.cpu_eff)/100 * rec.cpus
jobid = rec.jobidraw
if jobid == "":
@@ -897,7 +901,11 @@ def make_aggregate_row(records: list[JobRecord], username: str,
waste_cpu=None
if cpu_efficiency is not None and walltime is not None:
waste_cpu = count * walltime * (100-cpu_efficiency) * first.cpus
# We count failed jobs as wasted CPU!
if first.state != state_mappings['COMPLETED']:
waste_cpu = count * walltime * first.cpus
else:
waste_cpu = count * walltime * (100-cpu_efficiency)/100 * first.cpus
return OutputRow(
username=username,