X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3f9587e71330e7471ef675d2652cee260a0e3a96..36fa571a13985879dc627c70ecc2340af606aa42:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 9e5689e5c1..65b9c1b11f 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -241,6 +241,14 @@ while true; do esac done +# check if we still have at least one parameter beyond options +if [ $# -eq 0 ] +then + echo "Error: no program to execute!" + usage + exit +fi + if [ -n "$WRAPPER" ]; then EXEC="$WRAPPER $1" else @@ -376,7 +384,6 @@ APPLICATIONHEAD ##---- cache hostnames of hostfile--------------- if [ -n "${HOSTFILE}" ] && [ -f ${HOSTFILE} ]; then hostnames=$(cat ${HOSTFILE} | tr '\n\r' ' ') - NUMHOSTS=$(cat ${HOSTFILE} | wc -l) fi if [ "${EXTOPT}" = "smpi_replay" ]; then @@ -420,7 +427,7 @@ done for i in ${SEQ} do - j=$(( $i % ${NUMHOSTS} + 1 )) + j=$(( $i % ${hostfile_procs} + 1 )) host=$(eval "echo \${$j}") ##---- optional display of ranks to process mapping