Skip to content

Commit

Permalink
Set RealMemory to the actual total instance memory.
Browse files Browse the repository at this point in the history
The default is to set it to 95% which makes it difficult to correctly request
memory because you could submit a job and request 4GB and wind up running on an
8GB machine.

This just makes it more intuitive.

Resolves #283
  • Loading branch information
cartalla committed Nov 6, 2024
1 parent 835f62b commit 74d04b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/cdk/cdk_slurm_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -2723,7 +2723,8 @@ def create_parallel_cluster_config(self):
continue
logger.debug(f"Creating queue for {purchase_option} {instance_type}")
efa_supported = self.plugin.get_EfaSupported(self.cluster_region, instance_type) and self.config['slurm']['ParallelClusterConfig']['EnableEfa']
mem_gb = int(self.plugin.get_MemoryInMiB(self.cluster_region, instance_type) / 1024)
mem_mb = self.plugin.get_MemoryInMiB(self.cluster_region, instance_type)
mem_gb = int(mem_mb / 1024)
core_count = int(self.plugin.get_CoreCount(self.cluster_region, instance_type))
threads_per_core = int(self.plugin.get_DefaultThreadsPerCore(self.cluster_region, instance_type))
if not instance_type_config['DisableSimultaneousMultithreading']:
Expand Down Expand Up @@ -2784,6 +2785,7 @@ def create_parallel_cluster_config(self):
max_count = self.config['slurm']['InstanceConfig']['NodeCounts']['DefaultMaxCount']
compute_resource = {
'Name': compute_resource_name,
'SchedulableMemory': mem_mb,
'MinCount': min_count,
'MaxCount': max_count,
'DisableSimultaneousMultithreading': instance_type_config['DisableSimultaneousMultithreading'],
Expand Down

0 comments on commit 74d04b8

Please sign in to comment.