Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
dividing by 0 is not always the best possible choice, even if the user shoulnt give...
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 27 Jun 2014 06:53:09 +0000 (08:53 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 27 Jun 2014 06:53:09 +0000 (08:53 +0200)
src/smpi/smpirun.in

index 8fdc7da..9dfb521 100755 (executable)
@@ -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