Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix tests for shared and partial-shared.
[simgrid.git] / src / smpi / smpirun.in
index 9e5689e..b62c9ee 100755 (executable)
@@ -23,7 +23,7 @@ NETWORK_BANDWIDTH="${DEFAULT_NETWORK_BANDWIDTH}"
 NETWORK_LATENCY="${DEFAULT_NETWORK_LATENCY}"
 SPEED="${DEFAULT_SPEED}"
 
-PRIVATIZE="--cfg=smpi/privatize-global-variables:yes"
+PRIVATIZE="--cfg=smpi/privatize-global-variables:@HAVE_PRIVATIZATION@"
 
 SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP-gamma:4194304"
 
@@ -241,6 +241,14 @@ while true; do
     esac
 done
 
+# check if we still have at least one parameter beyond options
+if [ $# -eq 0 ]
+then
+    echo "Error: no program to execute!"
+    usage
+    exit
+fi
+
 if [ -n "$WRAPPER" ]; then
     EXEC="$WRAPPER $1"
 else
@@ -376,7 +384,6 @@ APPLICATIONHEAD
 ##---- cache hostnames of hostfile---------------
 if [ -n "${HOSTFILE}" ] && [ -f ${HOSTFILE} ]; then
     hostnames=$(cat ${HOSTFILE} | tr '\n\r' '  ')
-    NUMHOSTS=$(cat ${HOSTFILE} | wc -l)
 fi
 
 if [ "${EXTOPT}" = "smpi_replay" ]; then
@@ -420,7 +427,7 @@ done
 
 for i in ${SEQ}
 do
-    j=$(( $i % ${NUMHOSTS} + 1 ))
+    j=$(( $i % ${hostfile_procs} + 1 ))
     host=$(eval "echo \${$j}")
 
     ##---- optional display of ranks to process mapping
@@ -506,7 +513,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 overriden in bash but not in standard bourne shell.
 exec 3<&0
-${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP} <&3 3>&- &
+${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PRIVATIZE} ${PLATFORMTMP} ${APPLICATIONTMP} <&3 3>&- &
 pid=$!
 exec 3>&-
 wait $pid