diff --git a/src/common/gres.c b/src/common/gres.c index d5933fdff327f099872723d5d04eb55ea96e1980..6366159ffdda0aa9a7789aedcb91348c90af05ca 100644 --- a/src/common/gres.c +++ b/src/common/gres.c @@ -82,6 +82,9 @@ typedef struct slurm_gres_ops { int (*load_node_config) ( void ); int (*pack_node_config) ( Buf buffer ); int (*unpack_node_config) ( Buf buffer ); + int (*node_config_init) ( char *node_name, + char *orig_config, + void **gres_data ); int (*node_config_validate) ( char *node_name, char *orig_config, char **new_config, @@ -173,6 +176,7 @@ static int _load_gres_plugin(char *plugin_name, "load_node_config", "pack_node_config", "unpack_node_config", + "node_config_init", "node_config_validate", "node_reconfig", "node_config_delete", @@ -600,6 +604,50 @@ static void _gres_node_list_delete(void *list_element) slurm_mutex_unlock(&gres_context_lock); } +/* + * Build a node's gres record based only upon the slurm.conf contents + * IN node_name - name of the node for which the gres information applies + * IN orig_config - Gres information supplied from slurm.conf + * IN/OUT gres_list - List of Gres records for this node to track usage + */ +extern int gres_plugin_init_node_config(char *node_name, char *orig_config, + List *gres_list) +{ + int i, rc; + ListIterator gres_iter; + gres_state_t *gres_ptr; + + rc = gres_plugin_init(); + + slurm_mutex_lock(&gres_context_lock); + if ((gres_context_cnt > 0) && (*gres_list == NULL)) { + *gres_list = list_create(_gres_node_list_delete); + if (*gres_list == NULL) + fatal("list_create malloc failure"); + } + for (i=0; ((i < gres_context_cnt) && (rc == SLURM_SUCCESS)); i++) { + /* Find or create gres_state entry on the list */ + gres_iter = list_iterator_create(*gres_list); + while ((gres_ptr = (gres_state_t *) list_next(gres_iter))) { + if (gres_ptr->plugin_id == + *(gres_context[i].ops.plugin_id)) + break; + } + list_iterator_destroy(gres_iter); + if (gres_ptr == NULL) { + gres_ptr = xmalloc(sizeof(gres_state_t)); + gres_ptr->plugin_id = *(gres_context[i].ops.plugin_id); + list_append(*gres_list, gres_ptr); + } + + rc = (*(gres_context[i].ops.node_config_init)) + (node_name, orig_config, &gres_ptr->gres_data); + } + slurm_mutex_unlock(&gres_context_lock); + + return rc; +} + /* * Validate a node's configuration and put a gres record onto a list * Called immediately after gres_plugin_unpack_node_config(). @@ -612,7 +660,7 @@ static void _gres_node_list_delete(void *list_element) * 2: Don't validate hardware, use slurm.conf configuration * OUT reason_down - set to an explanation of failure, if any, don't set if NULL */ -extern int gres_plugin_node_config_validate(char *node_name, +extern int gres_plugin_node_config_validate(char *node_name, char *orig_config, char **new_config, List *gres_list, @@ -1320,7 +1368,7 @@ extern uint32_t gres_plugin_job_test(List job_gres_list, List node_gres_list, if (job_gres_list == NULL) return NO_VAL; if (node_gres_list == NULL) - return (uint32_t) 0; + return NO_VAL; cpu_cnt = NO_VAL; (void) gres_plugin_init(); diff --git a/src/common/gres.h b/src/common/gres.h index 25128c6aa3b53c193c132d4f5ce0330f95ee8b12..acc85e8e0c181256b1be24dc59a87e8a826474fc 100644 --- a/src/common/gres.h +++ b/src/common/gres.h @@ -95,6 +95,15 @@ extern int gres_plugin_pack_node_config(Buf buffer); * PLUGIN CALLS FOR SLURMCTLD DAEMON * ************************************************************************** */ +/* + * Build a node's gres record based only upon the slurm.conf contents + * IN node_name - name of the node for which the gres information applies + * IN orig_config - Gres information supplied from slurm.conf + * IN/OUT gres_list - List of Gres records for this node to track usage + */ +extern int gres_plugin_init_node_config(char *node_name, char *orig_config, + List *gres_list); + /* * Unpack this node's configuration from a buffer * IN buffer - message buffer to unpack diff --git a/src/plugins/gres/gpu/gres_gpu.c b/src/plugins/gres/gpu/gres_gpu.c index de61ea95208b1cf882e707979ed62bf5991f3931..35dd1f48efdcff309eb6895a918aa02072d0e253 100644 --- a/src/plugins/gres/gpu/gres_gpu.c +++ b/src/plugins/gres/gpu/gres_gpu.c @@ -248,6 +248,65 @@ extern void node_config_delete(void *gres_data) xfree(gres_ptr); } +extern int node_config_init(char *node_name, char *orig_config, + void **gres_data) +{ + int rc = SLURM_SUCCESS; + gpu_node_state_t *gres_ptr; + char *node_gres_config, *tok, *last = NULL; + int32_t gres_config_cnt = 0; + bool updated_config = false; + + xassert(gres_data); + gres_ptr = (gpu_node_state_t *) *gres_data; + if (gres_ptr == NULL) { + gres_ptr = xmalloc(sizeof(gpu_node_state_t)); + *gres_data = gres_ptr; + gres_ptr->gpu_cnt_config = NO_VAL; + gres_ptr->gpu_cnt_found = NO_VAL; + updated_config = true; + } + + /* If the resource isn't configured for use with this node, + * just return leaving gpu_cnt_config=0, gpu_cnt_avail=0, etc. */ + if ((orig_config == NULL) || (orig_config[0] == '\0') || + (updated_config == false)) + return rc; + + node_gres_config = xstrdup(orig_config); + tok = strtok_r(node_gres_config, ",", &last); + while (tok) { + if (!strcmp(tok, "gpu")) { + gres_config_cnt = 1; + break; + } + if (!strncmp(tok, "gpu:", 4)) { + gres_config_cnt = strtol(tok+4, &last, 10); + if (last[0] == '\0') + ; + else if ((last[0] == 'k') || (last[0] == 'K')) + gres_config_cnt *= 1024; + break; + } + tok = strtok_r(NULL, ",", &last); + } + xfree(node_gres_config); + + gres_ptr->gpu_cnt_config = gres_config_cnt; + gres_ptr->gpu_cnt_avail = gres_config_cnt; + if (gres_ptr->gpu_bit_alloc == NULL) { + gres_ptr->gpu_bit_alloc = bit_alloc(gres_ptr->gpu_cnt_avail); + } else if (gres_ptr->gpu_cnt_avail > + bit_size(gres_ptr->gpu_bit_alloc)) { + gres_ptr->gpu_bit_alloc = bit_realloc(gres_ptr->gpu_bit_alloc, + gres_ptr->gpu_cnt_avail); + } + if (gres_ptr->gpu_bit_alloc == NULL) + fatal("bit_alloc: malloc failure"); + + return rc; +} + /* * Validate a node's configuration and put a gres record onto a list * Called immediately after unpack_node_config(). @@ -268,7 +327,7 @@ extern int node_config_validate(char *node_name, int rc = SLURM_SUCCESS; gpu_node_state_t *gres_ptr; char *node_gres_config, *tok, *last = NULL; - int32_t gres_config_cnt = -1; + uint32_t gres_config_cnt = 0; bool updated_config = false; xassert(gres_data); @@ -276,7 +335,8 @@ extern int node_config_validate(char *node_name, if (gres_ptr == NULL) { gres_ptr = xmalloc(sizeof(gpu_node_state_t)); *gres_data = gres_ptr; - gres_ptr->gpu_cnt_found = gres_config.gpu_cnt; + gres_ptr->gpu_cnt_config = NO_VAL; + gres_ptr->gpu_cnt_found = gres_config.gpu_cnt; updated_config = true; } else if (gres_ptr->gpu_cnt_found != gres_config.gpu_cnt) { if (gres_ptr->gpu_cnt_found != NO_VAL) { @@ -287,39 +347,37 @@ extern int node_config_validate(char *node_name, gres_ptr->gpu_cnt_found = gres_config.gpu_cnt; updated_config = true; } - - /* If the resource isn't configured for use with this node, - * just return leaving gpu_cnt_config=0, gpu_cnt_avail=0, etc. */ - if ((orig_config == NULL) || (orig_config[0] == '\0') || - (updated_config == false)) + if (updated_config == false) return SLURM_SUCCESS; - node_gres_config = xstrdup(orig_config); - tok = strtok_r(node_gres_config, ",", &last); - while (tok) { - if (!strcmp(tok, "gpu")) { - gres_config_cnt = 1; - break; - } - if (!strncmp(tok, "gpu:", 4)) { - gres_config_cnt = strtol(tok+4, &last, 10); - if (last[0] == '\0') - ; - else if ((last[0] == 'k') || (last[0] == 'K')) - gres_config_cnt *= 1024; - break; + if ((orig_config == NULL) || (orig_config[0] == '\0')) + gres_ptr->gpu_cnt_config = 0; + else if (gres_ptr->gpu_cnt_config == NO_VAL) { + node_gres_config = xstrdup(orig_config); + tok = strtok_r(node_gres_config, ",", &last); + while (tok) { + if (!strcmp(tok, "gpu")) { + gres_config_cnt = 1; + break; + } + if (!strncmp(tok, "gpu:", 4)) { + gres_config_cnt = strtol(tok+4, &last, 10); + if (last[0] == '\0') + ; + else if ((last[0] == 'k') || (last[0] == 'K')) + gres_config_cnt *= 1024; + break; + } + tok = strtok_r(NULL, ",", &last); } - tok = strtok_r(NULL, ",", &last); + xfree(node_gres_config); + gres_ptr->gpu_cnt_config = gres_config_cnt; } - gres_ptr->gpu_cnt_config = gres_config_cnt; - xfree(node_gres_config); - if (gres_config_cnt < 0) - ; /* not configured for use */ - else if (fast_schedule == 0) - gres_ptr->gpu_cnt_avail = gres_ptr->gpu_cnt_found; - else + if ((gres_ptr->gpu_cnt_config == 0) || (fast_schedule > 0)) gres_ptr->gpu_cnt_avail = gres_ptr->gpu_cnt_config; + else + gres_ptr->gpu_cnt_avail = gres_ptr->gpu_cnt_found; if (gres_ptr->gpu_bit_alloc == NULL) { gres_ptr->gpu_bit_alloc = bit_alloc(gres_ptr->gpu_cnt_avail); @@ -327,9 +385,9 @@ extern int node_config_validate(char *node_name, bit_size(gres_ptr->gpu_bit_alloc)) { gres_ptr->gpu_bit_alloc = bit_realloc(gres_ptr->gpu_bit_alloc, gres_ptr->gpu_cnt_avail); + if (gres_ptr->gpu_bit_alloc == NULL) + fatal("bit_alloc: malloc failure"); } - if (gres_ptr->gpu_bit_alloc == NULL) - fatal("bit_alloc: malloc failure"); if ((fast_schedule < 2) && (gres_ptr->gpu_cnt_found < gres_ptr->gpu_cnt_config)) { @@ -385,9 +443,10 @@ extern int node_reconfig(char *node_name, char *orig_config, char **new_config, xassert(gres_data); gres_ptr = (gpu_node_state_t *) *gres_data; if (gres_ptr == NULL) { - /* Assume that node has not yet registerd */ - info("%s record is NULL for node %s", plugin_name, node_name); - return rc; + gres_ptr = xmalloc(sizeof(gpu_node_state_t)); + *gres_data = gres_ptr; + gres_ptr->gpu_cnt_config = NO_VAL; + gres_ptr->gpu_cnt_found = NO_VAL; } node_gres_config = xstrdup(orig_config); @@ -410,10 +469,11 @@ extern int node_reconfig(char *node_name, char *orig_config, char **new_config, gres_ptr->gpu_cnt_config = gres_config_cnt; xfree(node_gres_config); - if (fast_schedule == 0) - gres_ptr->gpu_cnt_avail = gres_ptr->gpu_cnt_found; - else if (gres_ptr->gpu_cnt_config != NO_VAL) + if ((gres_ptr->gpu_cnt_config == 0) || (fast_schedule > 0) || + (gres_ptr->gpu_cnt_found == NO_VAL)) gres_ptr->gpu_cnt_avail = gres_ptr->gpu_cnt_config; + else + gres_ptr->gpu_cnt_avail = gres_ptr->gpu_cnt_found; if (gres_ptr->gpu_bit_alloc == NULL) { gres_ptr->gpu_bit_alloc = bit_alloc(gres_ptr->gpu_cnt_avail); @@ -425,13 +485,15 @@ extern int node_reconfig(char *node_name, char *orig_config, char **new_config, if (gres_ptr->gpu_bit_alloc == NULL) fatal("bit_alloc: malloc failure"); - if ((fast_schedule < 2) && - (gres_ptr->gpu_cnt_found < gres_ptr->gpu_cnt_config)) { + if ((fast_schedule < 2) && + (gres_ptr->gpu_cnt_found != NO_VAL) && + (gres_ptr->gpu_cnt_found < gres_ptr->gpu_cnt_config)) { /* Do not set node DOWN, but give the node * a chance to register with more resources */ gres_ptr->gpu_cnt_found = NO_VAL; - } else if ((fast_schedule == 0) && - (gres_ptr->gpu_cnt_found > gres_ptr->gpu_cnt_config)) { + } else if ((fast_schedule == 0) && + (gres_ptr->gpu_cnt_found != NO_VAL) && + (gres_ptr->gpu_cnt_found > gres_ptr->gpu_cnt_config)) { /* need to rebuild new_config */ char *new_configured_res = NULL; if (*new_config) @@ -567,7 +629,19 @@ extern int node_state_realloc(void *job_gres_data, int node_offset, job_bit_size = bit_size(job_gres_ptr->gpu_bit_alloc[node_offset]); node_bit_size = bit_size(node_gres_ptr->gpu_bit_alloc); - if (job_bit_size != node_bit_size) { + if (job_bit_size > node_bit_size) { + error("%s job/node bit size mismatch (%d != %d)", + plugin_name, job_bit_size, node_bit_size); + /* Node needs to register with more resources, expand + * node's bitmap now so we can merge the data */ + node_gres_ptr->gpu_bit_alloc = + bit_realloc(node_gres_ptr->gpu_bit_alloc, + job_bit_size); + if (node_gres_ptr->gpu_bit_alloc == NULL) + fatal("bit_realloc: malloc failure"); + node_bit_size = job_bit_size; + } + if (job_bit_size < node_bit_size) { error("%s job/node bit size mismatch (%d != %d)", plugin_name, job_bit_size, node_bit_size); /* Update what we can */ diff --git a/src/plugins/gres/nic/gres_nic.c b/src/plugins/gres/nic/gres_nic.c index e15fc7c47f849f2a7a1829f23531a620977bac39..2daf2b1ae55cc7cad7668b4d9e24fb240ed93c31 100644 --- a/src/plugins/gres/nic/gres_nic.c +++ b/src/plugins/gres/nic/gres_nic.c @@ -248,6 +248,65 @@ extern void node_config_delete(void *gres_data) xfree(gres_ptr); } +extern int node_config_init(char *node_name, char *orig_config, + void **gres_data) +{ + int rc = SLURM_SUCCESS; + nic_node_state_t *gres_ptr; + char *node_gres_config, *tok, *last = NULL; + int32_t gres_config_cnt = 0; + bool updated_config = false; + + xassert(gres_data); + gres_ptr = (nic_node_state_t *) *gres_data; + if (gres_ptr == NULL) { + gres_ptr = xmalloc(sizeof(nic_node_state_t)); + *gres_data = gres_ptr; + gres_ptr->nic_cnt_config = NO_VAL; + gres_ptr->nic_cnt_found = NO_VAL; + updated_config = true; + } + + /* If the resource isn't configured for use with this node, + * just return leaving nic_cnt_config=0, nic_cnt_avail=0, etc. */ + if ((orig_config == NULL) || (orig_config[0] == '\0') || + (updated_config == false)) + return rc; + + node_gres_config = xstrdup(orig_config); + tok = strtok_r(node_gres_config, ",", &last); + while (tok) { + if (!strcmp(tok, "nic")) { + gres_config_cnt = 1; + break; + } + if (!strncmp(tok, "nic:", 4)) { + gres_config_cnt = strtol(tok+4, &last, 10); + if (last[0] == '\0') + ; + else if ((last[0] == 'k') || (last[0] == 'K')) + gres_config_cnt *= 1024; + break; + } + tok = strtok_r(NULL, ",", &last); + } + xfree(node_gres_config); + + gres_ptr->nic_cnt_config = gres_config_cnt; + gres_ptr->nic_cnt_avail = gres_config_cnt; + if (gres_ptr->nic_bit_alloc == NULL) { + gres_ptr->nic_bit_alloc = bit_alloc(gres_ptr->nic_cnt_avail); + } else if (gres_ptr->nic_cnt_avail > + bit_size(gres_ptr->nic_bit_alloc)) { + gres_ptr->nic_bit_alloc = bit_realloc(gres_ptr->nic_bit_alloc, + gres_ptr->nic_cnt_avail); + } + if (gres_ptr->nic_bit_alloc == NULL) + fatal("bit_alloc: malloc failure"); + + return rc; +} + /* * Validate a node's configuration and put a gres record onto a list * Called immediately after unpack_node_config(). @@ -268,7 +327,7 @@ extern int node_config_validate(char *node_name, int rc = SLURM_SUCCESS; nic_node_state_t *gres_ptr; char *node_gres_config, *tok, *last = NULL; - int32_t gres_config_cnt = -1; + uint32_t gres_config_cnt = 0; bool updated_config = false; xassert(gres_data); @@ -276,7 +335,8 @@ extern int node_config_validate(char *node_name, if (gres_ptr == NULL) { gres_ptr = xmalloc(sizeof(nic_node_state_t)); *gres_data = gres_ptr; - gres_ptr->nic_cnt_found = gres_config.nic_cnt; + gres_ptr->nic_cnt_config = NO_VAL; + gres_ptr->nic_cnt_found = gres_config.nic_cnt; updated_config = true; } else if (gres_ptr->nic_cnt_found != gres_config.nic_cnt) { if (gres_ptr->nic_cnt_found != NO_VAL) { @@ -287,39 +347,37 @@ extern int node_config_validate(char *node_name, gres_ptr->nic_cnt_found = gres_config.nic_cnt; updated_config = true; } - - /* If the resource isn't configured for use with this node, - * just return leaving nic_cnt_config=0, nic_cnt_avail=0, etc. */ - if ((orig_config == NULL) || (orig_config[0] == '\0') || - (updated_config == false)) + if (updated_config == false) return SLURM_SUCCESS; - node_gres_config = xstrdup(orig_config); - tok = strtok_r(node_gres_config, ",", &last); - while (tok) { - if (!strcmp(tok, "nic")) { - gres_config_cnt = 1; - break; - } - if (!strncmp(tok, "nic:", 4)) { - gres_config_cnt = strtol(tok+4, &last, 10); - if (last[0] == '\0') - ; - else if ((last[0] == 'k') || (last[0] == 'K')) - gres_config_cnt *= 1024; - break; + if ((orig_config == NULL) || (orig_config[0] == '\0')) + gres_ptr->nic_cnt_config = 0; + else if (gres_ptr->nic_cnt_config == NO_VAL) { + node_gres_config = xstrdup(orig_config); + tok = strtok_r(node_gres_config, ",", &last); + while (tok) { + if (!strcmp(tok, "nic")) { + gres_config_cnt = 1; + break; + } + if (!strncmp(tok, "nic:", 4)) { + gres_config_cnt = strtol(tok+4, &last, 10); + if (last[0] == '\0') + ; + else if ((last[0] == 'k') || (last[0] == 'K')) + gres_config_cnt *= 1024; + break; + } + tok = strtok_r(NULL, ",", &last); } - tok = strtok_r(NULL, ",", &last); + xfree(node_gres_config); + gres_ptr->nic_cnt_config = gres_config_cnt; } - gres_ptr->nic_cnt_config = gres_config_cnt; - xfree(node_gres_config); - if (gres_config_cnt < 0) - ; /* not configured for use */ - else if (fast_schedule == 0) - gres_ptr->nic_cnt_avail = gres_ptr->nic_cnt_found; - else + if ((gres_ptr->nic_cnt_config == 0) || (fast_schedule > 0)) gres_ptr->nic_cnt_avail = gres_ptr->nic_cnt_config; + else + gres_ptr->nic_cnt_avail = gres_ptr->nic_cnt_found; if (gres_ptr->nic_bit_alloc == NULL) { gres_ptr->nic_bit_alloc = bit_alloc(gres_ptr->nic_cnt_avail); @@ -327,9 +385,9 @@ extern int node_config_validate(char *node_name, bit_size(gres_ptr->nic_bit_alloc)) { gres_ptr->nic_bit_alloc = bit_realloc(gres_ptr->nic_bit_alloc, gres_ptr->nic_cnt_avail); + if (gres_ptr->nic_bit_alloc == NULL) + fatal("bit_alloc: malloc failure"); } - if (gres_ptr->nic_bit_alloc == NULL) - fatal("bit_alloc: malloc failure"); if ((fast_schedule < 2) && (gres_ptr->nic_cnt_found < gres_ptr->nic_cnt_config)) { @@ -385,9 +443,10 @@ extern int node_reconfig(char *node_name, char *orig_config, char **new_config, xassert(gres_data); gres_ptr = (nic_node_state_t *) *gres_data; if (gres_ptr == NULL) { - /* Assume that node has not yet registerd */ - info("%s record is NULL for node %s", plugin_name, node_name); - return rc; + gres_ptr = xmalloc(sizeof(nic_node_state_t)); + *gres_data = gres_ptr; + gres_ptr->nic_cnt_config = NO_VAL; + gres_ptr->nic_cnt_found = NO_VAL; } node_gres_config = xstrdup(orig_config); @@ -410,10 +469,11 @@ extern int node_reconfig(char *node_name, char *orig_config, char **new_config, gres_ptr->nic_cnt_config = gres_config_cnt; xfree(node_gres_config); - if (fast_schedule == 0) - gres_ptr->nic_cnt_avail = gres_ptr->nic_cnt_found; - else if (gres_ptr->nic_cnt_config != NO_VAL) + if ((gres_ptr->nic_cnt_config == 0) || (fast_schedule > 0) || + (gres_ptr->nic_cnt_found == NO_VAL)) gres_ptr->nic_cnt_avail = gres_ptr->nic_cnt_config; + else + gres_ptr->nic_cnt_avail = gres_ptr->nic_cnt_found; if (gres_ptr->nic_bit_alloc == NULL) { gres_ptr->nic_bit_alloc = bit_alloc(gres_ptr->nic_cnt_avail); @@ -425,13 +485,15 @@ extern int node_reconfig(char *node_name, char *orig_config, char **new_config, if (gres_ptr->nic_bit_alloc == NULL) fatal("bit_alloc: malloc failure"); - if ((fast_schedule < 2) && - (gres_ptr->nic_cnt_found < gres_ptr->nic_cnt_config)) { + if ((fast_schedule < 2) && + (gres_ptr->nic_cnt_found != NO_VAL) && + (gres_ptr->nic_cnt_found < gres_ptr->nic_cnt_config)) { /* Do not set node DOWN, but give the node * a chance to register with more resources */ gres_ptr->nic_cnt_found = NO_VAL; - } else if ((fast_schedule == 0) && - (gres_ptr->nic_cnt_found > gres_ptr->nic_cnt_config)) { + } else if ((fast_schedule == 0) && + (gres_ptr->nic_cnt_found != NO_VAL) && + (gres_ptr->nic_cnt_found > gres_ptr->nic_cnt_config)) { /* need to rebuild new_config */ char *new_configured_res = NULL; if (*new_config) @@ -567,7 +629,19 @@ extern int node_state_realloc(void *job_gres_data, int node_offset, job_bit_size = bit_size(job_gres_ptr->nic_bit_alloc[node_offset]); node_bit_size = bit_size(node_gres_ptr->nic_bit_alloc); - if (job_bit_size != node_bit_size) { + if (job_bit_size > node_bit_size) { + error("%s job/node bit size mismatch (%d != %d)", + plugin_name, job_bit_size, node_bit_size); + /* Node needs to register with more resources, expand + * node's bitmap now so we can merge the data */ + node_gres_ptr->nic_bit_alloc = + bit_realloc(node_gres_ptr->nic_bit_alloc, + job_bit_size); + if (node_gres_ptr->nic_bit_alloc == NULL) + fatal("bit_realloc: malloc failure"); + node_bit_size = job_bit_size; + } + if (job_bit_size < node_bit_size) { error("%s job/node bit size mismatch (%d != %d)", plugin_name, job_bit_size, node_bit_size); /* Update what we can */ diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c index 16a01dbc88fdefd0ff44fff93c6cfce25e213949..5d9a333a8cc9a1b6c99be4bbbf8cfb668eb5eeb5 100644 --- a/src/slurmctld/read_config.c +++ b/src/slurmctld/read_config.c @@ -824,10 +824,21 @@ static void _gres_reconig(bool reconfig) ListIterator job_iterator; int i, i_first, i_last, node_offset; bool gres_active, gres_changed = false; - char *plugin_names; + char *gres_name, *plugin_names; - if (reconfig) + if (reconfig) { gres_plugin_reconfig(&gres_changed); + } else { + for (i = 0, node_ptr = node_record_table_ptr; + i < node_record_count; i++, node_ptr++) { + if (node_ptr->gres) + gres_name = node_ptr->gres; + else + gres_name = node_ptr->config_ptr->gres; + gres_plugin_init_node_config(node_ptr->name, gres_name, + &node_ptr->gres_list); + } + } plugin_names = slurm_get_gres_plugins(); if (plugin_names && plugin_names[0])