Skip to content

Commit 7ca13af

Browse files
committed
Fixes for 21.8.x due to backporting from 22.5.x
Some changes made in 22.5.x are not available/different for 21.8.x, so they are changed accordingly for 21.8.x
1 parent 785c7c3 commit 7ca13af

File tree

4 files changed

+3
-67
lines changed

4 files changed

+3
-67
lines changed

pyslurm/core/node.pyx

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ cdef class Nodes(MultiClusterMap):
187187
def allocated_cpus(self):
188188
return xcollections.sum_property(self, Node.allocated_cpus)
189189

190-
@property
191-
def effective_cpus(self):
192-
return xcollections.sum_property(self, Node.effective_cpus)
193-
194190
@property
195191
def current_watts(self):
196192
return xcollections.sum_property(self, Node.current_watts)
@@ -313,37 +309,6 @@ cdef class Node:
313309

314310
return wrap
315311

316-
def create(self, state="future"):
317-
"""Create a node.
318-
319-
Implements the slurm_create_node RPC.
320-
321-
Args:
322-
state (str, optional):
323-
An optional state the created Node should have. Allowed values
324-
are `future` and `cloud`. `future` is the default.
325-
326-
Returns:
327-
(pyslurm.Node): This function returns the current Node-instance
328-
object itself.
329-
330-
Raises:
331-
RPCError: If creating the Node was not successful.
332-
333-
Examples:
334-
>>> import pyslurm
335-
>>> node = pyslurm.Node("testnode").create()
336-
"""
337-
if not self.name:
338-
raise ValueError("You need to set a node name first.")
339-
340-
self._alloc_umsg()
341-
cstr.fmalloc(&self.umsg.extra,
342-
f"NodeName={self.name} State={state}")
343-
verify_rpc(slurm_create_node(self.umsg))
344-
345-
return self
346-
347312
def modify(self, Node changes):
348313
"""Modify a node.
349314
@@ -372,21 +337,6 @@ cdef class Node:
372337
cstr.fmalloc(&n.umsg.node_names, self.name)
373338
verify_rpc(slurm_update_node(n.umsg))
374339

375-
def delete(self):
376-
"""Delete a node.
377-
378-
Implements the slurm_delete_node RPC.
379-
380-
Raises:
381-
RPCError: If deleting the Node was not successful.
382-
383-
Examples:
384-
>>> import pyslurm
385-
>>> pyslurm.Node("localhost").delete()
386-
"""
387-
self._alloc_umsg()
388-
verify_rpc(slurm_delete_node(self.umsg))
389-
390340
def as_dict(self):
391341
return self.to_dict()
392342

@@ -527,10 +477,6 @@ cdef class Node:
527477
def weight(self, val):
528478
self.info.weight=self.umsg.weight = u32(val)
529479

530-
@property
531-
def effective_cpus(self):
532-
return u16_parse(self.info.cpus_efctv)
533-
534480
@property
535481
def total_cpus(self):
536482
return u16_parse(self.info.cpus, on_noval=0)
@@ -622,7 +568,7 @@ cdef class Node:
622568

623569
@property
624570
def idle_cpus(self):
625-
efctv = self.effective_cpus
571+
efctv = self.total_cpus
626572
if not efctv:
627573
return None
628574

pyslurm/core/partition.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ cdef class Partition:
172172
The oversubscribe mode for this Partition
173173
nodes (str):
174174
Nodes that are in a Partition
175-
nodesets (list[str]):
176-
List of Nodesets that a Partition has configured
177175
over_time_limit (int):
178176
Limit in minutes that Jobs can exceed their time-limit
179177

pyslurm/core/partition.pyx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,6 @@ cdef class Partition:
527527
def nodes(self, val):
528528
cstr.from_list(&self.ptr.nodes, val)
529529

530-
@property
531-
def nodesets(self):
532-
return cstr.to_list(self.ptr.nodesets)
533-
534-
@nodesets.setter
535-
def nodesets(self, val):
536-
cstr.from_list(&self.ptr.nodesets, val)
537-
538530
@property
539531
def over_time_limit(self):
540532
return u16_parse(self.ptr.over_time_limit)

tests/integration/test_job_steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_collection(submit_job):
109109
assert len(steps) == 3
110110
assert ("batch" in steps and
111111
0 in steps and
112-
1 in steps)
112+
(1 in steps or 'pending' in steps))
113113

114114

115115
def test_cancel(submit_job):
@@ -120,7 +120,7 @@ def test_cancel(submit_job):
120120
assert len(steps) == 3
121121
assert ("batch" in steps and
122122
0 in steps and
123-
1 in steps)
123+
(1 in steps or 'pending' in steps))
124124

125125
steps[0].cancel()
126126

0 commit comments

Comments
 (0)