Skip to content
Merged
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ pyslurm is the Python client library for the [Slurm Workload Manager](https://sl
* [Python](https://www.python.org) - >= 3.6
* [Cython](https://cython.org) - >= 0.29.37

This Version is for Slurm 24.11.x
This Version is for Slurm 25.05.x

## Versioning

In pyslurm, the versioning scheme follows the official Slurm versioning. The
first two numbers (`MAJOR.MINOR`) always correspond to Slurms Major-Release,
for example `24.11`.
for example `25.05`.
The last number (`MICRO`) is however not tied in any way to Slurms `MICRO`
version, but is instead PySlurm's internal Patch-Level. For example, any
pyslurm 24.11.X version should work with any Slurm 24.11.X release.
pyslurm 25.05.X version should work with any Slurm 25.05.X release.

## Installation

Expand All @@ -29,8 +29,8 @@ the corresponding paths to the necessary files.
You can specify those with environment variables (recommended), for example:

```shell
export SLURM_INCLUDE_DIR=/opt/slurm/24.11/include
export SLURM_LIB_DIR=/opt/slurm/24.11/lib
export SLURM_INCLUDE_DIR=/opt/slurm/25.05/include
export SLURM_LIB_DIR=/opt/slurm/25.05/lib
```

Then you can proceed to install pyslurm, for example by cloning the Repository:
Expand Down
6 changes: 3 additions & 3 deletions pyslurm.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%define python3_pkgversion 3.11

Name: python-pyslurm
Version: 24.11.0
Version: 25.5.0
%define rel 1
Release: %{rel}%{?dist}
Summary: Python interface to Slurm
Expand All @@ -15,8 +15,8 @@ BuildRequires: python%{python3_pkgversion}-wheel
BuildRequires: python%{python3_pkgversion}-Cython
BuildRequires: python%{python3_pkgversion}-packaging
BuildRequires: python-rpm-macros
BuildRequires: slurm-devel >= 24.11.0
BuildRequires: slurm >= 24.11.0
BuildRequires: slurm-devel >= 25.05.0
BuildRequires: slurm >= 25.05.0
Requires: python%{python3_pkgversion}

%description
Expand Down
1 change: 0 additions & 1 deletion pyslurm/core/node.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ from pyslurm.slurm cimport (
slurm_free_node_info_members,
slurm_free_update_node_msg,
slurm_free_partition_info_msg,
slurm_get_select_nodeinfo,
slurm_sprint_cpu_bind_type,
slurm_node_state_string_complete,
slurm_node_state_string,
Expand Down
37 changes: 5 additions & 32 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, on_noval=0)

@property
def real_memory(self):
Expand Down Expand Up @@ -547,7 +540,7 @@ cdef class Node:

@property
def effective_cpus(self):
return u16_parse(self.info.cpus_efctv)
return u16_parse(self.info.cpus_efctv, on_noval=0)

@property
def total_cpus(self):
Expand Down Expand Up @@ -616,35 +609,15 @@ 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, on_noval=0)

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

return efctv - self.allocated_cpus
return self.effective_cpus - self.allocated_cpus

@property
def cpu_binding(self):
Expand Down
9 changes: 7 additions & 2 deletions pyslurm/core/slurmctld/config.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ cdef class Config:
node when a Job completes.

{slurm.conf#OPT_Epilog}
epilog_timeout (int):
The interval in seconds Slurm waits for Epilog before terminating
them.

{slurm.conf#OPT_EpilogTimeout}
epilog_msg_time (int):
The number of microseconds that the slurmctld daemon requires to
process an epilog completion message from the slurmd daemons.
Expand Down Expand Up @@ -672,11 +677,11 @@ cdef class Config:
it is asked to run a job step from a new job allocation.

{slurm.conf#OPT_Prolog}
prolog_epilog_timeout (int):
prolog_timeout (int):
The interval in seconds Slurm waits for Prolog and Epilog before
terminating them.

{slurm.conf#OPT_PrologEpilogTimeout}
{slurm.conf#OPT_PrologTimeout}
prolog_slurmctld (list[str]):
List of pathnames of programs for the slurmctld daemon to execute
before granting a new job allocation.
Expand Down
12 changes: 6 additions & 6 deletions pyslurm/core/slurmctld/config.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ cdef class Config:
return cstr.to_list_with_count(self.ptr.epilog,
self.ptr.epilog_cnt)

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

@property
def epilog_msg_time(self):
return u32_parse(self.ptr.epilog_msg_time)
Expand All @@ -478,10 +482,6 @@ 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)

@property
def gres_types(self):
return cstr.to_list(self.ptr.gres_plugins)
Expand Down Expand Up @@ -847,8 +847,8 @@ 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 prolog_slurmctld(self):
Expand Down
8 changes: 0 additions & 8 deletions pyslurm/db/assoc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,6 @@ 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)

@property
def max_jobs(self):
return u32_parse(self.ptr.max_jobs, zero_is_noval=False)
Expand Down Expand Up @@ -367,10 +363,6 @@ cdef class Association:
def priority(self, val):
self.ptr.priority = u32(val)

@property
def rgt(self):
return u32_parse(self.ptr.rgt)

@property
def shares(self):
return u32_parse(self.ptr.shares_raw, zero_is_noval=False)
Expand Down
Loading
Loading