Browse Source

reqmem is now specified per job

pull/24/head
B.E. Droge 6 months ago
parent
commit
df5dabb454
  1. 15
      roles/inefficient_jobs_detector/files/find_inefficient_jobs

15
roles/inefficient_jobs_detector/files/find_inefficient_jobs

@ -91,12 +91,15 @@ def get_job_stats(start_time, end_time): @@ -91,12 +91,15 @@ def get_job_stats(start_time, end_time):
# Remove trailing G from MaxRSS
values[FIELDS.index('maxrss')] = values[FIELDS.index('maxrss')].split('G')[0] if values[FIELDS.index('maxrss')] else 0
# ReqMem can be specified as Gn (GB per node) or Gc (GB per core); calculate the total and remove the suffix.
if values[FIELDS.index('reqmem')][-1] == 'n':
values[FIELDS.index('reqmem')] = values[FIELDS.index('reqmem')][:-2]
elif values[FIELDS.index('reqmem')][-1] == 'c':
# Multiply by the (average) number of CPUs per node. The real number of cores per node cannot be obtained by sacct.
cpn = int(values[FIELDS.index('ncpus')]) / int(values[FIELDS.index('nnodes')])
values[FIELDS.index('reqmem')] = float(values[FIELDS.index('reqmem')][:-2]) * cpn
#if values[FIELDS.index('reqmem')][-1] == 'n':
# values[FIELDS.index('reqmem')] = values[FIELDS.index('reqmem')][:-2]
#elif values[FIELDS.index('reqmem')][-1] == 'c':
# # Multiply by the (average) number of CPUs per node. The real number of cores per node cannot be obtained by sacct.
# cpn = int(values[FIELDS.index('ncpus')]) / int(values[FIELDS.index('nnodes')])
# values[FIELDS.index('reqmem')] = float(values[FIELDS.index('reqmem')][:-2]) * cpn
#
# ReqMem is specified per job in newer Slurm versions, so only remove the trailing G
values[FIELDS.index('reqmem')] = values[FIELDS.index('reqmem')].split('G')[0] if values[FIELDS.index('reqmem')] else 0
# Convert all values to the specified type.
values = [t(v) for t,v in zip(FIELD_TYPES, values)]

Loading…
Cancel
Save