From c1462e89f3cd5e6e5788bffe4f2804329d3dcc2f Mon Sep 17 00:00:00 2001
From: Carles Fenoy <carles.fenoy@bsc.es>
Date: Fri, 19 Aug 2011 18:13:49 +0200
Subject: [PATCH] Solved bug in select/cons_res plugin which makes jobs
 requesting tasks_per_node and cpus_per_task not getting proper allocation and
 failing in srun with "Requested node configuration is not	available"

---
 src/plugins/select/cons_res/dist_tasks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/select/cons_res/dist_tasks.c b/src/plugins/select/cons_res/dist_tasks.c
index 7c4c04fe5f4..484a0e26f78 100644
--- a/src/plugins/select/cons_res/dist_tasks.c
+++ b/src/plugins/select/cons_res/dist_tasks.c
@@ -85,7 +85,7 @@ static int _compute_c_b_task_dist(struct job_record *job_ptr)
 		if (job_ptr->details->ntasks_per_node == 0)
 			maxtasks = maxtasks / job_ptr->details->cpus_per_task;
 		else
-			maxtasks = job_ptr->details->ntasks_per_node;
+			maxtasks = job_ptr->details->ntasks_per_node * job_res->nhosts;
 	}
 
 	/* Safe guard if the user didn't specified a lower number of
-- 
GitLab