Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / smpi / smpirun.in
index c3950fe..7a33dc2 100755 (executable)
@@ -25,7 +25,7 @@ SPEED="${DEFAULT_SPEED}"
 
 PRIVATIZE="--cfg=smpi/privatization:@HAVE_PRIVATIZATION@"
 
-SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP-gamma:4194304"
+SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI"
 
 #usage to print the way this script should be called
 usage () {
@@ -75,6 +75,11 @@ unset pid
 
 trapped_signals="HUP INT QUIT ILL ABRT SEGV FPE ALRM TERM USR1 USR2 BUS"
 
+die () {
+    printf '[%s] ** error: %s. Aborting.\n' "$(basename $0)" "$*" >&2
+    exit 1
+}
+
 smpirun_cleanup()
 {
   if [ -z "${KEEP}" ] ; then
@@ -138,24 +143,21 @@ while true; do
         "-platform")
            PLATFORM="$2"
             if [ ! -f "${PLATFORM}" ]; then
-               echo "[`basename $0`] ** error: the file '${PLATFORM}' does not exist. Aborting."
-               exit 1
+                die "the file '${PLATFORM}' does not exist"
             fi
            shift 2
             ;;
         "-hostfile")
            HOSTFILE="$2"
             if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
+                die "the file '${HOSTFILE}' does not exist"
             fi
            shift 2
             ;;
         "-machinefile")
            HOSTFILE="$2"
             if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
+                die "the file '${HOSTFILE}' does not exist"
             fi
            shift 2
             ;;
@@ -313,8 +315,7 @@ fi
 # Don't use wc -l to compute it to avoid issues with trailing \n at EOF
 hostfile_procs=$(grep -c "[a-zA-Z0-9]" $HOSTFILE)
 if [ ${hostfile_procs} = 0 ] ; then
-   echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2
-   exit 1
+    die "the hostfile '${HOSTFILE}' is empty"
 fi
 
 if [ -z "${NUMPROCS}" ] ; then
@@ -433,7 +434,7 @@ do
     fi
 
     echo "  <actor host=\"${host}\" function=\"$i\"> <!-- function name used only for logging -->
-    <argument value=\"1\"/> <!-- instance -->
+    <argument value=\"smpirun\"/> <!-- instance -->
     <argument value=\"$i\"/> <!-- rank -->" >> ${APPLICATIONTMP}
     if [ ${REPLAY} = 1 ]; then
         if  [ ${NUMTRACES} -gt 1 ]; then
@@ -520,7 +521,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} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
         if [ ${HOSTFILETMP} = 1 ] ; then
             echo "Generated hostfile ${HOSTFILE} kept."