From: Martin Quinson Date: Mon, 26 Dec 2016 09:21:47 +0000 (+0100) Subject: smpirun: keep the temps when the cmd fails X-Git-Tag: v3_14_159~9 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8c79683e65ca6a0182de49a00615ca4372b58c47 smpirun: keep the temps when the cmd fails --- diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index ad8aabe088..10678ea883 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -513,6 +513,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