Skip to content

Commit

Permalink
leave a comment about 0 capacity unused partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamel committed Oct 21, 2024
1 parent 405ef5f commit 4adee8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
14 changes: 7 additions & 7 deletions slurm/src/slurmcc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,18 +803,18 @@ def _partitions(
threads = 1
def_mem_per_cpu = memory // cpus


comment_out = ""
if max_count <= 0:
writer.write(f"# The following partition has no capacity! {partition.name} - {partition.nodearray} - {partition.machine_type} \n")
comment_out = "# "

writer.write(
"PartitionName={} Nodes={} Default={} DefMemPerCPU={} MaxTime=INFINITE State=UP\n".format(
partition.name, partition.node_list, default_yn, def_mem_per_cpu
)
f"{comment_out}PartitionName={partition.name} Nodes={partition.node_list} Default={default_yn} DefMemPerCPU={def_mem_per_cpu} MaxTime=INFINITE State=UP\n"
)

state = "CLOUD" if autoscale else "FUTURE"
writer.write(
"Nodename={} Feature=cloud STATE={} CPUs={} ThreadsPerCore={} RealMemory={}".format(
node_list, state, cpus, threads, memory
)
f"{comment_out}Nodename={node_list} Feature=cloud STATE={state} CPUs={cpus} ThreadsPerCore={threads} RealMemory={memory}"
)

if partition.gpu_count:
Expand Down
7 changes: 5 additions & 2 deletions slurm/src/slurmcc/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def _slurm_nodes(cls) -> List[Dict[str, str]]:
@property
def node_list(self) -> str:
if not self.dynamic_config:
static_nodes = self._static_all_nodes()
if not static_nodes:
return ""
return slutil.to_hostlist(self._static_all_nodes())
# with dynamic nodes, we only look at those defined in the partition
if not self.__dynamic_node_list_cache:
Expand Down Expand Up @@ -349,10 +352,10 @@ def fetch_partitions(

if limits.max_count <= 0:
logging.info(
"Bucket has a max_count <= 0, defined for machinetype=='%s'. Skipping",
"Bucket has a max_count <= 0, defined for machinetype=='%s'.",
machine_type,
)
continue
# keep this partition around, but we will ignore it when generating later.

max_scaleset_size = buckets[0].max_placement_group_size

Expand Down

0 comments on commit 4adee8b

Please sign in to comment.