From: Martin Quinson Date: Fri, 27 Jun 2014 06:53:09 +0000 (+0200) Subject: dividing by 0 is not always the best possible choice, even if the user shoulnt give... X-Git-Tag: v3_12~963 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/382edfa5dc55f3cc055b5816ecb6ad1afe6f69b1?hp=fc0a76c21f0bceb0314aee5d62f785ea8009495e dividing by 0 is not always the best possible choice, even if the user shoulnt give empty hostfiles --- 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