From 135e4f764b0d7f3d35feb023d325a939bc819a15 Mon Sep 17 00:00:00 2001
From: Dominik Bartkiewicz <bart@schedmd.com>
Date: Fri, 11 Sep 2020 16:10:32 +0200
Subject: [PATCH] Ignore step features if equal to job features

Bug 9777
---
 NEWS                     | 1 +
 src/slurmctld/step_mgr.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 24590b96c2a..435567e413b 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ documents those changes that are of interest to users and administrators.
  -- Fix incorrect memory handling of mail_user when updating mail_type=none.
  -- Handle mail_user and mail_type independently.
  -- Fix thread-safety issue with assoc_mgr_get_admin_level().
+ -- Ignore step features if equal to job features
 
 * Changes in Slurm 20.02.5
 ==========================
diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c
index 440bf25de81..21ebf34fa63 100644
--- a/src/slurmctld/step_mgr.c
+++ b/src/slurmctld/step_mgr.c
@@ -1008,9 +1008,13 @@ static bitstr_t *_pick_step_nodes(job_record_t *job_ptr,
 	if (!nodes_avail)
 		nodes_avail = bit_copy (job_ptr->node_bitmap);
 	bit_and(nodes_avail, up_node_bitmap);
-	if (step_spec->features) {
+
+	if (step_spec->features &&
+	    (!job_ptr->details ||
+	     xstrcmp(step_spec->features, job_ptr->details->features))) {
 		/*
 		 * We only select for a single feature name here.
+		 * Ignore step features if equal to job features.
 		 * FIXME: Add support for AND, OR, etc. here if desired
 		 */
 		node_feature_t *feat_ptr;
-- 
GitLab