Skip to content

Commit 6ed4b5c

Browse files
slurm 24.05.X support
The code compiles amd I can run our python slurm utils. For now I have disabled the `epilog|prolgo' cconfigs they have changed for `char *` tp `char **`. Could not find a function for it so that is still on the todo list
1 parent 5cf0e1d commit 6ed4b5c

23 files changed

+246
-202
lines changed

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.1"

pyslurm/core/job/job.pxd

Lines changed: 1 addition & 1 deletion
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,

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/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/node.pyx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,6 @@ cdef class Node:
658658
def cpu_binding(self, val):
659659
self.info.cpu_bind=self.umsg.cpu_bind = cpubind_to_num(val)
660660

661-
@property
662-
def cap_watts(self):
663-
if not self.info.power:
664-
return 0
665-
return u32_parse(self.info.power.cap_watts, on_noval=0)
666-
667661
@property
668662
def current_watts(self):
669663
if not self.info.energy:
@@ -676,17 +670,6 @@ cdef class Node:
676670
return 0
677671
return u32_parse(self.info.energy.ave_watts, on_noval=0)
678672

679-
@property
680-
def external_sensors(self):
681-
if not self.info.ext_sensors:
682-
return {}
683-
684-
return {
685-
"joules_total": u64_parse(self.info.ext_sensors.consumed_energy),
686-
"current_watts": u32_parse(self.info.ext_sensors.current_watts),
687-
"temperature": u32_parse(self.info.ext_sensors.temperature)
688-
}
689-
690673
@property
691674
def _node_state(self):
692675
idle_cpus = self.idle_cpus

pyslurm/core/partition.pyx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -601,39 +601,39 @@ cdef class Partition:
601601

602602
@property
603603
def is_default(self):
604-
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_DEFAULT)
604+
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_DEFAULT)
605605

606606
@is_default.setter
607607
def is_default(self, val):
608-
u16_set_bool_flag(&self.ptr.flags, val,
608+
u32_set_bool_flag(&self.ptr.flags, val,
609609
slurm.PART_FLAG_DEFAULT, slurm.PART_FLAG_DEFAULT_CLR)
610610

611611
@property
612612
def allow_root_jobs(self):
613-
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_NO_ROOT)
613+
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_NO_ROOT)
614614

615615
@allow_root_jobs.setter
616616
def allow_root_jobs(self, val):
617-
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_NO_ROOT,
617+
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_NO_ROOT,
618618
slurm.PART_FLAG_NO_ROOT_CLR)
619619

620620
@property
621621
def is_user_exclusive(self):
622-
return u16_parse_bool_flag(self.ptr.flags,
622+
return u32_parse_bool_flag(self.ptr.flags,
623623
slurm.PART_FLAG_EXCLUSIVE_USER)
624624

625625
@is_user_exclusive.setter
626626
def is_user_exclusive(self, val):
627-
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_EXCLUSIVE_USER,
627+
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_EXCLUSIVE_USER,
628628
slurm.PART_FLAG_EXC_USER_CLR)
629629

630630
@property
631631
def is_hidden(self):
632-
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_HIDDEN)
632+
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_HIDDEN)
633633

634634
@is_hidden.setter
635635
def is_hidden(self, val):
636-
u16_set_bool_flag(&self.ptr.flags, val,
636+
u32_set_bool_flag(&self.ptr.flags, val,
637637
slurm.PART_FLAG_HIDDEN, slurm.PART_FLAG_HIDDEN_CLR)
638638

639639
@property
@@ -642,25 +642,25 @@ cdef class Partition:
642642

643643
@least_loaded_nodes_scheduling.setter
644644
def least_loaded_nodes_scheduling(self, val):
645-
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_LLN,
645+
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_LLN,
646646
slurm.PART_FLAG_LLN_CLR)
647647

648648
@property
649649
def is_root_only(self):
650-
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_ROOT_ONLY)
650+
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_ROOT_ONLY)
651651

652652
@is_root_only.setter
653653
def is_root_only(self, val):
654-
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_ROOT_ONLY,
654+
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_ROOT_ONLY,
655655
slurm.PART_FLAG_ROOT_ONLY_CLR)
656656

657657
@property
658658
def requires_reservation(self):
659-
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_REQ_RESV)
659+
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_REQ_RESV)
660660

661661
@requires_reservation.setter
662662
def requires_reservation(self, val):
663-
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_REQ_RESV,
663+
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_REQ_RESV,
664664
slurm.PART_FLAG_REQ_RESV_CLR)
665665

666666
# TODO: tres_fmt_str

pyslurm/db/job.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ from pyslurm.slurm cimport (
3838
try_xmalloc,
3939
slurmdb_job_cond_def_start_end,
4040
slurm_job_state_string,
41-
slurm_job_reason_string,
41+
slurm_job_state_reason_string,
4242
slurmdb_create_job_rec,
4343
slurmdb_job_modify,
4444
)

pyslurm/db/job.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ cdef class Job:
799799

800800
@property
801801
def state_reason(self):
802-
return cstr.to_unicode(slurm_job_reason_string
802+
return cstr.to_unicode(slurm_job_state_reason_string
803803
(self.ptr.state_reason_prev))
804804

805805
@property

pyslurm/db/step.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ from pyslurm.slurm cimport (
3434
try_xmalloc,
3535
slurmdb_job_cond_def_start_end,
3636
slurm_job_state_string,
37-
slurm_job_reason_string,
37+
slurm_job_state_reason_string,
3838
)
3939
from pyslurm.db.util cimport SlurmList, SlurmListItem
4040
from pyslurm.db.connection cimport Connection

pyslurm/db/util.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from pyslurm cimport slurm
2424
from pyslurm.utils cimport cstr
2525
from pyslurm.slurm cimport (
26-
ListIterator,
26+
list_itr_t,
2727
List,
2828
slurm_list_iterator_create,
2929
slurm_list_iterator_destroy,
@@ -52,7 +52,7 @@ cdef class SlurmListItem:
5252
cdef class SlurmList:
5353
cdef:
5454
List info
55-
ListIterator itr
55+
list_itr_t *itr
5656

5757
cdef readonly:
5858
owned

0 commit comments

Comments
 (0)