From 382edfa5dc55f3cc055b5816ecb6ad1afe6f69b1 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 27 Jun 2014 08:53:09 +0200 Subject: [PATCH 1/1] dividing by 0 is not always the best possible choice, even if the user shoulnt give empty hostfiles --- src/smpi/smpirun.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 8fdc7da7d1..9dfb521d3f 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -350,7 +350,11 @@ fi for i in ${SEQ} do if [ -n "${HOSTFILE}" ]; then - j=$(( $i % ${NUMHOSTS} + 1 )) + if [ ${NUMHOSTS} = 0 ] ; then + j= 0 + else + j=$(( $i % ${NUMHOSTS} + 1 )) + fi fi ##---- optional display of ranks to process mapping if [ -n "${MAPOPT}" ]; then -- 2.20.1