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

Shared=, don't implicitly set job's shared field

Original code was implicitly setting a job's shared field to 1
for select/cons_res.
parent 16fbc7a7
No related branches found
No related tags found
No related merge requests found
......@@ -681,8 +681,8 @@ static int _match_feature(char *seek, struct node_set *node_set_ptr)
* 1 = exclusive
*
* Return values:
* 0 = no sharing
* 1 = share resources
* 0 = requires idle nodes
* 1 = can use non-idle nodes
*/
static int
_resolve_shared_status(struct job_record *job_ptr, uint16_t part_max_share,
......@@ -691,28 +691,36 @@ _resolve_shared_status(struct job_record *job_ptr, uint16_t part_max_share,
/* no sharing if partition Shared=EXCLUSIVE */
if (part_max_share == 0) {
job_ptr->details->whole_node = 1;
job_ptr->details->share_res = 0;
return 0;
}
/* sharing if partition Shared=FORCE with count > 1 */
if ((part_max_share & SHARED_FORCE) &&
((part_max_share & (~SHARED_FORCE)) > 1))
((part_max_share & (~SHARED_FORCE)) > 1)) {
job_ptr->details->share_res = 1;
return 1;
}
if (cons_res_flag) {
if ((job_ptr->details->share_res == 0) ||
(job_ptr->details->whole_node == 1))
(job_ptr->details->whole_node == 1)) {
job_ptr->details->share_res = 0;
return 0;
}
return 1;
} else {
job_ptr->details->whole_node = 1;
if (part_max_share == 1) /* partition configured Shared=NO */
if (part_max_share == 1) { /* partition configured Shared=NO */
job_ptr->details->share_res = 0;
return 0;
}
/* share if the user requested it */
if (job_ptr->details->share_res == 1)
return 1;
job_ptr->details->share_res = 0;
return 0;
}
return 0;
}
/*
......@@ -1075,7 +1083,6 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
shared = _resolve_shared_status(job_ptr, part_ptr->max_share,
cr_enabled);
job_ptr->details->share_res = shared;
if (cr_enabled)
job_ptr->cr_enabled = cr_enabled; /* CR enabled for this job */
......
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