From 7fdb8395e3c4ec2d95689ba09a450a408ca13e17 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Wed, 25 Jan 2012 09:28:58 -0800
Subject: [PATCH] BLUEGENE - fix issue where incorrect block could be picked
 when requesting on small blocks but need larger and the block size.

---
 src/plugins/select/bluegene/bg_job_place.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/select/bluegene/bg_job_place.c b/src/plugins/select/bluegene/bg_job_place.c
index af42c556215..bc816ae6fcc 100644
--- a/src/plugins/select/bluegene/bg_job_place.c
+++ b/src/plugins/select/bluegene/bg_job_place.c
@@ -377,7 +377,9 @@ static bg_record_t *_find_matching_block(List block_list,
 			   this by since we will usually be given a
 			   larger block than our allocation request.
 			*/
-			if (!bg_conf->sub_blocks || bg_record->mp_count > 1) {
+			if ((bg_record->cpu_cnt < request->procs)
+			    || !bg_conf->sub_blocks
+			    || (bg_record->mp_count > 1)) {
 				/* We use the proccessor count per block here
 				   mostly to see if we can run on a
 				   smaller block.
-- 
GitLab