From fe9c2489cf6b634a5aa416ae9a8c58ceada37f95 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Wed, 28 Oct 2009 21:28:18 +0000
Subject: [PATCH] svn merge -r18934:18950
 https://eris.llnl.gov/svn/slurm/branches/slurm-2.0

---
 NEWS                                   |  4 ++++
 src/plugins/task/affinity/dist_tasks.c | 10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index bba5eef0447..3837b3d458a 100644
--- a/NEWS
+++ b/NEWS
@@ -261,6 +261,10 @@ documents those changes that are of interest to users and admins.
  -- Modified job table to use 32bit u/gids for those with ids greater 
     than 16 bits.
  -- Made minor changes for slurm to compile cleanly under gcc 4.4.1
+ -- Fixed issue with task/affinity when an allocation would run multiple sruns 
+    with the --exclusive flag in an allocation with more than 1 node.  
+    Previously when the first node was filled up no tasks would ever run 
+    on the other nodes.
 
 * Changes in SLURM 2.0.7
 ========================
diff --git a/src/plugins/task/affinity/dist_tasks.c b/src/plugins/task/affinity/dist_tasks.c
index 9cbcb2e5882..04ece518c5f 100644
--- a/src/plugins/task/affinity/dist_tasks.c
+++ b/src/plugins/task/affinity/dist_tasks.c
@@ -55,7 +55,7 @@ static char *_alloc_mask(launch_tasks_request_msg_t *req,
 static bitstr_t *_get_avail_map(launch_tasks_request_msg_t *req,
 				uint16_t *hw_sockets, uint16_t *hw_cores,
 				uint16_t *hw_threads);
-static int _get_local_node_info(slurm_cred_arg_t *arg, uint32_t job_node_id,
+static int _get_local_node_info(slurm_cred_arg_t *arg, int job_node_id,
 				uint16_t *sockets, uint16_t *cores);
 
 static int _task_layout_lllp_block(launch_tasks_request_msg_t *req,
@@ -424,7 +424,7 @@ void lllp_distribution(launch_tasks_request_msg_t *req, uint32_t node_id)
  * IN/OUT: cores   - pointer to cores_per_socket count variable
  * OUT:  returns the core_bitmap index of the first core for this node
  */
-static int _get_local_node_info(slurm_cred_arg_t *arg, uint32_t job_node_id,
+static int _get_local_node_info(slurm_cred_arg_t *arg, int job_node_id,
 				uint16_t *sockets, uint16_t *cores)
 {
 	int bit_start = 0, bit_finish = 0;
@@ -433,7 +433,7 @@ static int _get_local_node_info(slurm_cred_arg_t *arg, uint32_t job_node_id,
 	do {
 		index++;
 		for (i = 0; i < arg->sock_core_rep_count[index] &&
-			    cur_node_id < job_node_id; i++) {
+			     cur_node_id < job_node_id; i++) {
 			bit_start = bit_finish;
 			bit_finish += arg->sockets_per_node[index] *
 					arg->cores_per_socket[index];
@@ -547,7 +547,7 @@ static bitstr_t *_get_avail_map(launch_tasks_request_msg_t *req,
 	bitstr_t *req_map, *hw_map;
 	slurm_cred_arg_t arg;
 	uint16_t p, t, num_procs, sockets, cores;
-	uint32_t job_node_id;
+	int job_node_id;
 	int start;
 	char *str;
 
@@ -565,7 +565,7 @@ static bitstr_t *_get_avail_map(launch_tasks_request_msg_t *req,
 	job_node_id = nodelist_find(arg.job_hostlist, conf->node_name);
 	start = _get_local_node_info(&arg, job_node_id, &sockets, &cores);
 	if (start < 0) {
-		error("task/affinity: missing node %u in job credential",
+		error("task/affinity: missing node %d in job credential",
 		      job_node_id);
 		slurm_cred_free_args(&arg);
 		return NULL;
-- 
GitLab