|
| 1 | +# |
| 2 | +# Structs that are not in the Slurm headers, which need to be redefined |
| 3 | +# in order to implement certain features. |
| 4 | +# |
| 5 | +# For example: to communicate with the slurmctld directly in order |
| 6 | +# to retrieve the actual batch-script as a string. |
| 7 | +# |
| 8 | + |
| 9 | +# https://github.com/SchedMD/slurm/blob/26abe9188ea8712ba1eab4a8eb6322851f06a108/src/common/slurm_persist_conn.h#L51 |
| 10 | +ctypedef enum persist_conn_type_t: |
| 11 | + PERSIST_TYPE_NONE = 0 |
| 12 | + PERSIST_TYPE_DBD |
| 13 | + PERSIST_TYPE_FED |
| 14 | + PERSIST_TYPE_HA_CTL |
| 15 | + PERSIST_TYPE_HA_DBD |
| 16 | + PERSIST_TYPE_ACCT_UPDATE |
| 17 | + |
| 18 | +# https://github.com/SchedMD/slurm/blob/26abe9188ea8712ba1eab4a8eb6322851f06a108/src/common/slurm_persist_conn.h#L59 |
| 19 | +ctypedef struct persist_msg_t: |
| 20 | + void *conn |
| 21 | + void *data |
| 22 | + uint32_t data_size |
| 23 | + uint16_t msg_type |
| 24 | + |
| 25 | +ctypedef int (*_slurm_persist_conn_t_callback_proc) (void *arg, persist_msg_t *msg, buf_t **out_buffer, uint32_t *uid) |
| 26 | +ctypedef void (*_slurm_persist_conn_t_callback_fini)(void *arg) |
| 27 | + |
| 28 | +# https://github.com/SchedMD/slurm/blob/26abe9188ea8712ba1eab4a8eb6322851f06a108/src/common/slurm_persist_conn.h#L66 |
| 29 | +ctypedef struct slurm_persist_conn_t: |
| 30 | + void *auth_cred |
| 31 | + _slurm_persist_conn_t_callback_proc callback_proc |
| 32 | + _slurm_persist_conn_t_callback_fini callback_fini |
| 33 | + char *cluster_name |
| 34 | + time_t comm_fail_time |
| 35 | + uint16_t my_port |
| 36 | + int fd |
| 37 | + uint16_t flags |
| 38 | + bool inited |
| 39 | + persist_conn_type_t persist_type |
| 40 | + uid_t r_uid |
| 41 | + char *rem_host |
| 42 | + uint16_t rem_port |
| 43 | + time_t *shutdown |
| 44 | + pthread_t thread_id |
| 45 | + int timeout |
| 46 | + slurm_trigger_callbacks_t trigger_callbacks; |
| 47 | + uint16_t version |
| 48 | + |
| 49 | +# https://github.com/SchedMD/slurm/blob/20e2b354168aeb0f76d67f80122d80925c2ef32b/src/common/pack.h#L68 |
| 50 | +ctypedef struct buf_t: |
| 51 | + uint32_t magic |
| 52 | + char *head |
| 53 | + uint32_t size |
| 54 | + uint32_t processed |
| 55 | + bool mmaped |
| 56 | + |
| 57 | +# https://github.com/SchedMD/slurm/blob/20e2b354168aeb0f76d67f80122d80925c2ef32b/src/common/pack.h#L68 |
| 58 | +ctypedef struct return_code_msg_t: |
| 59 | + uint32_t return_code |
| 60 | + |
| 61 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.h#L650 |
| 62 | +ctypedef struct job_id_msg_t: |
| 63 | + uint32_t job_id |
| 64 | + uint16_t show_flags |
| 65 | + |
| 66 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.h#L216 |
| 67 | +# Only partially defined - not everything needed at the moment. |
| 68 | +ctypedef enum slurm_msg_type_t: |
| 69 | + REQUEST_SHARE_INFO = 2022 |
| 70 | + REQUEST_BATCH_SCRIPT = 2051 |
| 71 | + RESPONSE_BATCH_SCRIPT = 2052 |
| 72 | + RESPONSE_SLURM_RC = 8001 |
| 73 | + |
| 74 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.h#L469 |
| 75 | +ctypedef struct forward_t: |
| 76 | + uint16_t cnt |
| 77 | + uint16_t init |
| 78 | + char *nodelist |
| 79 | + uint32_t timeout |
| 80 | + uint16_t tree_width |
| 81 | + |
| 82 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.h#L491 |
| 83 | +ctypedef struct forward_struct_t: |
| 84 | + char *buf |
| 85 | + int buf_len |
| 86 | + uint16_t fwd_cnt |
| 87 | + pthread_mutex_t forward_mutex |
| 88 | + pthread_cond_t notify |
| 89 | + List ret_list |
| 90 | + uint32_t timeout |
| 91 | + |
| 92 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.h#L514 |
| 93 | +ctypedef struct slurm_msg_t: |
| 94 | + slurm_addr_t address |
| 95 | + void *auth_cred |
| 96 | + int auth_index |
| 97 | + uid_t auth_uid |
| 98 | + bool auth_uid_set |
| 99 | + uid_t restrict_uid |
| 100 | + bool restrict_uid_set |
| 101 | + uint32_t body_offset |
| 102 | + buf_t *buffer |
| 103 | + slurm_persist_conn_t *conn |
| 104 | + int conn_fd |
| 105 | + void *data |
| 106 | + uint32_t data_size |
| 107 | + uint16_t flags |
| 108 | + uint8_t hash_index |
| 109 | + uint16_t msg_type |
| 110 | + uint16_t protocol_version |
| 111 | + forward_t forward |
| 112 | + forward_struct_t *forward_struct |
| 113 | + slurm_addr_t orig_addr |
| 114 | + List ret_list |
| 115 | + |
| 116 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.c#L865 |
| 117 | +cdef extern void slurm_free_return_code_msg(return_code_msg_t *msg) |
| 118 | + |
| 119 | +# https://github.com/SchedMD/slurm/blob/2d2e83674b59410a7ed8ab6fc8d8acfcfa8beaf9/src/common/slurm_protocol_api.c#L2401 |
| 120 | +cdef extern int slurm_send_recv_controller_msg(slurm_msg_t *request_msg, |
| 121 | + slurm_msg_t *response_msg, |
| 122 | + slurmdb_cluster_rec_t *working_cluster_rec) |
| 123 | + |
| 124 | +# https://github.com/SchedMD/slurm/blob/fe82218def7b57f5ecda9222e80662ebbb6415f8/src/common/slurm_protocol_defs.c#L168 |
| 125 | +cdef extern void slurm_msg_t_init(slurm_msg_t *msg) |
| 126 | + |
| 127 | + |
1 | 128 | # Global Environment
|
| 129 | + |
2 | 130 | cdef extern char **environ
|
3 | 131 |
|
4 | 132 | #
|
|
0 commit comments