Skip to content

Commit

Permalink
Fix issue with backfill scheduler scheduling tasks of an array
Browse files Browse the repository at this point in the history
when not the head job.

Bug 6837

For more in depth explanation see comment 24
  • Loading branch information
jette authored and dannyauble committed Apr 24, 2019
1 parent 6015bff commit 70d12f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ documents those changes that are of interest to users and administrators.
-- Fix potential deadlock with backup slurmctld.
-- Fixed issue with jobs not appearing in sacct after dependency satisfied.
-- Fix showing non-eligible jobs when asking with -j and not -s.
-- Fix issue with backfill scheduler scheduling tasks of an array
when not the head job.

* Changes in Slurm 18.08.7
==========================
Expand Down
15 changes: 12 additions & 3 deletions src/plugins/sched/backfill/backfill.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ static int _attempt_backfill(void)
uint32_t test_array_job_id = 0;
uint32_t test_array_count = 0;
uint32_t job_no_reserve;
bool resv_overlap = false;
bool is_job_array_head, resv_overlap = false;
uint8_t save_share_res = 0, save_whole_node = 0;
int test_fini;
int user_part_inx1 = -1, user_part_inx2 = -1;
Expand Down Expand Up @@ -1699,6 +1699,11 @@ static int _attempt_backfill(void)
orig_start_time = job_ptr->start_time;
orig_time_limit = job_ptr->time_limit;

if (job_ptr->array_recs && (job_ptr->array_task_id == NO_VAL))
is_job_array_head = true;
else
is_job_array_head = false;

next_task:
/*
* Save the current preemption state. Reset preemption state
Expand Down Expand Up @@ -2444,11 +2449,15 @@ static int _attempt_backfill(void)
}
break;
}
if (job_ptr->array_task_id != NO_VAL) {
if (is_job_array_head &&
(job_ptr->array_task_id != NO_VAL)) {
/* Try starting next task of job array */
job_ptr = find_job_record(job_ptr->
array_job_id);
if (job_ptr && IS_JOB_PENDING(job_ptr))
if (job_ptr &&
IS_JOB_PENDING(job_ptr) &&
(bb_g_job_test_stage_in(
job_ptr, false) == 1))
goto next_task;
}
continue;
Expand Down

0 comments on commit 70d12f0

Please sign in to comment.