From: mquinson Date: Fri, 26 Jun 2009 20:22:05 +0000 (+0000) Subject: Add a flag to keep the temp files around, and pass configuration options to the simulator X-Git-Tag: SVN~1269 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/31995feaea3e1ba5e1d3398e0497b85749625739?hp=10598682c3d60c5606cd9942c0eef752ddf6856d;ds=sidebyside Add a flag to keep the temp files around, and pass configuration options to the simulator git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6371 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index e478855fda..0fda9b4c3f 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -54,14 +54,24 @@ while true; do shift 1 ;; + "-keep-temps") + KEEP="true" + shift 1 + ;; + "-help" | "--help" | "-h") echo "usage:" - echo "$0 [-quiet] [-np ] -platform -hostfile [-map] program [program-options]" + echo "$0 [-quiet] [-keep-temps] [-np ] -platform -hostfile [-map] program [program-options]" echo "or (deprecated usage):" - echo "$0 [-quiet] [-np ] [-bandwidth ] [-latency ] program [program-options]" + echo "$0 [-quiet] [-keep-temps] [-np ] [-bandwidth ] [-latency ] program [program-options]" echo exit ;; + + "--cfg="*) + SIMOPTS="$SIMOPTS $1" + shift 1 + ;; *) break ;; @@ -166,14 +176,16 @@ APPLICATIONFOOT ##-------------------------------- end DEFAULT APPLICATION -------------------------------------- if [ -z "${QUIET}" ] ; then - echo ${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP} + echo ${EXEC} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP} fi -${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP} +${EXEC} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP} -if [ -z "${QUIET}" ] ; then - echo "[$0] cleaning up temp files" -fi -if [ -z "${PLATFORM}" ]; then +if [ "x$?" == "x0" ] && [ -n ${KEEP} ] ; then + if [ -z "${QUIET}" ] ; then + echo "[$0] cleaning up temp files" + fi + if [ -z "${PLATFORM}" ]; then rm ${PLATFORMTMP} -fi -rm ${APPLICATIONTMP} + fi + rm ${APPLICATIONTMP} +fi \ No newline at end of file