Skip to content

Commit 8febf21

Browse files
rezibnjcarrierogiovtorres
authored
Support for Slurm 21.08 (#227)
* Expect slurm version 21.08 * Search slurm version in slurm_version.h Starting from Slurm >= 21.08, slurm version is declared in this dedicated header file. * Port templates to Slurm 21.08 These templates have been generated using autopxd2, installed with: $ pip install autopxd2 Then, *.pxd files have been generated using these commands: $ cd /usr/include $ autopxd --include-dir . slurm/slurm_errno.h > \ ~/pyslurm/jinja2/slurm_errno.h.pxd $ autopxd --include-dir . slurm/slurm.h > \ ~/pyslurm/jinja2/slurm.h.pxd $ autopxd --include-dir . slurm/slurmdb.h > \ ~/pyslurm/jinja2/slurmdb.h.pxd Then, jinja2/slurm.h.pxd and jinja2/slurmdb.h.pxd have been manually modified to: - Remove libc.stdint import - Remove duplicated slurm_errno symbols - Include defines from dedicated subdir Additionally: - in jinja2/slurm.h.pxd: - symbols SLURM_ERROR, SLURM_SUCCESS and SLURM_VERSION have been restored, - slurm_addr_t control_addr and pthread_mutex_t lock are commented out, just like before, to avoid compilation error with these types (they are not used by pyslurm). - in jinja2/slurmdb.h.pxd, all symbols duplicated in jinja2/slurm.h.pxd have been removed. This finally produces this commit. * Transpose e79981c in template * Update slurmdb CLUSTER_FLAGS defs for 21.08 * Update slurm CPU_FREQ defs for 21.08 * Update NODE_STATE defs for slurm 21.08 * Update DEBUG_FLAG defs for slurm 21.08 * Update READY_* defs for slurm 21.08 * Generate pyslurm/slurm.pxd based on template To generate this files, I used j2cli: $ pip install j2cli $ j2 jinja2/slurm.j2 > pyslurm/slurm.pxd * Update python structures for slurm 21.08 There are some new parameters, some have vanished, some have been renamed. * Update *.pxi following latest defs changes * Add new sibling arg to slurm_kill_job2() Slurm 21.08 slurm_kill_job2() now expects a fourth char* sibling argument. * Bump __version__ * Typo fix in slurmdb job dict key * Update slurm version in README * Update NODE_STATE in examples * Use docker image tag 21.08.0 for tests * Update test_slurm_api_version expected value * Use NULL slurmdb_connection_get persist_conn_flags Use hard-coded NULL slurm.slurmdb_connection_get() persist_conn_flags consistently. Persistent connections are not used in PySlurm. The variable was declared to NULL and not used elsewhere, the pointer was not preallocated in class slurmdb_jobs. I propose NULL to be used consistently in both cases. Co-authored-by: Nicholas Carriero <[email protected]> * Initialize and dealloc slurmdb_clusters db_conn Class slurmdb_clusters db_conn attribute is declared and used in get() but it was not initialized with a proper connection. Also close and free the allocation in __dealloc__(). Co-authored-by: Nicholas Carriero <[email protected]> * Add missing slurm_init() and slurm_fini() Starting from Slurm 20.11, slurm_init() must be called prior to any other Slurm library API calls. For the moment, its load Slurm configuration structure. For reference: SchedMD/slurm@e35a6e3 On the other side, slurm_fini() cleanup the configuration data structures in memory. Co-authored-by: Nicholas Carriero <[email protected]> * Call slurm_init() at pyslurm module load This way, PySlurm consumers do not have to do it explicitely. * Bump to docker-centos7-slurm:21.08.6 * fix: update tests to use pyenv Co-authored-by: Nicholas Carriero <[email protected]> Co-authored-by: Giovanni Torres <[email protected]>
1 parent fad9efa commit 8febf21

19 files changed

+307
-328
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This PySlurm branch has been tested with:
1616

1717
* Cython (latest stable)
1818
* Python 3.6, 3.7, 3.8, and 3.9
19-
* Slurm 20.11
19+
* Slurm 21.08
2020

2121
## Installation
2222

docker-compose-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.8"
22

33
services:
44
slurm:
5-
image: giovtorres/docker-centos7-slurm:20.11.8
5+
image: giovtorres/docker-centos7-slurm:21.08.6
66
hostname: slurmctl
77
container_name: slurmctl
88
stdin_open: true

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.8"
22

33
services:
44
slurm:
5-
image: giovtorres/docker-centos7-slurm:20.11.8
5+
image: giovtorres/docker-centos7-slurm:21.08.0
66
hostname: slurmctl
77
container_name: slurmctl
88
stdin_open: true

examples/node_update.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
NODE_STATE_DRAIN
99
NODE_STATE_COMPLETING
1010
NODE_STATE_NO_RESPOND
11-
NODE_STATE_POWER_SAVE
11+
NODE_STATE_POWERED_DOWN
1212
NODE_STATE_FAIL
13-
NODE_STATE_POWER_UP
13+
NODE_STATE_POWERING_UP
1414
1515
Some states are not valid on a Blue Gene
1616
"""

jinja2/defines/slurm_defines.pxd

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ uint32_t JOB_STAGE_OUT
4444

4545
uint8_t READY_JOB_ERROR
4646
uint8_t READY_JOB_FATAL
47+
uint8_t READY_NODE_STATE
48+
uint8_t READY_JOB_STATE
49+
uint8_t READY_PROLOG_STATE
4750

4851
uint8_t MAIL_JOB_BEGIN
4952
uint8_t MAIL_JOB_END
@@ -103,11 +106,6 @@ uint32_t CPU_FREQ_PERFORMANCE
103106
uint32_t CPU_FREQ_POWERSAVE
104107
uint32_t CPU_FREQ_USERSPACE
105108
uint32_t CPU_FREQ_GOV_MASK
106-
uint32_t CPU_FREQ_PERFORMANCE_OLD
107-
uint32_t CPU_FREQ_POWERSAVE_OLD
108-
uint32_t CPU_FREQ_USERSPACE_OLD
109-
uint32_t CPU_FREQ_ONDEMAND_OLD
110-
uint32_t CPU_FREQ_CONSERVATIVE_OLD
111109

112110
uint8_t NODE_STATE_BASE
113111
uint32_t NODE_STATE_FLAGS
@@ -119,13 +117,20 @@ uint16_t NODE_RESUME
119117
uint16_t NODE_STATE_DRAIN
120118
uint16_t NODE_STATE_COMPLETING
121119
uint16_t NODE_STATE_NO_RESPOND
122-
uint16_t NODE_STATE_POWER_SAVE
120+
uint16_t NODE_STATE_POWERED_DOWN
123121
uint16_t NODE_STATE_FAIL
124-
uint16_t NODE_STATE_POWER_UP
122+
uint16_t NODE_STATE_POWERING_UP
125123
uint16_t NODE_STATE_MAINT
126-
uint32_t NODE_STATE_REBOOT
127-
uint32_t NODE_STATE_CANCEL_REBOOT
124+
uint32_t NODE_STATE_REBOOT_REQUESTED
125+
uint32_t NODE_STATE_REBOOT_CANCEL
128126
uint32_t NODE_STATE_POWERING_DOWN
127+
uint32_t NODE_STATE_DYNAMIC
128+
uint32_t NODE_STATE_REBOOT_ISSUED
129+
uint32_t NODE_STATE_PLANNED
130+
uint32_t NODE_STATE_INVALID_REG
131+
uint32_t NODE_STATE_POWER_DOWN
132+
uint32_t NODE_STATE_POWER_UP
133+
uint32_t NODE_STATE_POWER_DRAIN
129134

130135
uint8_t SHOW_ALL
131136
uint8_t SHOW_DETAIL
@@ -293,9 +298,9 @@ uint8_t DEBUG_FLAG_SELECT_TYPE
293298
uint8_t DEBUG_FLAG_STEPS
294299
uint8_t DEBUG_FLAG_TRIGGERS
295300
uint8_t DEBUG_FLAG_CPU_BIND
301+
uint8_t DEBUG_FLAG_NET_RAW
296302
uint8_t DEBUG_FLAG_NO_CONF_HASH
297303
uint8_t DEBUG_FLAG_GRES
298-
uint8_t DEBUG_FLAG_TRES_NODE
299304
uint16_t DEBUG_FLAG_DATA
300305
uint16_t DEBUG_FLAG_WORKQ
301306
uint16_t DEBUG_FLAG_NET
@@ -304,14 +309,12 @@ uint16_t DEBUG_FLAG_BACKFILL
304309
uint16_t DEBUG_FLAG_GANG
305310
uint16_t DEBUG_FLAG_RESERVATION
306311
uint16_t DEBUG_FLAG_FRONT_END
307-
uint32_t DEBUG_FLAG_NO_REALTIME
308312
uint32_t DEBUG_FLAG_SWITCH
309313
uint32_t DEBUG_FLAG_ENERGY
310314
uint32_t DEBUG_FLAG_EXT_SENSORS
311315
uint32_t DEBUG_FLAG_LICENSE
312316
uint32_t DEBUG_FLAG_PROFILE
313317
uint32_t DEBUG_FLAG_INTERCONNECT
314-
uint32_t DEBUG_FLAG_FILESYSTEM
315318
uint32_t DEBUG_FLAG_JOB_CONT
316319
uint32_t DEBUG_FLAG_TASK
317320
uint32_t DEBUG_FLAG_PROTOCOL
@@ -339,9 +342,11 @@ uint64_t DEBUG_FLAG_NODE_FEATURES
339342
uint64_t DEBUG_FLAG_FEDR
340343
uint64_t DEBUG_FLAG_HETJOB
341344
uint64_t DEBUG_FLAG_ACCRUE
342-
uint64_t DEBUG_FLAG_POWER_SAVE
343345
uint64_t DEBUG_FLAG_AGENT
344346
uint64_t DEBUG_FLAG_DEPENDENCY
347+
uint64_t DEBUG_FLAG_JAG
348+
uint64_t DEBUG_FLAG_CGROUP
349+
uint64_t DEBUG_FLAG_SCRIPT
345350

346351
uint8_t PREEMPT_MODE_OFF
347352
uint8_t PREEMPT_MODE_SUSPEND

jinja2/defines/slurmdb_defines.pxd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ uint8_t CLUSTER_FLAG_A6
6767
uint8_t CLUSTER_FLAG_A7
6868
uint8_t CLUSTER_FLAG_MULTSD
6969
uint16_t CLUSTER_FLAG_A9
70-
uint16_t CLUSTER_FLAG_A10
7170
uint16_t CLUSTER_FLAG_FE
72-
uint16_t CLUSTER_FLAG_CRAY_N
71+
uint16_t CLUSTER_FLAG_CRAY
7372
uint16_t CLUSTER_FLAG_FED
7473
uint16_t CLUSTER_FLAG_EXT
75-
uint16_t CLUSTER_FLAG_CRAY
7674

7775
uint8_t SLURMDB_ASSOC_FLAG_NONE
7876
uint8_t SLURMDB_ASSOC_FLAG_DELETED

0 commit comments

Comments
 (0)