Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyslurm/core/node.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ from pyslurm.slurm cimport (
slurm_free_node_info_members,
slurm_free_update_node_msg,
slurm_free_partition_info_msg,
slurm_get_select_nodeinfo,
# slurm_get_select_nodeinfo removed in Slurm 25.05
slurm_sprint_cpu_bind_type,
slurm_node_state_string_complete,
slurm_node_state_string,
Expand Down
35 changes: 8 additions & 27 deletions pyslurm/core/node.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,7 @@ cdef class Node:

@property
def allocated_memory(self):
cdef uint64_t alloc_memory = 0
if self.info.select_nodeinfo:
slurm_get_select_nodeinfo(
self.info.select_nodeinfo,
slurm.SELECT_NODEDATA_MEM_ALLOC,
slurm.NODE_STATE_ALLOCATED,
&alloc_memory)
return alloc_memory
return u64_parse(self.info.alloc_memory)

@property
def real_memory(self):
Expand Down Expand Up @@ -616,35 +609,23 @@ cdef class Node:

@property
def allocated_tres(self):
cdef char *alloc_tres = NULL
if self.info.select_nodeinfo:
slurm_get_select_nodeinfo(
self.info.select_nodeinfo,
slurm.SELECT_NODEDATA_TRES_ALLOC_FMT_STR,
slurm.NODE_STATE_ALLOCATED,
&alloc_tres
)
return cstr.to_dict(alloc_tres)
return cstr.to_dict(self.info.alloc_tres_fmt_str)

@property
def allocated_cpus(self):
cdef uint16_t alloc_cpus = 0
if self.info.select_nodeinfo:
slurm_get_select_nodeinfo(
self.info.select_nodeinfo,
slurm.SELECT_NODEDATA_SUBCNT,
slurm.NODE_STATE_ALLOCATED,
&alloc_cpus
)
return alloc_cpus
return u16_parse(self.info.alloc_cpus)

@property
def idle_cpus(self):
efctv = self.effective_cpus
if not efctv:
return None

return efctv - self.allocated_cpus
alloc = self.allocated_cpus
if alloc is None:
alloc = 0

return efctv - alloc

@property
def cpu_binding(self):
Expand Down
12 changes: 7 additions & 5 deletions pyslurm/core/slurmctld/config.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,7 @@ cdef class Config:
def first_job_id(self):
return u32_parse(self.ptr.first_job_id)

@property
def get_environment_timeout(self):
return u16_parse(self.ptr.get_env_timeout)
# get_env_timeout field removed in Slurm 25.05

@property
def gres_types(self):
Expand Down Expand Up @@ -847,8 +845,12 @@ cdef class Config:
self.ptr.prolog_cnt)

@property
def prolog_epilog_timeout(self):
return u16_parse(self.ptr.prolog_epilog_timeout)
def prolog_timeout(self):
return u16_parse(self.ptr.prolog_timeout)

@property
def epilog_timeout(self):
return u16_parse(self.ptr.epilog_timeout)

@property
def prolog_slurmctld(self):
Expand Down
8 changes: 2 additions & 6 deletions pyslurm/db/assoc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ cdef class Association:
def is_default(self):
return u16_parse_bool(self.ptr.is_def)

@property
def lft(self):
return u32_parse(self.ptr.lft)
# lft field removed in Slurm 25.05

@property
def max_jobs(self):
Expand Down Expand Up @@ -367,9 +365,7 @@ cdef class Association:
def priority(self, val):
self.ptr.priority = u32(val)

@property
def rgt(self):
return u32_parse(self.ptr.rgt)
# rgt field removed in Slurm 25.05

@property
def shares(self):
Expand Down
Loading
Loading