Skip to content
Snippets Groups Projects
Commit a85b2225 authored by Danny Auble's avatar Danny Auble
Browse files

BGQ - fixed issue where a user requests a node count and a task count that

doesn't fill up all the cpus on the nodes requested.
parent 86d19547
No related branches found
No related tags found
No related merge requests found
......@@ -2810,9 +2810,22 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data)
set min_nodes correctly
*/
if ((job_desc->min_cpus != NO_VAL)
&& (job_desc->min_cpus > job_desc->min_nodes))
job_desc->min_nodes =
job_desc->min_cpus / bg_conf->cpu_ratio;
&& (job_desc->min_cpus > job_desc->min_nodes)) {
float tmp_float = (float)job_desc->min_cpus
/ (float)bg_conf->cpu_ratio;
tmp = (uint32_t)tmp_float;
if (tmp_float != (float)tmp)
tmp++;
if ((job_desc->min_nodes > 1)
&& (tmp != job_desc->min_nodes))
error("Asking for more resources than "
"possible. Requested %u nodes and %u "
"tasks, giving them %u nodes.",
job_desc->min_nodes,
job_desc->min_cpus, tmp);
job_desc->min_nodes = tmp;
}
/* initialize min_cpus to the min_nodes */
job_desc->min_cpus = job_desc->min_nodes * bg_conf->cpu_ratio;
......@@ -2883,7 +2896,6 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data)
set_select_jobinfo(job_desc->select_jobinfo->data,
SELECT_JOBDATA_NODE_CNT,
&job_desc->min_nodes);
job_desc->min_cpus = job_desc->min_nodes
* bg_conf->cpu_ratio;
job_desc->min_nodes = 1;
......
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