X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/de0ff2cd86dbc1c499d1adbaa732c277f35a3965..b209fd002b9ef31307f6f604254ad84a6628d5b0:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index ad8aabe088..28ae8b0829 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -241,6 +241,13 @@ while true; do esac done +# check if we still have at least one parameter beyond options +if [ $# -eq 0 ] +then + usage + exit +fi + if [ -n "$WRAPPER" ]; then EXEC="$WRAPPER $1" else @@ -414,7 +421,7 @@ set -- $hostnames ##---- generate tags------------------------------ #prepare arguments at once for ARG in $PROC_ARGS; do - ARGS="$ARGS"" + XML_ARGS="${XML_ARGS}"" " done @@ -438,7 +445,7 @@ do echo " " >> ${APPLICATIONTMP} fi else - echo ${ARGS} >> ${APPLICATIONTMP} + echo ${XML_ARGS} >> ${APPLICATIONTMP} fi echo " " >> ${APPLICATIONTMP} done @@ -513,6 +520,22 @@ wait $pid status=$? pid="" +# Keep temporary files on failures to help debugging +# +if [ ${status} -ne 0 ] ; then + if [ -z ${KEEP} ]; then + echo ${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PRIVATIZE} ${PLATFORMTMP} ${APPLICATIONTMP} + if [ ${HOSTFILETMP} = 1 ] ; then + echo "Generated hostfile ${HOSTFILE} kept." + fi + if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then + echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept." + fi + fi + echo "Execution failed with code ${status}." + KEEP=true +fi + smpirun_cleanup exit $status