Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slurm 24.05.X support #345

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# The last Number "Z" is the current Pyslurm patch version, which should be
# incremented each time a new release is made (except when migrating to a new
# Slurm Major release, then set it back to 0)
__version__ = "23.11.0"
__version__ = "24.05.0"
2 changes: 1 addition & 1 deletion pyslurm/core/job/job.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ from pyslurm.slurm cimport (
job_info_msg_t,
slurm_job_info_t,
slurm_job_state_string,
slurm_job_reason_string,
slurm_job_state_reason_string,
slurm_job_share_string,
slurm_job_batch_script,
slurm_get_job_stdin,
Expand Down
6 changes: 1 addition & 5 deletions pyslurm/core/job/job.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ cdef class Job:
if self.ptr.state_desc:
return cstr.to_unicode(self.ptr.state_desc)

return cstr.to_unicode(slurm_job_reason_string(self.ptr.state_reason))
return cstr.to_unicode(slurm_job_state_reason_string(self.ptr.state_reason))

@property
def is_requeueable(self):
Expand Down Expand Up @@ -1177,10 +1177,6 @@ cdef class Job:
def spreads_over_nodes(self):
return u64_parse_bool_flag(self.ptr.bitflags, slurm.SPREAD_JOB)

@property
def power_options(self):
return power_type_int_to_list(self.ptr.power_flags)

@property
def is_cronjob(self):
return u64_parse_bool_flag(self.ptr.bitflags, slurm.CRON_JOB)
Expand Down
1 change: 0 additions & 1 deletion pyslurm/core/job/submission.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ cdef class JobSubmitDescription:
ptr.requeue = u16_bool(self.is_requeueable)
ptr.wait_all_nodes = u16_bool(self.wait_all_nodes)
ptr.mail_type = mail_type_list_to_int(self.mail_types)
ptr.power_flags = power_type_list_to_int(self.power_options)
ptr.profile = acctg_profile_list_to_int(self.profile_types)
ptr.shared = shared_type_str_to_int(self.resource_sharing)

Expand Down
17 changes: 0 additions & 17 deletions pyslurm/core/node.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,6 @@ cdef class Node:
def cpu_binding(self, val):
self.info.cpu_bind=self.umsg.cpu_bind = cpubind_to_num(val)

@property
def cap_watts(self):
if not self.info.power:
return 0
return u32_parse(self.info.power.cap_watts, on_noval=0)

@property
def current_watts(self):
if not self.info.energy:
Expand All @@ -676,17 +670,6 @@ cdef class Node:
return 0
return u32_parse(self.info.energy.ave_watts, on_noval=0)

@property
def external_sensors(self):
if not self.info.ext_sensors:
return {}

return {
"joules_total": u64_parse(self.info.ext_sensors.consumed_energy),
"current_watts": u32_parse(self.info.ext_sensors.current_watts),
"temperature": u32_parse(self.info.ext_sensors.temperature)
}

@property
def _node_state(self):
idle_cpus = self.idle_cpus
Expand Down
26 changes: 13 additions & 13 deletions pyslurm/core/partition.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -601,39 +601,39 @@ cdef class Partition:

@property
def is_default(self):
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_DEFAULT)
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_DEFAULT)

@is_default.setter
def is_default(self, val):
u16_set_bool_flag(&self.ptr.flags, val,
u32_set_bool_flag(&self.ptr.flags, val,
slurm.PART_FLAG_DEFAULT, slurm.PART_FLAG_DEFAULT_CLR)

@property
def allow_root_jobs(self):
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_NO_ROOT)
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_NO_ROOT)

@allow_root_jobs.setter
def allow_root_jobs(self, val):
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_NO_ROOT,
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_NO_ROOT,
slurm.PART_FLAG_NO_ROOT_CLR)

@property
def is_user_exclusive(self):
return u16_parse_bool_flag(self.ptr.flags,
return u32_parse_bool_flag(self.ptr.flags,
slurm.PART_FLAG_EXCLUSIVE_USER)

@is_user_exclusive.setter
def is_user_exclusive(self, val):
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_EXCLUSIVE_USER,
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_EXCLUSIVE_USER,
slurm.PART_FLAG_EXC_USER_CLR)

@property
def is_hidden(self):
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_HIDDEN)
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_HIDDEN)

@is_hidden.setter
def is_hidden(self, val):
u16_set_bool_flag(&self.ptr.flags, val,
u32_set_bool_flag(&self.ptr.flags, val,
slurm.PART_FLAG_HIDDEN, slurm.PART_FLAG_HIDDEN_CLR)

@property
Expand All @@ -642,25 +642,25 @@ cdef class Partition:

@least_loaded_nodes_scheduling.setter
def least_loaded_nodes_scheduling(self, val):
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_LLN,
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_LLN,
slurm.PART_FLAG_LLN_CLR)

@property
def is_root_only(self):
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_ROOT_ONLY)
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_ROOT_ONLY)

@is_root_only.setter
def is_root_only(self, val):
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_ROOT_ONLY,
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_ROOT_ONLY,
slurm.PART_FLAG_ROOT_ONLY_CLR)

@property
def requires_reservation(self):
return u16_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_REQ_RESV)
return u32_parse_bool_flag(self.ptr.flags, slurm.PART_FLAG_REQ_RESV)

@requires_reservation.setter
def requires_reservation(self, val):
u16_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_REQ_RESV,
u32_set_bool_flag(&self.ptr.flags, val, slurm.PART_FLAG_REQ_RESV,
slurm.PART_FLAG_REQ_RESV_CLR)

# TODO: tres_fmt_str
Expand Down
2 changes: 1 addition & 1 deletion pyslurm/db/job.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ from pyslurm.slurm cimport (
try_xmalloc,
slurmdb_job_cond_def_start_end,
slurm_job_state_string,
slurm_job_reason_string,
slurm_job_state_reason_string,
slurmdb_create_job_rec,
slurmdb_job_modify,
)
Expand Down
2 changes: 1 addition & 1 deletion pyslurm/db/job.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ cdef class Job:

@property
def state_reason(self):
return cstr.to_unicode(slurm_job_reason_string
return cstr.to_unicode(slurm_job_state_reason_string
(self.ptr.state_reason_prev))

@property
Expand Down
2 changes: 1 addition & 1 deletion pyslurm/db/step.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ from pyslurm.slurm cimport (
try_xmalloc,
slurmdb_job_cond_def_start_end,
slurm_job_state_string,
slurm_job_reason_string,
slurm_job_state_reason_string,
)
from pyslurm.db.util cimport SlurmList, SlurmListItem
from pyslurm.db.connection cimport Connection
Expand Down
4 changes: 2 additions & 2 deletions pyslurm/db/util.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pyslurm cimport slurm
from pyslurm.utils cimport cstr
from pyslurm.slurm cimport (
ListIterator,
list_itr_t,
List,
slurm_list_iterator_create,
slurm_list_iterator_destroy,
Expand Down Expand Up @@ -52,7 +52,7 @@ cdef class SlurmListItem:
cdef class SlurmList:
cdef:
List info
ListIterator itr
list_itr_t *itr

cdef readonly:
owned
Expand Down
14 changes: 0 additions & 14 deletions pyslurm/pydefines/slurm_defines.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ SLURM_EXTERN_CONT = slurm.SLURM_EXTERN_CONT

DEFAULT_EIO_SHUTDOWN_WAIT = slurm.DEFAULT_EIO_SHUTDOWN_WAIT

SLURM_SSL_SIGNATURE_LENGTH = slurm.SLURM_SSL_SIGNATURE_LENGTH

JOB_STATE_BASE = slurm.JOB_STATE_BASE
JOB_STATE_FLAGS = slurm.JOB_STATE_FLAGS
JOB_LAUNCH_FAILED = slurm.JOB_LAUNCH_FAILED
Expand Down Expand Up @@ -110,7 +108,6 @@ CPU_FREQ_GOV_MASK = slurm.CPU_FREQ_GOV_MASK

NODE_STATE_BASE = slurm.NODE_STATE_BASE
NODE_STATE_FLAGS = slurm.NODE_STATE_FLAGS
NODE_STATE_NET = slurm.NODE_STATE_NET
NODE_STATE_RES = slurm.NODE_STATE_RES
NODE_STATE_UNDRAIN = slurm.NODE_STATE_UNDRAIN
NODE_STATE_CLOUD = slurm.NODE_STATE_CLOUD
Expand Down Expand Up @@ -142,7 +139,6 @@ CR_BOARD = slurm.CR_BOARD
CR_MEMORY = slurm.CR_MEMORY
CR_ONE_TASK_PER_CORE = slurm.CR_ONE_TASK_PER_CORE
CR_PACK_NODES = slurm.CR_PACK_NODES
CR_OTHER_CONS_TRES = slurm.CR_OTHER_CONS_TRES
CR_CORE_DEFAULT_DIST_BLOCK = slurm.CR_CORE_DEFAULT_DIST_BLOCK
CR_LLN = slurm.CR_LLN

Expand Down Expand Up @@ -226,7 +222,6 @@ JOB_SHARED_OK = slurm.JOB_SHARED_OK
JOB_SHARED_USER = slurm.JOB_SHARED_USER
JOB_SHARED_MCS = slurm.JOB_SHARED_MCS

SLURM_POWER_FLAGS_LEVEL = slurm.SLURM_POWER_FLAGS_LEVEL

CORE_SPEC_THREAD = slurm.CORE_SPEC_THREAD

Expand Down Expand Up @@ -300,7 +295,6 @@ DEBUG_FLAG_RESERVATION = slurm.DEBUG_FLAG_RESERVATION
DEBUG_FLAG_FRONT_END = slurm.DEBUG_FLAG_FRONT_END
DEBUG_FLAG_SWITCH = slurm.DEBUG_FLAG_SWITCH
DEBUG_FLAG_ENERGY = slurm.DEBUG_FLAG_ENERGY
DEBUG_FLAG_EXT_SENSORS = slurm.DEBUG_FLAG_EXT_SENSORS
DEBUG_FLAG_LICENSE = slurm.DEBUG_FLAG_LICENSE
DEBUG_FLAG_PROFILE = slurm.DEBUG_FLAG_PROFILE
DEBUG_FLAG_INTERCONNECT = slurm.DEBUG_FLAG_INTERCONNECT
Expand All @@ -322,7 +316,6 @@ DEBUG_FLAG_DB_WCKEY = slurm.DEBUG_FLAG_DB_WCKEY
DEBUG_FLAG_BURST_BUF = slurm.DEBUG_FLAG_BURST_BUF
DEBUG_FLAG_CPU_FREQ = slurm.DEBUG_FLAG_CPU_FREQ
DEBUG_FLAG_POWER = slurm.DEBUG_FLAG_POWER
DEBUG_FLAG_TIME_CRAY = slurm.DEBUG_FLAG_TIME_CRAY
DEBUG_FLAG_DB_ARCHIVE = slurm.DEBUG_FLAG_DB_ARCHIVE
DEBUG_FLAG_DB_TRES = slurm.DEBUG_FLAG_DB_TRES
DEBUG_FLAG_NODE_FEATURES = slurm.DEBUG_FLAG_NODE_FEATURES
Expand Down Expand Up @@ -356,13 +349,6 @@ PROLOG_FLAG_CONTAIN = slurm.PROLOG_FLAG_CONTAIN
PROLOG_FLAG_SERIAL = slurm.PROLOG_FLAG_SERIAL
PROLOG_FLAG_X11 = slurm.PROLOG_FLAG_X11

CTL_CONF_OR = slurm.CTL_CONF_OR
CTL_CONF_SJC = slurm.CTL_CONF_SJC
CTL_CONF_DRJ = slurm.CTL_CONF_DRJ
CTL_CONF_ASRU = slurm.CTL_CONF_ASRU
CTL_CONF_PAM = slurm.CTL_CONF_PAM
CTL_CONF_WCKEY = slurm.CTL_CONF_WCKEY

LOG_FMT_ISO8601_MS = slurm.LOG_FMT_ISO8601_MS
LOG_FMT_ISO8601 = slurm.LOG_FMT_ISO8601
LOG_FMT_RFC5424_MS = slurm.LOG_FMT_RFC5424_MS
Expand Down
5 changes: 0 additions & 5 deletions pyslurm/pydefines/slurm_enums.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ WAIT_ARRAY_TASK_LIMIT = slurm.WAIT_ARRAY_TASK_LIMIT
WAIT_BURST_BUFFER_RESOURCE = slurm.WAIT_BURST_BUFFER_RESOURCE
WAIT_BURST_BUFFER_STAGING = slurm.WAIT_BURST_BUFFER_STAGING
FAIL_BURST_BUFFER_OP = slurm.FAIL_BURST_BUFFER_OP
WAIT_POWER_NOT_AVAIL = slurm.WAIT_POWER_NOT_AVAIL
WAIT_POWER_RESERVED = slurm.WAIT_POWER_RESERVED
WAIT_ASSOC_GRP_UNK = slurm.WAIT_ASSOC_GRP_UNK
WAIT_ASSOC_GRP_UNK_MIN = slurm.WAIT_ASSOC_GRP_UNK_MIN
WAIT_ASSOC_GRP_UNK_RUN_MIN = slurm.WAIT_ASSOC_GRP_UNK_RUN_MIN
Expand Down Expand Up @@ -239,10 +237,7 @@ AUTH_PLUGIN_JWT = slurm.AUTH_PLUGIN_JWT
# enum select_plugin_type

SELECT_PLUGIN_LINEAR = slurm.SELECT_PLUGIN_LINEAR
SELECT_PLUGIN_SERIAL = slurm.SELECT_PLUGIN_SERIAL
SELECT_PLUGIN_CRAY_LINEAR = slurm.SELECT_PLUGIN_CRAY_LINEAR
SELECT_PLUGIN_CONS_TRES = slurm.SELECT_PLUGIN_CONS_TRES
SELECT_PLUGIN_CRAY_CONS_TRES = slurm.SELECT_PLUGIN_CRAY_CONS_TRES

# end enum select_plugin_type

Expand Down
1 change: 0 additions & 1 deletion pyslurm/pydefines/slurmdb_defines.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,5 @@ CLUSTER_FLAG_A7 = slurm.CLUSTER_FLAG_A7
CLUSTER_FLAG_MULTSD = slurm.CLUSTER_FLAG_MULTSD
CLUSTER_FLAG_A9 = slurm.CLUSTER_FLAG_A9
CLUSTER_FLAG_FE = slurm.CLUSTER_FLAG_FE
CLUSTER_FLAG_CRAY = slurm.CLUSTER_FLAG_CRAY
CLUSTER_FLAG_FED = slurm.CLUSTER_FLAG_FED
CLUSTER_FLAG_EXT = slurm.CLUSTER_FLAG_EXT
Loading
Loading