Skip to content

Commit 581bc35

Browse files
Slurm 25.5.x compatibility
1 parent 546f3d2 commit 581bc35

File tree

14 files changed

+140
-320
lines changed

14 files changed

+140
-320
lines changed

pyslurm/core/node.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ from pyslurm.slurm cimport (
4343
slurm_free_node_info_members,
4444
slurm_free_update_node_msg,
4545
slurm_free_partition_info_msg,
46-
slurm_get_select_nodeinfo,
46+
# slurm_get_select_nodeinfo removed in Slurm 25.05
4747
slurm_sprint_cpu_bind_type,
4848
slurm_node_state_string_complete,
4949
slurm_node_state_string,

pyslurm/core/node.pyx

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,7 @@ cdef class Node:
507507

508508
@property
509509
def allocated_memory(self):
510-
cdef uint64_t alloc_memory = 0
511-
if self.info.select_nodeinfo:
512-
slurm_get_select_nodeinfo(
513-
self.info.select_nodeinfo,
514-
slurm.SELECT_NODEDATA_MEM_ALLOC,
515-
slurm.NODE_STATE_ALLOCATED,
516-
&alloc_memory)
517-
return alloc_memory
510+
return u64_parse(self.info.alloc_memory)
518511

519512
@property
520513
def real_memory(self):
@@ -616,35 +609,23 @@ cdef class Node:
616609

617610
@property
618611
def allocated_tres(self):
619-
cdef char *alloc_tres = NULL
620-
if self.info.select_nodeinfo:
621-
slurm_get_select_nodeinfo(
622-
self.info.select_nodeinfo,
623-
slurm.SELECT_NODEDATA_TRES_ALLOC_FMT_STR,
624-
slurm.NODE_STATE_ALLOCATED,
625-
&alloc_tres
626-
)
627-
return cstr.to_dict(alloc_tres)
612+
return cstr.to_dict(self.info.alloc_tres_fmt_str)
628613

629614
@property
630615
def allocated_cpus(self):
631-
cdef uint16_t alloc_cpus = 0
632-
if self.info.select_nodeinfo:
633-
slurm_get_select_nodeinfo(
634-
self.info.select_nodeinfo,
635-
slurm.SELECT_NODEDATA_SUBCNT,
636-
slurm.NODE_STATE_ALLOCATED,
637-
&alloc_cpus
638-
)
639-
return alloc_cpus
616+
return u16_parse(self.info.alloc_cpus)
640617

641618
@property
642619
def idle_cpus(self):
643620
efctv = self.effective_cpus
644621
if not efctv:
645622
return None
646623

647-
return efctv - self.allocated_cpus
624+
alloc = self.allocated_cpus
625+
if alloc is None:
626+
alloc = 0
627+
628+
return efctv - alloc
648629

649630
@property
650631
def cpu_binding(self):

pyslurm/core/slurmctld/config.pyx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,7 @@ cdef class Config:
478478
def first_job_id(self):
479479
return u32_parse(self.ptr.first_job_id)
480480

481-
@property
482-
def get_environment_timeout(self):
483-
return u16_parse(self.ptr.get_env_timeout)
481+
# get_env_timeout field removed in Slurm 25.05
484482

485483
@property
486484
def gres_types(self):
@@ -847,8 +845,12 @@ cdef class Config:
847845
self.ptr.prolog_cnt)
848846

849847
@property
850-
def prolog_epilog_timeout(self):
851-
return u16_parse(self.ptr.prolog_epilog_timeout)
848+
def prolog_timeout(self):
849+
return u16_parse(self.ptr.prolog_timeout)
850+
851+
@property
852+
def epilog_timeout(self):
853+
return u16_parse(self.ptr.epilog_timeout)
852854

853855
@property
854856
def prolog_slurmctld(self):

pyslurm/db/assoc.pyx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,7 @@ cdef class Association:
299299
def is_default(self):
300300
return u16_parse_bool(self.ptr.is_def)
301301

302-
@property
303-
def lft(self):
304-
return u32_parse(self.ptr.lft)
302+
# lft field removed in Slurm 25.05
305303

306304
@property
307305
def max_jobs(self):
@@ -367,9 +365,7 @@ cdef class Association:
367365
def priority(self, val):
368366
self.ptr.priority = u32(val)
369367

370-
@property
371-
def rgt(self):
372-
return u32_parse(self.ptr.rgt)
368+
# rgt field removed in Slurm 25.05
373369

374370
@property
375371
def shares(self):

0 commit comments

Comments
 (0)