Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpirun: gracefuly handle the case where the user forgets to give a program to execute
[simgrid.git] / src / smpi / smpirun.in
index 3af4015..28ae8b0 100755 (executable)
@@ -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
@@ -516,7 +523,7 @@ pid=""
 # Keep temporary files on failures to help debugging
 #
 if [ ${status} -ne 0 ] ; then
-    if [ -z ${KEEP} ] ; then
+    if [ -z ${KEEP} ]; then
         echo ${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PRIVATIZE} ${PLATFORMTMP} ${APPLICATIONTMP}
         if [ ${HOSTFILETMP} = 1 ] ; then
             echo "Generated hostfile ${HOSTFILE} kept."