From f1a45962e117107d5ccfbbc95a19e6e358526cfd Mon Sep 17 00:00:00 2001
From: Tim Wickberg <tim@schedmd.com>
Date: Thu, 25 May 2017 14:21:45 -0600
Subject: [PATCH] Revert "Prevent a job tested on multiple partitions from
 being marked"

Wrong author attributed by mistake.

This reverts commit 9128476a45426dc0fa59449332a211dc3f81084c.
---
 NEWS                           |  2 --
 src/slurmctld/node_mgr.c       | 14 +++++---------
 src/slurmctld/node_scheduler.c |  7 +++++--
 src/slurmctld/read_config.c    |  6 ++----
 4 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/NEWS b/NEWS
index 9566a589e13..081019150ce 100644
--- a/NEWS
+++ b/NEWS
@@ -51,8 +51,6 @@ documents those changes that are of interest to users and administrators.
     to 365-days (as is done elsewhere), rather than 49710 days.
  -- Check if variable given to scontrol show job is a valid jobid.
  -- Fix WithSubAccounts option to not include WithDeleted unless requested.
- -- Prevent a job tested on multiple partitions from being marked
-    WHOLE_NODE_USER.
 
 * Changes in Slurm 17.02.3
 ==========================
diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c
index b0f8025fdee..34ba315b70b 100644
--- a/src/slurmctld/node_mgr.c
+++ b/src/slurmctld/node_mgr.c
@@ -3583,10 +3583,8 @@ extern void make_node_alloc(struct node_record *node_ptr,
 		(node_ptr->no_share_job_cnt)++;
 	}
 
-	if ((job_ptr->details &&
-	     (job_ptr->details->whole_node == WHOLE_NODE_USER)) ||
-	    (job_ptr->part_ptr &&
-	     (job_ptr->part_ptr->flags & PART_FLAG_EXCLUSIVE_USER))) {
+	if (job_ptr->details &&
+	    (job_ptr->details->whole_node == WHOLE_NODE_USER)) {
 		node_ptr->owner_job_cnt++;
 		node_ptr->owner = job_ptr->user_id;
 	}
@@ -3789,11 +3787,9 @@ void make_node_idle(struct node_record *node_ptr,
 			xfree(node_ptr->mcs_label);
 		}
 	}
-	if (job_ptr &&
-	    ((job_ptr->details &&
-	      (job_ptr->details->whole_node == WHOLE_NODE_USER)) ||
-	     (job_ptr->part_ptr &&
-	      (job_ptr->part_ptr->flags & PART_FLAG_EXCLUSIVE_USER)))) {
+
+	if (job_ptr && job_ptr->details &&
+	    (job_ptr->details->whole_node == WHOLE_NODE_USER)) {
 		if (--node_ptr->owner_job_cnt == 0) {
 			node_ptr->owner = NO_VAL;
 			xfree(node_ptr->mcs_label);
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 5c61cca0dac..41f3fe18998 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -900,8 +900,11 @@ extern void filter_by_node_owner(struct job_record *job_ptr,
 	struct node_record *node_ptr;
 	int i;
 
-	if ((job_ptr->details->whole_node == WHOLE_NODE_USER) ||
-	    (job_ptr->part_ptr->flags & PART_FLAG_EXCLUSIVE_USER)) {
+	if ((job_ptr->details->whole_node == 0) &&
+	    (job_ptr->part_ptr->flags & PART_FLAG_EXCLUSIVE_USER))
+		job_ptr->details->whole_node = WHOLE_NODE_USER;
+
+	if (job_ptr->details->whole_node == WHOLE_NODE_USER) {
 		/* Need to remove all nodes allocated to any active job from
 		 * any other user */
 		job_iterator = list_iterator_create(job_list);
diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c
index a9461b3ef5e..4c831d695b0 100644
--- a/src/slurmctld/read_config.c
+++ b/src/slurmctld/read_config.c
@@ -2168,10 +2168,8 @@ static int _sync_nodes_to_active_job(struct job_record *job_ptr)
 		} else if (bit_test(job_ptr->node_bitmap, i) == 0)
 			continue;
 
-		if ((job_ptr->details &&
-		     (job_ptr->details->whole_node == WHOLE_NODE_USER)) ||
-		    (job_ptr->part_ptr &&
-		     (job_ptr->part_ptr->flags & PART_FLAG_EXCLUSIVE_USER))) {
+		if (job_ptr->details &&
+		    (job_ptr->details->whole_node == WHOLE_NODE_USER)) {
 			node_ptr->owner_job_cnt++;
 			node_ptr->owner = job_ptr->user_id;
 		}
-- 
GitLab