Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jerowe committed Sep 26, 2023
1 parent 598c9a8 commit 5b81c6f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aws_pcluster_slurm_spawner/aws_pcluster_slurm_spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,26 +283,27 @@ def profiles_list(self) -> List[Any]:
},
]
gpu_found = False
for group_record in self.sinfo.dataframe.to_dict("records"):
df = self.sinfo.dataframe.sort_values(by=["mem", "cpu", "queue"])
for group_record in df.to_dict("records"):
# for group_record in self.sinfo.dataframe.to_dict('records'):
sinfo_name = group_record["sinfo_name"]
instance_type = group_record["ec2_instance_type"]

mem = group_record["mem"]
cpu = group_record["vcpu"]
mem = str(group_record["mem"])
cpu = str(group_record["vcpu"])
if len(group_record["gpus"]):
profiles[1]["profile_options"]["instance_types"]["choices"][
sinfo_name
] = dict(
display_name=f"{instance_type} - {cpu} CPU, {mem} GB",
display_name=f"{instance_type:10s} | {cpu:5s} CPU, {mem:6s} GB",
pclusterslurmspawner_override=group_record,
)
else:
gpu_found = True
profiles[0]["profile_options"]["instance_types"]["choices"][
sinfo_name
] = dict(
display_name=f"{instance_type} - {cpu} CPU, {mem} GB",
display_name=f"{instance_type:10s} | {cpu:5s} CPU | {mem:6s} GB",
pclusterslurmspawner_override=group_record,
)
if not gpu_found:
Expand Down

0 comments on commit 5b81c6f

Please sign in to comment.