Skip to content

Commit 386118d

Browse files
committed
Add in socket info for c4d
1 parent 16db3aa commit 386118d

File tree

1 file changed

+6
-4
lines changed
  • community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts

1 file changed

+6
-4
lines changed

community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/scripts/util.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class MachineType:
134134
guest_cpus: int
135135
memory_mb: int
136136
accelerators: List[AcceleratorInfo]
137-
137+
138138
@classmethod
139139
def from_json(cls, jo: dict) -> "MachineType":
140140
return cls(
@@ -150,7 +150,7 @@ def family(self) -> str:
150150
# TODO: doesn't work with N1 custom machine types
151151
# See https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#create
152152
return self.name.split("-")[0]
153-
153+
154154
@property
155155
def supports_smt(self) -> bool:
156156
# https://cloud.google.com/compute/docs/cpu-platforms
@@ -159,7 +159,7 @@ def supports_smt(self) -> bool:
159159
if self.guest_cpus == 1:
160160
return False
161161
return True
162-
162+
163163
@property
164164
def sockets(self) -> int:
165165
return {
@@ -171,8 +171,10 @@ def sockets(self) -> int:
171171
"c3": 2 if self.guest_cpus > 88 else 1,
172172
"c3d": 2 if self.guest_cpus > 180 else 1,
173173
"c4": 2 if self.guest_cpus > 96 else 1,
174+
"c4d": 2 if self.guest_cpus > 192 else 1,
174175
}.get(
175-
self.family, 1, # assume 1 socket for all other families
176+
self.family,
177+
1, # assume 1 socket for all other families
176178
)
177179

178180

0 commit comments

Comments
 (0)