diff --git a/NEWS b/NEWS index ea864cc3978cb947fe4966048da31c0dc2b966f2..187f2c92abd6375589a11e5f46bc5dcc18784650 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,8 @@ documents those changes that are of interest to users and admins. -- Fix bug in processing job feature requests with node counts (could fail to schedule job if some nodes have not associated features). -- Added nodecnt and gid to jobcomp/script + -- Insure that nodes select in "srun --will-run" command or the equivalent in + sched/wiki2 are in the job's partition. * Changes in SLURM 1.3.1 ======================== diff --git a/src/plugins/sched/wiki2/job_will_run.c b/src/plugins/sched/wiki2/job_will_run.c index 6cf1cec7d95dd0812c97feccf33969ce291a2b97..3ecca4dfd0677249731a973414edea4bddec3c65 100644 --- a/src/plugins/sched/wiki2/job_will_run.c +++ b/src/plugins/sched/wiki2/job_will_run.c @@ -206,10 +206,22 @@ static char * _will_run_test(uint32_t *jobid, time_t *start_time, error("wiki: Attempt to set invalid available node " "list for job %u, %s", jobid[i], node_list[i]); break; - } else { - /* Only consider nodes that are not DOWN or DRAINED */ - bit_and(avail_bitmap, avail_node_bitmap); } + + /* Only consider nodes that are not DOWN or DRAINED */ + bit_and(avail_bitmap, avail_node_bitmap); + + /* Consider only nodes in this job's partition */ + if (part_ptr->node_bitmap) + bit_and(avail_bitmap, part_ptr->node_bitmap); + else { + *err_code = -730; + *err_msg = "Job's partition has no nodes"; + error("wiki: no nodes in partition %s for job %u", + part_ptr->name, jobid[i]); + break; + } + if (job_req_node_filter(job_ptr, avail_bitmap) != SLURM_SUCCESS) { /* Job probably has invalid feature list */ diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c index 9cf46f13563e95e6ea1751fad8a0635519d692d3..0f7d6dc324b38b6c13040272488af12552348063 100644 --- a/src/slurmctld/job_scheduler.c +++ b/src/slurmctld/job_scheduler.c @@ -791,11 +791,17 @@ extern int job_start_data(job_desc_msg_t *job_desc_msg, } else if (node_name2bitmap(job_desc_msg->req_nodes, false, &avail_bitmap) != 0) { return ESLURM_INVALID_NODE_NAME; - } else { - /* Only consider nodes that are not DOWN or DRAINED */ - bit_and(avail_bitmap, avail_node_bitmap); } + /* Only consider nodes that are not DOWN or DRAINED */ + bit_and(avail_bitmap, avail_node_bitmap); + + /* Consider only nodes in this job's partition */ + if (part_ptr->node_bitmap) + bit_and(avail_bitmap, part_ptr->node_bitmap); + else + rc = ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE; + if (job_req_node_filter(job_ptr, avail_bitmap)) rc = ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE; if (job_ptr->details->exc_node_bitmap) {