Skip to content

Commit

Permalink
Merge pull request #214 from smoors/exact_memory
Browse files Browse the repository at this point in the history
add support for setting the exact required memory
  • Loading branch information
casparvl authored Jan 9, 2025
2 parents 458b477 + 1a4ec27 commit 695b7b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions eessi/testsuite/eessi_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class EESSI_Mixin(RegressionMixin):

# Set defaults for these class variables, can be overwritten by child class if desired
measure_memory_usage = variable(bool, value=False)
exact_memory = variable(bool, value=False)
scale = parameter(SCALES.keys())
bench_name = None
bench_name_ci = None
Expand Down
16 changes: 10 additions & 6 deletions eessi/testsuite/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,10 @@ def _set_or_append_valid_systems(test: rfm.RegressionTest, valid_systems: str):
elif len(test.valid_systems) == 1:
test.valid_systems[0] = f'{test.valid_systems[0]} {valid_systems}'
else:
warn_msg = f"valid_systems has multiple ({len(test.valid_systems)}) items,"
warn_msg += " which is not supported by this hook."
warn_msg += " Make sure to handle filtering yourself."
rflog.getlogger().warning(warn_msg)
msg = f"valid_systems has multiple ({len(test.valid_systems)}) items,"
msg += " which is not supported by this hook."
msg += " Make sure to handle filtering yourself."
rflog.getlogger().warning(msg)
return


Expand Down Expand Up @@ -555,8 +555,12 @@ def req_memory_per_node(test: rfm.RegressionTest, app_mem_req: float):
log(f"Memory requested by application: {app_mem_req} MiB")
log(f"Memory proportional to the core count: {proportional_mem} MiB")

# Request the maximum of the proportional_mem, and app_mem_req to the scheduler
req_mem_per_node = max(proportional_mem, app_mem_req)
if test.exact_memory:
# Request the exact amount of required memory
req_mem_per_node = app_mem_req
else:
# Request the maximum of the proportional_mem, and app_mem_req to the scheduler
req_mem_per_node = max(proportional_mem, app_mem_req)

test.extra_resources = {'memory': {'size': f'{req_mem_per_node}M'}}
log(f"Requested {req_mem_per_node} MiB per node from the SLURM batch scheduler")
Expand Down

0 comments on commit 695b7b2

Please sign in to comment.