From a1c5bddac95cac53b893d1ea98210af9dbeaf3f9 Mon Sep 17 00:00:00 2001
From: Mark Nelson <mdnelson8@gmail.com>
Date: Fri, 7 Jun 2013 08:53:02 -0700
Subject: [PATCH] Fix allocation when ntasks-per-core=1 and nodes have SMT

we've been unable to submit jobs that request one task-per-core
when we have SMT enabled (but it would work successfully for
jobs that wanted two tasks-per-core).
I ended up tracking it down to a regression caused by commit
8127554abc5d40ac516d130675b68fea70ea333a.
See bug 322
---
 src/common/node_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/node_conf.c b/src/common/node_conf.c
index 9dca1db51b1..51da226710d 100644
--- a/src/common/node_conf.c
+++ b/src/common/node_conf.c
@@ -1121,7 +1121,7 @@ extern int adjust_cpus_nppcu(uint16_t ntasks_per_core, uint16_t threads,
 	if (ntasks_per_core != 0xffff) {
 		/* Adjust the number of CPUs according to the percentage of the
 		 * hwthreads/core being used. */
-		cpus *= ntasks_per_core / threads;
+		cpus = cpus * ntasks_per_core / threads;
 	}
 
 	return cpus;
-- 
GitLab