From 8c79683e65ca6a0182de49a00615ca4372b58c47 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 26 Dec 2016 10:21:47 +0100 Subject: [PATCH] smpirun: keep the temps when the cmd fails --- src/smpi/smpirun.in | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.20.1