Skip to content

Commit 8817146

Browse files
committed
refactor the slurmctld stuff into seperate modules
1 parent 7724b57 commit 8817146

File tree

6 files changed

+702
-510
lines changed

6 files changed

+702
-510
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# cython: c_string_type=unicode, c_string_encoding=default
2+
# cython: language_level=3
3+
4+
from .config cimport Config

pyslurm/core/slurmctld/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from .config import (
2+
Config,
3+
MPIConfig,
4+
AccountingGatherConfig,
5+
CgroupConfig,
6+
)
7+
from .base import (
8+
PingResponse,
9+
ShutdownMode,
10+
ping,
11+
ping_primary,
12+
ping_backup,
13+
ping_all,
14+
shutdown,
15+
reconfigure,
16+
takeover,
17+
add_debug_flags,
18+
remove_debug_flags,
19+
clear_debug_flags,
20+
get_debug_flags,
21+
set_log_level,
22+
get_log_level,
23+
enable_scheduler_logging,
24+
is_scheduler_logging_enabled,
25+
set_fair_share_dampening_factor,
26+
get_fair_share_dampening_factor,
27+
)

pyslurm/core/slurmctld/base.pxd

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#########################################################################
2+
# slurmctld/base.pxd - pyslurm slurmctld api functions
3+
#########################################################################
4+
# Copyright (C) 2025 Toni Harzendorf <[email protected]>
5+
#
6+
# This file is part of PySlurm
7+
#
8+
# PySlurm is free software; you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation; either version 2 of the License, or
11+
# (at your option) any later version.
12+
13+
# PySlurm is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License along
19+
# with PySlurm; if not, write to the Free Software Foundation, Inc.,
20+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21+
#
22+
# cython: c_string_type=unicode, c_string_encoding=default
23+
# cython: language_level=3
24+
25+
from pyslurm cimport slurm
26+
from pyslurm.slurm cimport (
27+
slurm_conf_t,
28+
slurm_reconfigure,
29+
slurm_shutdown,
30+
slurm_ping,
31+
slurm_takeover,
32+
slurm_set_debugflags,
33+
slurm_set_debug_level,
34+
slurm_set_schedlog_level,
35+
slurm_set_fs_dampeningfactor,
36+
)
37+
from libc.stdint cimport uint16_t, uint64_t
38+
from pyslurm.utils.uint cimport u16_parse
39+
from pyslurm.utils cimport cstr
40+
41+
42+
cdef class PingResponse:
43+
"""Slurm Controller Ping response information"""
44+
45+
cdef public:
46+
is_primary
47+
is_responding
48+
index
49+
hostname
50+
latency

0 commit comments

Comments
 (0)