From 6cf8da85cf740e3a1b5e456bc7a1f9f9d49bf809 Mon Sep 17 00:00:00 2001
From: "Christopher J. Morrone" <morrone2@llnl.gov>
Date: Wed, 12 Apr 2006 19:14:19 +0000
Subject: [PATCH] Fix off-by-one bug in number of children calculation.

---
 src/slurmd/slurmd/reverse_tree_math.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/slurmd/slurmd/reverse_tree_math.c b/src/slurmd/slurmd/reverse_tree_math.c
index e934b11af7c..3874de3274f 100644
--- a/src/slurmd/slurmd/reverse_tree_math.c
+++ b/src/slurmd/slurmd/reverse_tree_math.c
@@ -127,7 +127,7 @@ reverse_tree_info(int rank, int num_nodes, int width,
 	*depth = 0;
 	search_tree(rank, 0, max_children, width, &p, &c, depth);
 	
-	if ((rank + c) > num_nodes)
+	if ((rank + c) >= num_nodes)
 		c = num_nodes - rank - 1;
 
 	*parent = p;
-- 
GitLab