Skip to content
Snippets Groups Projects
Commit 281ae5e6 authored by Phil Eckert's avatar Phil Eckert
Browse files

Added support for getting reservation info.

parent d68846b3
No related branches found
No related tags found
No related merge requests found
AUTOMAKE_OPTIONS = foreign
AUTOMAKE_OPTIONS = foreign
# copied from pidgin
#
perl_dir = perl
......@@ -16,6 +16,7 @@ perl_sources = \
$(perl_dir)/launch.c \
$(perl_dir)/node.c \
$(perl_dir)/partition.c \
$(perl_dir)/reservation.c \
$(perl_dir)/trigger.c
$(perl_dir)/Makefile: $(perl_dir)/Makefile.PL
......
......@@ -23,6 +23,7 @@ extern void slurm_xfree(void **, const char *, int, const char *);
struct slurm {
node_info_msg_t *node_info_msg;
partition_info_msg_t *part_info_msg;
reserve_info_msg_t *reserve_info_msg;
slurm_ctl_conf_t *ctl_conf;
job_info_msg_t *job_info_msg;
job_step_info_response_msg_t *job_step_info_msg;
......@@ -42,6 +43,10 @@ free_slurm(void)
slurm_free_partition_info_msg(slurm.part_info_msg);
slurm.part_info_msg = NULL;
}
if(slurm.reserve_info_msg) {
slurm_free_reservation_info_msg(slurm.reserve_info_msg);
slurm.reserve_info_msg = NULL;
}
if(slurm.ctl_conf) {
slurm_free_ctl_conf(slurm.ctl_conf);
slurm.ctl_conf = NULL;
......@@ -395,6 +400,39 @@ slurm_load_ctl_conf(slurm_t self = NULL)
#void
#slurm_print_ctl_conf(slurm_t self, HV* conf)
######################################################################
# SLURM RESERVATION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
######################################################################
HV*
slurm_load_reservations(slurm_t self = NULL)
PREINIT:
reserve_info_msg_t* new_reserve_info_msg = NULL;
int rc;
CODE:
rc = slurm_load_reservations(
self->reserve_info_msg ?
self->reserve_info_msg->last_update : 0,
&new_reserve_info_msg);
if(rc == SLURM_SUCCESS) {
slurm_free_reservation_info_msg(self->reserve_info_msg);
self->reserve_info_msg = new_reserve_info_msg;
} else if(slurm_get_errno() == SLURM_NO_CHANGE_IN_DATA) {
/* nothing to do */
} else {
XSRETURN_UNDEF;
}
RETVAL = newHV();
sv_2mortal((SV*)RETVAL);
reserve_info_msg_to_hv(self->reserve_info_msg, RETVAL);
OUTPUT:
RETVAL
# To be implemented in perl code
# slurm_print_reservation_info_msg
# slurm_print_reservation_info
# slurm_sprint_reservation_info
######################################################################
# SLURM JOB CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
######################################################################
......@@ -723,7 +761,6 @@ slurm_delete_partition(slurm_t self, char* part_name)
&delete_msg
######################################################################
# SLURM PING/RECONFIGURE/SHUTDOWN FUNCTIONS
######################################################################
......
......@@ -24,12 +24,13 @@ extern int slurm_step_layout_to_hv(slurm_step_layout_t* step_layout, HV* hv);
extern int node_info_msg_to_hv(node_info_msg_t* node_info_msg, HV* hv);
extern int hv_to_update_node_msg(HV* hv, update_node_msg_t *update_msg);
extern int partition_info_msg_to_hv(partition_info_msg_t* part_info_msg,
HV* hv);
extern int partition_info_msg_to_hv(partition_info_msg_t* part_info_msg, HV *hv);
extern int hv_to_update_part_msg(HV* hv, update_part_msg_t* part_msg);
extern int slurm_ctl_conf_to_hv(slurm_ctl_conf_t* conf, HV* hv);
extern int reserve_info_msg_to_hv(reserve_info_msg_t* conf, HV* hv);
extern int trigger_info_to_hv(trigger_info_t *info, HV* hv);
extern int trigger_info_msg_to_hv(trigger_info_msg_t *msg, HV* hv);
extern int hv_to_trigger_info(HV* hv, trigger_info_t* info);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment