From 6bf6c03d680e0d7bed3ab054f48a0c51de0cef6c Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Fri, 23 Sep 2005 22:56:32 +0000
Subject: [PATCH] example of how to run multiple executibles on a single srun.

---
 doc/man/man1/srun.1 | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index 559865505a8..3246f917956 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -951,6 +951,30 @@ rm $MACHINEFILE
 > srun -AN2 -n4 test.sh
 
 .fi 
+.PP
+This simple example demonstrates the execution of different jobs on different 
+nodes in the same srun.  You can do this for any number of nodes or any 
+number of jobs.  The executables are placed on the nodes sited by the 
+SLURM_NODEID env var.  Starting at 0 and going to the number specified on
+the srun commandline.
+
+.nf
 
+> cat test.sh
+case $SLURM_NODEID in
+    0) echo "I am running on "
+       hostname ;;
+    1) hostname
+       echo "is where I am running" ;;
+esac
+
+> srun \-N2 test.sh
+dev0
+is where I am running
+I am running on 
+dev1
+
+.fi
+.PP
 .SH "SEE ALSO"
 \fBscancel\fR(1), \fBscontrol\fR(1), \fBsqueue\fR(1), \fBslurm.conf\fR(5)
-- 
GitLab