Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace redundant type with "auto" (src/smpi/).
[simgrid.git] / src / smpi / smpirun.in
index 245881d..74523e1 100755 (executable)
@@ -14,7 +14,6 @@ DEFAULT_LOOPBACK_BANDWIDTH="498000000Bps"
 DEFAULT_LOOPBACK_LATENCY="0.000004s"
 DEFAULT_NETWORK_BANDWIDTH="$((26 * 1024 * 1024))Bps"
 DEFAULT_NETWORK_LATENCY="0.000005s"
-DEFAULT_NUMPROCS="4"
 DEFAULT_SPEED="100flops"
 
 LOOPBACK_BANDWIDTH="${DEFAULT_LOOPBACK_BANDWIDTH}"
@@ -117,7 +116,7 @@ smpirun_trap() {
   unset pid
 
   # Raise the same signal again (remove the traps first):
-  trap - "$trapped_signals"
+  trap - $trapped_signals
   kill -"$sig" $$
 
   # This should never happen:
@@ -126,7 +125,7 @@ smpirun_trap() {
 }
 
 for s in $trapped_signals; do
-  trap 'smpirun_trap $s' "$s"
+  trap "smpirun_trap $s" "$s"
 done
 
 while true; do
@@ -455,7 +454,7 @@ else
     done
 fi
 
-set -- "$hostnames"
+set -- $hostnames
 
 ##---- generate <actor> tags------------------------------
 #prepare arguments at once
@@ -473,21 +472,22 @@ do
     if [ ${MAPOPT} = 1 ]; then
       echo "[rank $i] -> $host"
     fi
-
+    {
     echo "  <actor host=\"${host}\" function=\"$i\"> <!-- function name used only for logging -->
     <prop id=\"instance_id\" value=\"smpirun\"/>
-    <prop id=\"rank\" value=\"$i\"/>" >> "${APPLICATIONTMP}"
+    <prop id=\"rank\" value=\"$i\"/>"
     if [ ${REPLAY} = 1 ]; then
-        echo "    <prop id=\"smpi_replay\" value=\"true\"/>" >> "${APPLICATIONTMP}"
+        echo "    <prop id=\"smpi_replay\" value=\"true\"/>"
         if  [ "${NUMTRACES}" -gt 1 ]; then
-            echo "    <argument value=\"$(echo "$hosttraces"|cut -d' ' -f$j)\"/>" >> "${APPLICATIONTMP}"
+            echo "    <argument value=\"$(echo "$hosttraces"|cut -d' ' -f$j)\"/>"
         else
-            echo "    <argument value=\"$(echo "$hosttraces"|cut -d' ' -f1)\"/>" >> "${APPLICATIONTMP}"
+            echo "    <argument value=\"$(echo "$hosttraces"|cut -d' ' -f1)\"/>"
         fi
     else
-    echo "${XML_ARGS}" >> "${APPLICATIONTMP}"
+    echo "${XML_ARGS}"
     fi
-    echo "  </actor>" >> "${APPLICATIONTMP}"
+    echo "  </actor>"
+    }    >> "${APPLICATIONTMP}"
 done
 
 cat >> "${APPLICATIONTMP}" <<APPLICATIONFOOT
@@ -550,7 +550,7 @@ fi
 # * The FD 3 is used to temporarily store FD 1. This is because the shell connects FD 1 to /dev/null when the command
 #   is launched in the background: this can be overridden in bash but not in standard bourne shell.
 exec 3<&0
-${WRAPPER} "@SMPIMAIN@" "${EXEC}" ${PRIVATIZE} "${TRACEOPTIONS}" "${SIMOPTS}" "${PLATFORMTMP}" "${APPLICATIONTMP}" <&3 3>&- &
+${WRAPPER} "@SMPIMAIN@" "${EXEC}" ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} "${PLATFORMTMP}" "${APPLICATIONTMP}" <&3 3>&- &
 pid=$!
 exec 3>&-
 wait $pid