diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c index 93f0e37abd8f9c080f7a78c087afa6fa7333c35b..092e1d8e6a97770208f8f5ec1190cf0d450bc396 100644 --- a/src/plugins/sched/backfill/backfill.c +++ b/src/plugins/sched/backfill/backfill.c @@ -1130,8 +1130,14 @@ static int _attempt_backfill(void) job_ptr->time_limit = orig_time_limit; } - if (later_start && - (job_ptr->start_time > (later_start+backfill_resolution))) { + start_time = job_ptr->start_time; + end_reserve = job_ptr->start_time + (time_limit * 60); + start_time = (start_time / backfill_resolution) * + backfill_resolution; + end_reserve = (end_reserve / backfill_resolution) * + backfill_resolution; + + if (later_start && (start_time > later_start)) { /* Try later when some nodes currently reserved for * pending jobs are free */ job_ptr->start_time = 0; @@ -1151,12 +1157,6 @@ static int _attempt_backfill(void) break; } - start_time = job_ptr->start_time; - end_reserve = job_ptr->start_time + (time_limit * 60); - start_time = (start_time / backfill_resolution) * - backfill_resolution; - end_reserve = (end_reserve / backfill_resolution) * - backfill_resolution; if ((job_ptr->start_time > now) && _test_resv_overlap(node_space, avail_bitmap, start_time, end_reserve)) {