Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update doc on viva and remove more stuff
[simgrid.git] / src / smpi / smpirun.in
index c3950fe..3016954 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 () {
@@ -44,7 +44,6 @@ Options:
   -trace-comment-file <file> # put file contents on the top of the trace file as comment
   -trace-grouped             # group MPI processes by location
   -trace-resource            # trace resource utilization
-  -trace-viva                # generate configuration for Viva's GraphView
   -trace-file <tracefile>    # name of the tracefile (simgrid_smpi.trace)
   -ext <value>               # additional parameter (reserved)
 
@@ -75,6 +74,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 +142,14 @@ 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" | "-machinefile")
            HOSTFILE="$2"
             if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
-            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
             ;;
@@ -200,10 +194,6 @@ while true; do
             TRACE_RESOURCE="true"
             shift 1
             ;;
-        "-trace-viva")
-           TRACE_VIVA="true"
-           shift 1
-            ;;
         "-keep-temps")
            KEEP="true"
            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
@@ -313,8 +303,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 +422,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
@@ -481,10 +470,6 @@ if [ -n "${TRACE_ACTIVE}" ]; then
     if [ -n "${TRACE_RESOURCE}" ]; then
         TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes"
     fi
-
-    if [ -n "${TRACE_VIVA}" ]; then
-        TRACEOPTIONS="${TRACEOPTIONS} --cfg=viva/categorized:smpi_cat.plist --cfg=viva/uncategorized:smpi_uncat.plist"
-    fi
 fi
 ##---------------------- end SMPI TRACING OPTIONS ---------------------------------
 
@@ -520,7 +505,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."