Skip to content

Commit 18e88ab

Browse files
Support for 24.5.x (#348)
* support for 24.05.x * --power / POWER_FLAGS were removed in 24.05 * CR_OTHER_CONS_TRES was removed in 24.05 * bump minimum cython version to 0.29.37 * partition: add power_down_on_idle attribute --------- Co-authored-by: Bas van der Vlies <[email protected]>
1 parent 5cf0e1d commit 18e88ab

35 files changed

+297
-299
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ pyslurm is the Python client library for the [Slurm Workload Manager](https://sl
66

77
* [Slurm](https://slurm.schedmd.com) - Slurm shared library and header files
88
* [Python](https://www.python.org) - >= 3.6
9-
* [Cython](https://cython.org) - >= 0.29.36
9+
* [Cython](https://cython.org) - >= 0.29.37
1010

11-
This Version is for Slurm 23.11.x
11+
This Version is for Slurm 24.05.x
1212

1313
## Versioning
1414

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

2222
## Installation
2323

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

3131
```shell
32-
export SLURM_INCLUDE_DIR=/opt/slurm/23.11/include
33-
export SLURM_LIB_DIR=/opt/slurm/23.11/lib
32+
export SLURM_INCLUDE_DIR=/opt/slurm/24.05/include
33+
export SLURM_LIB_DIR=/opt/slurm/24.05/lib
3434
```
3535

3636
Then you can proceed to install pyslurm, for example by cloning the Repository:

build_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
setuptools>=59.2.0
22
wheel>=0.37.0
3-
Cython>=0.29.36
3+
Cython>=0.29.37
44
packaging>=21.3

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
requires = [
44
"setuptools>=59.2.0",
55
"wheel>=0.37.0",
6-
"Cython>=0.29.36",
6+
"Cython>=0.29.37",
77
"packaging>=21.3"
88
]
99

pyslurm/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# The last Number "Z" is the current Pyslurm patch version, which should be
66
# incremented each time a new release is made (except when migrating to a new
77
# Slurm Major release, then set it back to 0)
8-
__version__ = "23.11.0"
8+
__version__ = "24.5.0"

pyslurm/core/job/job.pxd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ from pyslurm.slurm cimport (
4747
job_info_msg_t,
4848
slurm_job_info_t,
4949
slurm_job_state_string,
50-
slurm_job_reason_string,
50+
slurm_job_state_reason_string,
5151
slurm_job_share_string,
5252
slurm_job_batch_script,
5353
slurm_get_job_stdin,
@@ -358,8 +358,6 @@ cdef class Job:
358358
Whether the Job should be killed on an invalid dependency.
359359
spreads_over_nodes (bool):
360360
Whether the Job should be spread over as many nodes as possible.
361-
power_options (list):
362-
Options set for Power Management.
363361
is_cronjob (bool):
364362
Whether this Job is a cronjob.
365363
cronjob_time (str):

pyslurm/core/job/job.pyx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ cdef class Job:
650650
if self.ptr.state_desc:
651651
return cstr.to_unicode(self.ptr.state_desc)
652652

653-
return cstr.to_unicode(slurm_job_reason_string(self.ptr.state_reason))
653+
return cstr.to_unicode(slurm_job_state_reason_string(self.ptr.state_reason))
654654

655655
@property
656656
def is_requeueable(self):
@@ -1177,10 +1177,6 @@ cdef class Job:
11771177
def spreads_over_nodes(self):
11781178
return u64_parse_bool_flag(self.ptr.bitflags, slurm.SPREAD_JOB)
11791179

1180-
@property
1181-
def power_options(self):
1182-
return power_type_int_to_list(self.ptr.power_flags)
1183-
11841180
@property
11851181
def is_cronjob(self):
11861182
return u64_parse_bool_flag(self.ptr.bitflags, slurm.CRON_JOB)

pyslurm/core/job/sbatch_opts.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ SBATCH_OPTIONS = [
138138
SbatchOpt("O", "overcommit", "overcommit", True),
139139
SbatchOpt("s", "oversubscribe", "resource_sharing", "yes"),
140140
SbatchOpt("p", "partition", "partition"),
141-
SbatchOpt(None, "power", "power_options"),
142141
SbatchOpt(None, "prefer", None),
143142
SbatchOpt(None, "priority", "priority"),
144143
SbatchOpt(None, "profile", "profile_types"),

pyslurm/core/job/submission.pxd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,6 @@ cdef class JobSubmitDescription:
251251
partitions (Union[list, str]):
252252
A list of partitions the Job may use.
253253
This is the same as -p/--partition from sbatch.
254-
power_options (list):
255-
A list of power management plugin options for the Job.
256-
This is the same as --power from sbatch.
257254
accounting_gather_frequency (Union[dict, str]):
258255
Interval for accounting info to be gathered.
259256
This is the same as --acctg-freq from sbatch.
@@ -600,7 +597,6 @@ cdef class JobSubmitDescription:
600597
log_files_open_mode
601598
overcommit
602599
partitions
603-
power_options
604600
profile_types
605601
accounting_gather_frequency
606602
qos

pyslurm/core/job/submission.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ cdef class JobSubmitDescription:
266266
ptr.requeue = u16_bool(self.is_requeueable)
267267
ptr.wait_all_nodes = u16_bool(self.wait_all_nodes)
268268
ptr.mail_type = mail_type_list_to_int(self.mail_types)
269-
ptr.power_flags = power_type_list_to_int(self.power_options)
270269
ptr.profile = acctg_profile_list_to_int(self.profile_types)
271270
ptr.shared = shared_type_str_to_int(self.resource_sharing)
272271

pyslurm/core/job/util.pyx

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -178,37 +178,6 @@ def acctg_profile_int_to_list(flags):
178178
return profiles
179179

180180

181-
def power_type_list_to_int(types):
182-
"""Convert a str or list of str with power types to uint8_t."""
183-
cdef uint8_t flags = 0
184-
185-
if not types:
186-
return slurm.NO_VAL8
187-
188-
if isinstance(types, str):
189-
types = types.split(",")
190-
191-
for typ in types:
192-
typ = typ.casefold()
193-
194-
if "level" == typ:
195-
flags |= slurm.SLURM_POWER_FLAGS_LEVEL
196-
else:
197-
raise ValueError("Invalid power type: {typ}.")
198-
199-
return flags
200-
201-
202-
def power_type_int_to_list(flags):
203-
"""Convert uint8_t power type flags to a list of strings."""
204-
types = []
205-
206-
if flags & slurm.SLURM_POWER_FLAGS_LEVEL:
207-
types.append("LEVEL")
208-
209-
return types
210-
211-
212181
def shared_type_str_to_int(typ):
213182
"""Convert a job-sharing type str to its numerical representation."""
214183
if not typ:
@@ -227,7 +196,7 @@ def shared_type_str_to_int(typ):
227196
raise ValueError(f"Invalid resource_sharing type: {typ}.")
228197

229198

230-
def cpu_gov_str_to_int(gov):
199+
def cpu_gov_str_to_int(gov):
231200
"""Convert a cpu governor str to is numerical representation."""
232201
if not gov:
233202
return u32(None)

0 commit comments

Comments
 (0)