diff --git a/NEWS b/NEWS index aa1e188bc49592272d80ffbdc86c0edb38b09728..14aa37b541e48f487394642cfcd5492b23af2d6c 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ documents those changes that are of interest to users and admins. ============================= -- Fix job preemption when sched/gang and select/linear are configured with non-sharing partitions. + -- In select/cons_res insure that required nodes have available resources. * Changes in SLURM 1.4.0-pre5 ============================= diff --git a/src/plugins/select/cons_res/job_test.c b/src/plugins/select/cons_res/job_test.c index a1745b779cba8aa6e3725821bdc7deb0420e6d49..1355a92da7d40aac7ec784a793e978d23df14564 100644 --- a/src/plugins/select/cons_res/job_test.c +++ b/src/plugins/select/cons_res/job_test.c @@ -1223,6 +1223,7 @@ static uint16_t *_select_nodes(struct job_record *job_ptr, uint32_t min_nodes, int rc; uint16_t *cpu_cnt, *cpus = NULL; uint32_t start, n, a, i, f, size, *freq; + bitstr_t *req_map = job_ptr->details->req_node_bitmap; if (bit_set_count(node_map) < min_nodes) return NULL; @@ -1230,7 +1231,25 @@ static uint16_t *_select_nodes(struct job_record *job_ptr, uint32_t min_nodes, /* get resource usage for this job from each available node */ size = _get_res_usage(job_ptr, node_map, core_map, cr_node_cnt, node_usage, cr_type, &cpu_cnt, &freq); - + + /* check required nodes to make sure they have usable resources */ + if (req_map) { + i = f = 0; + for (n = 0; n < cr_node_cnt; n++) { + if (bit_test(req_map, n) && cpu_cnt[i] == 0) { + /* no resources are available for this node */ + xfree(cpu_cnt); + xfree(freq); + return NULL; + } + f++; + if (f >= freq[i]) { + f = 0; + i++; + } + } + } + /* choose the best nodes for the job */ rc = _choose_nodes(job_ptr, node_map, min_nodes, max_nodes, req_nodes, cr_node_cnt, cpu_cnt, freq, size); diff --git a/src/plugins/task/affinity/dist_tasks.c b/src/plugins/task/affinity/dist_tasks.c index 42e4a0df3a3da3efe50582f9fa4f58f22a64ef03..f2b5ebf79a32ae648bea9418e73961697aa53a34 100644 --- a/src/plugins/task/affinity/dist_tasks.c +++ b/src/plugins/task/affinity/dist_tasks.c @@ -805,6 +805,7 @@ static void _lllp_generate_cpu_bind(launch_tasks_request_msg_t *req, req->cpu_bind_type &= ~CPU_BIND_TO_THREADS; req->cpu_bind_type &= ~CPU_BIND_TO_CORES; req->cpu_bind_type &= ~CPU_BIND_TO_SOCKETS; + req->cpu_bind_type &= ~CPU_BIND_TO_LDOMS; slurm_sprint_cpu_bind_type(buf_type, req->cpu_bind_type); info("_lllp_generate_cpu_bind jobid [%u]: %s, %s",