Skip to content
Snippets Groups Projects
Commit 3ec7382a authored by Alejandro Sanchez's avatar Alejandro Sanchez Committed by Morris Jette
Browse files

Fix hetjob component incorrect Priority state reason at allocation time.

_top_priority() is used to determine at job allocation time (called from
job_allocate()) if any other job has a higher priority than the specified
job being allocated. If so, it sets the job state_reason to WAIT_PRIORITY.
This patch skips the priority comparison if the two jobs being compared
are pack job components from the same heterogeneous job.

Bug 4400.
parent 42150e8e
No related branches found
No related tags found
No related merge requests found
......@@ -245,7 +245,7 @@ static void _signal_job(struct job_record *job_ptr, int signal, uint16_t flags);
static void _suspend_job(struct job_record *job_ptr, uint16_t op,
bool indf_susp);
static int _suspend_job_nodes(struct job_record *job_ptr, bool indf_susp);
static bool _top_priority(struct job_record *job_ptr);
static bool _top_priority(struct job_record *job_ptr, uint32_t pack_job_offset);
static int _valid_job_part(job_desc_msg_t * job_desc,
uid_t submit_uid, bitstr_t *req_bitmap,
struct part_record **part_pptr,
......@@ -4794,7 +4794,7 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
too_fragmented = true;
 
if (independent && (!too_fragmented))
top_prio = _top_priority(job_ptr);
top_prio = _top_priority(job_ptr, job_specs->pack_job_offset);
else
top_prio = true; /* don't bother testing,
* it is not runable anyway */
......@@ -11045,7 +11045,7 @@ extern void sync_job_priorities(void)
* IN job_ptr - pointer to selected job
* RET true if selected job has highest priority
*/
static bool _top_priority(struct job_record *job_ptr)
static bool _top_priority(struct job_record *job_ptr, uint32_t pack_job_offset)
{
struct job_details *detail_ptr = job_ptr->details;
time_t now = time(NULL);
......@@ -11083,6 +11083,9 @@ static bool _top_priority(struct job_record *job_ptr)
list_next(job_iterator))) {
if (job_ptr2 == job_ptr)
continue;
if ((pack_job_offset != NO_VAL) && (job_ptr->job_id ==
(job_ptr2->job_id + pack_job_offset)))
continue;
if (!IS_JOB_PENDING(job_ptr2))
continue;
if (IS_JOB_COMPLETING(job_ptr2)) {
......
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