diff --git a/src/slurmctld/power_save.c b/src/slurmctld/power_save.c index 9da52fbf137b27a55c9f5b5222d0ae8c7eac5df3..9ec46d11b41b07557ea56e23c9c52591c80fc1cf 100644 --- a/src/slurmctld/power_save.c +++ b/src/slurmctld/power_save.c @@ -90,7 +90,8 @@ char *exc_nodes = NULL, *exc_parts = NULL; time_t last_config = (time_t) 0, last_suspend = (time_t) 0; uint16_t slurmd_timeout; -bitstr_t *exc_node_bitmap = NULL, *suspend_node_bitmap = NULL; +bitstr_t *exc_node_bitmap = NULL; +bitstr_t *suspend_node_bitmap = NULL, *resume_node_bitmap = NULL; int suspend_cnt, resume_cnt; float suspend_cnt_f, resume_cnt_f; @@ -137,6 +138,8 @@ static void _do_power_work(time_t now) if (last_suspend) { bit_nclear(suspend_node_bitmap, 0, (node_record_count - 1)); + bit_nclear(resume_node_bitmap, 0, + (node_record_count - 1)); last_suspend = (time_t) 0; } } @@ -170,7 +173,8 @@ static void _do_power_work(time_t now) bit_clear(power_node_bitmap, i); bit_clear(avail_node_bitmap, i); node_ptr->last_response = now + resume_timeout; - bit_set(wake_node_bitmap, i); + bit_set(wake_node_bitmap, i); + bit_set(resume_node_bitmap, i); } /* Suspend nodes as appropriate */ @@ -247,7 +251,8 @@ static void _re_wake(void) if (IS_NODE_ALLOCATED(node_ptr) && IS_NODE_NO_RESPOND(node_ptr) && !IS_NODE_POWER_SAVE(node_ptr) && - (bit_test(suspend_node_bitmap, i) == 0)) { + (bit_test(suspend_node_bitmap, i) == 0) && + (bit_test(resume_node_bitmap, i) == 0)) { if (wake_node_bitmap == NULL) { wake_node_bitmap = bit_alloc(node_record_count); @@ -620,6 +625,7 @@ static void *_init_power_save(void *arg) goto fini; suspend_node_bitmap = bit_alloc(node_record_count); + resume_node_bitmap = bit_alloc(node_record_count); while (slurmctld_config.shutdown_time == 0) { sleep(1); @@ -663,6 +669,7 @@ static void *_init_power_save(void *arg) fini: _clear_power_config(); FREE_NULL_BITMAP(suspend_node_bitmap); + FREE_NULL_BITMAP(resume_node_bitmap); _shutdown_power(); slurm_mutex_lock(&power_mutex); power_save_enabled = false;