From 06f49814bbe9aebead152d4c0cec9c38bc4b6f2e Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Mon, 6 Apr 2015 14:46:16 -0700
Subject: [PATCH] topology/tree, dragonfly, select/cons_res bug

This improves the packing for a configuration of
topology/tree, dragonfly, select/cons_res when specific nodes
are required.
---
 src/plugins/select/cons_res/job_test.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/plugins/select/cons_res/job_test.c b/src/plugins/select/cons_res/job_test.c
index cba10ea698d..d377b98b8fe 100644
--- a/src/plugins/select/cons_res/job_test.c
+++ b/src/plugins/select/cons_res/job_test.c
@@ -2348,6 +2348,11 @@ static int _eval_nodes_dfly(struct job_record *job_ptr, bitstr_t *bitmap,
 			best_fit_inx = -1;
 		}
 
+		if ((req_switch_cnt == 1) && (req_switch_id == j)) {
+			best_fit_inx = j;
+			break;
+		}
+
 		/*
 		 * If first possibility OR
 		 * lower level switch OR
@@ -2363,8 +2368,6 @@ static int _eval_nodes_dfly(struct job_record *job_ptr, bitstr_t *bitmap,
 		      switch_record_table[best_fit_inx].level) &&
 		     (switches_node_cnt[j] < switches_node_cnt[best_fit_inx]))){
 			best_fit_inx = j;
-			if ((req_switch_cnt == 1) && (req_switch_id == j))
-				break;
 		}
 	}
 	if (best_fit_inx == -1) {
-- 
GitLab