Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a flag to keep the temp files around, and pass configuration options to the simulator
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 26 Jun 2009 20:22:05 +0000 (20:22 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 26 Jun 2009 20:22:05 +0000 (20:22 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6371 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/smpirun.in

index e478855..0fda9b4 100755 (executable)
@@ -54,14 +54,24 @@ while true; do
       shift 1
    ;;
 
       shift 1
    ;;
 
+   "-keep-temps")
+       KEEP="true"
+      shift 1
+   ;;
+
    "-help" | "--help" | "-h") 
       echo "usage:"
    "-help" | "--help" | "-h") 
       echo "usage:"
-      echo "$0 [-quiet] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
+      echo "$0 [-quiet] [-keep-temps] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
       echo "or (deprecated usage):"
       echo "or (deprecated usage):"
-      echo "$0 [-quiet] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
+      echo "$0 [-quiet] [-keep-temps] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
       echo
       exit
    ;;
       echo
       exit
    ;;
+   
+   "--cfg="*)
+     SIMOPTS="$SIMOPTS $1"
+     shift 1
+   ;;
     *)
       break
     ;;
     *)
       break
     ;;
@@ -166,14 +176,16 @@ APPLICATIONFOOT
 ##-------------------------------- end DEFAULT APPLICATION --------------------------------------
 
 if [ -z "${QUIET}" ] ; then
 ##-------------------------------- end DEFAULT APPLICATION --------------------------------------
 
 if [ -z "${QUIET}" ] ; then
-  echo ${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP}
+  echo ${EXEC} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
 fi
 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} 
        rm ${PLATFORMTMP} 
-fi
-rm ${APPLICATIONTMP}
+   fi
+   rm ${APPLICATIONTMP}
+fi
\ No newline at end of file