Skip to content
Snippets Groups Projects
Commit 680f0d9a authored by Moe Jette's avatar Moe Jette
Browse files

reset start_time of pending jobs to zero after will_run logic completes

parent f7ded2c1
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,7 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -156,6 +156,7 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
int i, rc; int i, rc;
select_will_run_t *select_will_run = NULL; select_will_run_t *select_will_run = NULL;
List select_list; List select_list;
ListIterator iter;
select_list = list_create(_select_list_del); select_list = list_create(_select_list_del);
if (select_list == NULL) if (select_list == NULL)
...@@ -178,8 +179,6 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -178,8 +179,6 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
break; break;
} }
job_ptr->start_time = start_time[i];
part_ptr = job_ptr->part_ptr; part_ptr = job_ptr->part_ptr;
if (part_ptr == NULL) { if (part_ptr == NULL) {
*err_code = -700; *err_code = -700;
...@@ -260,6 +259,7 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -260,6 +259,7 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
select_will_run->avail_nodes = avail_bitmap; select_will_run->avail_nodes = avail_bitmap;
avail_bitmap = NULL; avail_bitmap = NULL;
select_will_run->job_ptr = job_ptr; select_will_run->job_ptr = job_ptr;
job_ptr->start_time = start_time[i];
select_will_run->max_nodes = max_nodes; select_will_run->max_nodes = max_nodes;
select_will_run->min_nodes = min_nodes; select_will_run->min_nodes = min_nodes;
select_will_run->req_nodes = req_nodes; select_will_run->req_nodes = req_nodes;
...@@ -267,6 +267,13 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -267,6 +267,13 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
} }
FREE_NULL_BITMAP(avail_bitmap); FREE_NULL_BITMAP(avail_bitmap);
if (i < job_cnt) { /* error logged above */ if (i < job_cnt) { /* error logged above */
/* Restore pending job start time */
iter = list_iterator_create(select_list);
if (iter == NULL)
fatal("list_iterator_create: malloc failure");
while ((select_will_run = list_next(iter)))
select_will_run->job_ptr->start_time = 0;
list_iterator_destroy(iter);
list_destroy(select_list); list_destroy(select_list);
return NULL; return NULL;
} }
...@@ -285,7 +292,6 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -285,7 +292,6 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
if (rc == SLURM_SUCCESS) { if (rc == SLURM_SUCCESS) {
char tmp_str[128]; char tmp_str[128];
ListIterator iter;
*err_code = 0; *err_code = 0;
uint32_t proc_cnt = 0; uint32_t proc_cnt = 0;
...@@ -316,6 +322,8 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -316,6 +322,8 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
proc_cnt, proc_cnt,
(uint32_t) select_will_run-> (uint32_t) select_will_run->
job_ptr->start_time); job_ptr->start_time);
/* Restore pending job start time */
select_will_run->job_ptr->start_time = 0;
xstrcat(reply_msg, tmp_str); xstrcat(reply_msg, tmp_str);
hostlist = bitmap2node_name(select_will_run-> hostlist = bitmap2node_name(select_will_run->
avail_nodes); avail_nodes);
...@@ -324,6 +332,13 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, ...@@ -324,6 +332,13 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time,
} }
list_iterator_destroy(iter); list_iterator_destroy(iter);
} else { } else {
/* Restore pending job start times */
iter = list_iterator_create(select_list);
if (iter == NULL)
fatal("list_iterator_create: malloc failure");
while ((select_will_run = list_next(iter)))
select_will_run->job_ptr->start_time = 0;
list_iterator_destroy(iter);
xstrcat(reply_msg, "Jobs not runable on selected nodes"); xstrcat(reply_msg, "Jobs not runable on selected nodes");
error("wiki: jobs not runnable on nodes"); error("wiki: jobs not runnable on nodes");
} }
......
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