From 23ea5a665641211c5656ac98e6ca044e1b10f375 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Tue, 22 May 2007 17:36:47 +0000
Subject: [PATCH] svn merge -r11565:11568
 https://eris.llnl.gov/svn/slurm/branches/slurm-1.1

---
 doc/man/man1/srun.1 | 10 +++++++---
 src/srun/opt.c      |  5 +++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index 579dc8f0fe2..8549effb2d3 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -413,7 +413,9 @@ http://www.llnl.gov/linux/slurm/dist_plane.html.
 The arbitrary method of distribution will allocate processes in\-order as 
 listed in file designated by the environment variable SLURM_HOSTFILE.  If
 this variable is listed it will over ride any other method specified. 
-If not set the method will default to block.
+If not set the method will default to block.  Inside the hostfile must
+contain at minimum the number of hosts requested.  If requesting tasks
+(-n) your tasks will be laid out on the nodes in the order of the file.
 .RE
 
 .TP
@@ -866,7 +868,9 @@ Request a specific list of hosts. The job will contain \fIat least\fR
 these hosts. The list may be specified as a comma\-separated list of
 hosts, a range of hosts (host[1\-5,7,...] for example), or a filename.
 The host list will be assumed to be a filename if it contains a "/"
-character.
+character. If you specify a max node count (-N1-2) if there are more
+than 2 hosts in the file only the first 2 nodes will be used in the
+request list.
 
 .TP
 \fB\-X\fR, \fB\-\-disable\-status\fR
@@ -1186,7 +1190,7 @@ Same as \fB\-X, \-\-disable\-status\fR
 Same as \fB\-m plane\fR
 .TP
 \fBSLURM_DISTRIBUTION\fR
-Same as \fB\-m, \-\-distribution\fR=(\fIblock|cyclic|hostfile\fR)
+Same as \fB\-m, \-\-distribution\fR=(\fIblock|cyclic|arbitrary\fR)
 .TP
 \fBSLURM_EPILOG\fR
 Same as \fB\-\-epilog\fR=\fIexecutable\fR
diff --git a/src/srun/opt.c b/src/srun/opt.c
index 78e364ee8a3..1d47bd8081c 100644
--- a/src/srun/opt.c
+++ b/src/srun/opt.c
@@ -2192,14 +2192,15 @@ static bool _opt_verify(void)
 
 	if(!opt.nodelist) {
 		if((opt.nodelist = xstrdup(getenv("SLURM_HOSTFILE")))) {
+			opt.distribution = SLURM_DIST_ARBITRARY;
 			if (!_valid_node_list(&opt.nodelist)) {
 				error("Failure getting NodeNames from "
 				      "hostfile");
 				exit(1);
-			} else 
+			} else {
 				debug("loaded nodes (%s) from hostfile",
 				      opt.nodelist);
-			
+			}
 		}
 	} else
 		if (!_valid_node_list(&opt.nodelist))
-- 
GitLab