diff --git a/NEWS b/NEWS index 7a83c84e0cf8fedd52ba471ac0c33225f0b09af4..777f2045c0d9cd16e4206c72af26035d91c8c847 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ documents those changes that are of interest to users and admins. * Changes in SLURM 1.3.0-pre5 ============================= + -- Add select_g_reconfigure() function to node changes in slurmctld configuration + that can impact node scheduling. * Changes in SLURM 1.3.0-pre4 ============================= diff --git a/doc/html/selectplugins.shtml b/doc/html/selectplugins.shtml index 2cd4ba6b2d21a6d26558188715f30288a22b2274..d295e64af7d73eb9389d7bdceb127c3a9e091ec3 100644 --- a/doc/html/selectplugins.shtml +++ b/doc/html/selectplugins.shtml @@ -339,7 +339,7 @@ state of the node.</p> <p class="commandline">int select_p_alter_node_cnt (enum select_node_cnt type, void *data);</p> <p style="margin-left:.2in"><b>Description</b>: Used for systems like -a Bluegene system where slurm sees 1 node where many nodes really +a Bluegene system where SLURM sees 1 node where many nodes really exists, in Bluegene's case 1 node reflects 512 nodes in real live, but since usually 512 is the smallest allocatable block slurm only handles it as 1 node. This is a function so the user can issue a 'real' @@ -352,6 +352,13 @@ telling the plug in what the user is really wanting.<br> Is a void * so depending on the type sent in argument 1 this should adjust the variable returning what the user is asking for.</p> <p style="margin-left:.2in"><b>Returns</b>: SLURM_SUCCESS if successful, otherwise SLURM_ERROR</p> + +<p class="commandline">int select_p_reconfigure (void);</p> +<p style="margin-left:.2in"><b>Description</b>: Used to notify plugin +of change in partition configuration or general configuration change. +The plugin will test global variables for changes as appropriate.</p> +<p style="margin-left:.2in"><b>Returns</b>: SLURM_SUCCESS if successful, otherwise SLURM_ERROR</p> + <p class="footer"><a href="#top">top</a></p> <h2>Versioning</h2> @@ -364,6 +371,6 @@ to maintain data format compatibility across different versions of the plugin.</ <p class="footer"><a href="#top">top</a></p> -<p style="text-align:center;">Last modified 12 October 2006</p> +<p style="text-align:center;">Last modified 8 October 2007</p> <!--#include virtual="footer.txt"--> diff --git a/src/common/node_select.c b/src/common/node_select.c index 185b3133a13dfd330bbad87fdb9ae2aa357911f5..3fd10e6c5891e67efc7978a3f6f397b1b182ddcc 100644 --- a/src/common/node_select.c +++ b/src/common/node_select.c @@ -106,6 +106,7 @@ typedef struct slurm_select_ops { int (*update_node_state) (int index, uint16_t state); int (*alter_node_cnt) (enum select_node_cnt type, void *data); + int (*reconfigure) (void); } slurm_select_ops_t; typedef struct slurm_select_context { @@ -180,7 +181,8 @@ static slurm_select_ops_t * _select_get_ops(slurm_select_context_t *c) "select_p_update_sub_node", "select_p_get_info_from_plugin", "select_p_update_node_state", - "select_p_alter_node_cnt" + "select_p_alter_node_cnt", + "select_p_reconfigure" }; int n_syms = sizeof( syms ) / sizeof( char * ); @@ -499,6 +501,17 @@ extern int select_g_alter_node_cnt (enum select_node_cnt type, void *data) return (*(g_select_context->ops.alter_node_cnt))(type, data); } +/* + * Note reconfiguration or change in partition configuration + */ +extern int select_g_reconfigure (void) +{ + if (slurm_select_init() < 0) + return SLURM_ERROR; + + return (*(g_select_context->ops.reconfigure))(); +} + /* * Select the "best" nodes for given job from those available * IN job_ptr - pointer to job being considered for initiation diff --git a/src/common/node_select.h b/src/common/node_select.h index fb13dea0662604fc21d81dd192cc6ec43bfc19b9..22843667be6ef685fbc57f762d62b793086583c1 100644 --- a/src/common/node_select.h +++ b/src/common/node_select.h @@ -294,4 +294,7 @@ extern int select_g_unpack_node_info(node_select_info_msg_t ** extern int select_g_free_node_info(node_select_info_msg_t ** node_select_info_msg_pptr); +/* Note reconfiguration or change in partition configuration */ +extern int select_g_reconfigure(void); + #endif /*__SELECT_PLUGIN_API_H__*/ diff --git a/src/plugins/select/bluegene/plugin/select_bluegene.c b/src/plugins/select/bluegene/plugin/select_bluegene.c index 711dbbb3b2869176a0e09a5a5e80506f49be84f6..dc5e992a086161e399ec794c015e0af74f2fb970 100644 --- a/src/plugins/select/bluegene/plugin/select_bluegene.c +++ b/src/plugins/select/bluegene/plugin/select_bluegene.c @@ -1230,3 +1230,9 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) return SLURM_SUCCESS; } + +extern int select_p_reconfigure(void) +{ + return SLURM_SUCCESS; +} + diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c index 13dbfb720bf0851c77e9cb6723cef63bcf387fb4..0404b98343bacee2403881f002709041e4127080 100644 --- a/src/plugins/select/cons_res/select_cons_res.c +++ b/src/plugins/select/cons_res/select_cons_res.c @@ -2496,3 +2496,8 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) { return SLURM_SUCCESS; } + +extern int select_p_reconfigure(void) +{ + return SLURM_SUCCESS; +} diff --git a/src/plugins/select/linear/select_linear.c b/src/plugins/select/linear/select_linear.c index ba91918cb38b09eec5ce919fff45b8013aac20e2..803cb9e73d768935eb5a666579600da3d094042e 100644 --- a/src/plugins/select/linear/select_linear.c +++ b/src/plugins/select/linear/select_linear.c @@ -760,3 +760,9 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) { return SLURM_SUCCESS; } + +extern int select_p_reconfigure(void) +{ + return SLURM_SUCCESS; +} + diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index a49358171df5cee054cdc73a7fda1980a19c8a1f..1247b9e531f500a9f617f376bcfce9949460a9fd 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -549,7 +549,8 @@ static void *_slurmctld_signal_hand(void *no_data) } unlock_slurmctld(config_write_lock); trigger_reconfig(); - slurm_sched_partition_change(); + slurm_sched_partition_change(); /* notify sched plugin */ + select_g_reconfigure(); /* notify select plugin too */ break; case SIGABRT: /* abort */ info("SIGABRT received"); diff --git a/src/slurmctld/partition_mgr.c b/src/slurmctld/partition_mgr.c index 8b4177163c6cce3fc3a6e0149aca550b53999d22..a51263c76b868340c089b96f639c97c3bc89e0ef 100644 --- a/src/slurmctld/partition_mgr.c +++ b/src/slurmctld/partition_mgr.c @@ -892,7 +892,8 @@ int update_part(update_part_msg_t * part_desc) if (error_code == SLURM_SUCCESS) { slurm_sched_partition_change(); /* notify sched plugin */ - reset_job_priority(); /* free jobs */ + select_g_reconfigure(); /* notify select plugin too */ + reset_job_priority(); /* free jobs */ if (select_g_block_init(part_list) != SLURM_SUCCESS ) error("failed to update node selection plugin state"); } diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c index 04faeeb529b7ac85a0b6659941f5e07873865fad..7934d99775d38f56c71a5d10c358084806f62c80 100644 --- a/src/slurmctld/proc_req.c +++ b/src/slurmctld/proc_req.c @@ -1488,8 +1488,9 @@ static void _slurm_rpc_reconfigure_controller(slurm_msg_t * msg) info("_slurm_rpc_reconfigure_controller: completed %s", TIME_STR); slurm_send_rc_msg(msg, SLURM_SUCCESS); - slurm_sched_partition_change(); - schedule(); /* has its own locks */ + slurm_sched_partition_change(); /* notify sched plugin */ + select_g_reconfigure(); /* notify select plugin too */ + schedule(); /* has its own locks */ save_all_state(); } }