Skip to content
Snippets Groups Projects
Commit 0eac851f authored by Morris Jette's avatar Morris Jette
Browse files

preempt/qos - add job size to priority

Based upon a study of the preemption logic, putting smaller jobs
at the top of the queue (lower priority) will improve algorithm
efficiency in terms of not releasing more resources than needed.
parent 2230f6a1
No related branches found
No related tags found
No related merge requests found
...@@ -132,6 +132,10 @@ extern List find_preemptable_jobs(struct job_record *job_ptr) ...@@ -132,6 +132,10 @@ extern List find_preemptable_jobs(struct job_record *job_ptr)
return preemptee_job_list; return preemptee_job_list;
} }
/* Generate the job's priority. It is partly based upon the partition priority
* and partly based upon the job size. We want to put smaller jobs at the top
* of the preemption queue and use a sort algorithm to minimize the number of
* job's preempted. */
static uint32_t _gen_job_prio(struct job_record *job_ptr) static uint32_t _gen_job_prio(struct job_record *job_ptr)
{ {
uint32_t job_prio; uint32_t job_prio;
......
...@@ -148,13 +148,28 @@ static bool _qos_preemptable(struct job_record *preemptee, ...@@ -148,13 +148,28 @@ static bool _qos_preemptable(struct job_record *preemptee,
} }
/* Generate the job's priority. It is partly based upon the QOS priority
* and partly based upon the job size. We want to put smaller jobs at the top
* of the preemption queue and use a sort algorithm to minimize the number of
* job's preempted. */
static uint32_t _gen_job_prio(struct job_record *job_ptr) static uint32_t _gen_job_prio(struct job_record *job_ptr)
{ {
uint32_t job_prio = 0; uint32_t job_prio = 0;
slurmdb_qos_rec_t *qos_ptr = job_ptr->qos_ptr; slurmdb_qos_rec_t *qos_ptr = job_ptr->qos_ptr;
if (qos_ptr) if (qos_ptr) {
job_prio = qos_ptr->priority; /* QOS priority is 32-bits, but only use 16-bits so we can
* preempt smaller jobs rather than larger jobs. */
if (qos_ptr->priority >= 0xffff)
job_prio = 0xffff << 16;
else
job_prio = qos_ptr->priority << 16;
}
if (job_ptr->node_cnt >= 0xffff)
job_prio += 0xffff;
else
job_prio += job_ptr->node_cnt;
return job_prio; return job_prio;
} }
......
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