Skip to content
Snippets Groups Projects
Commit e180d341 authored by jette's avatar jette
Browse files

select/cons_res - Add test for zero node allocation

I don't see how this could happen, but it might explain something
reported by Harvard University. In any case, this could prevent
an infinite loop if the task distribution funciton is passed a
job allocation with zero nodes.
parent 302d8b3f
No related branches found
No related tags found
No related merge requests found
...@@ -136,8 +136,9 @@ static int _compute_c_b_task_dist(struct job_record *job_ptr) ...@@ -136,8 +136,9 @@ static int _compute_c_b_task_dist(struct job_record *job_ptr)
job_resources_t *job_res = job_ptr->job_resrcs; job_resources_t *job_res = job_ptr->job_resrcs;
bool log_over_subscribe = true; bool log_over_subscribe = true;
if (!job_res || !job_res->cpus) { if (!job_res || !job_res->cpus || !job_res->nhosts) {
error("cons_res: _compute_c_b_task_dist given NULL job_ptr"); error("cons_res: _compute_c_b_task_dist invalid allocation "
"for job %u", job_ptr->job_id);
return SLURM_ERROR; return SLURM_ERROR;
} }
...@@ -210,8 +211,9 @@ static int _compute_plane_dist(struct job_record *job_ptr) ...@@ -210,8 +211,9 @@ static int _compute_plane_dist(struct job_record *job_ptr)
job_resources_t *job_res = job_ptr->job_resrcs; job_resources_t *job_res = job_ptr->job_resrcs;
bool log_over_subscribe = true; bool log_over_subscribe = true;
if (!job_res || !job_res->cpus) { if (!job_res || !job_res->cpus || !job_res->nhosts) {
error("cons_res: _compute_plane_dist given NULL job_res"); error("cons_res: _compute_c_b_task_dist invalid allocation "
"for job %u", job_ptr->job_id);
return SLURM_ERROR; return SLURM_ERROR;
} }
......
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