X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c810b409a11c5704ba8bace45aea7c4a197ef367..6fb7cd815ecf6b7f0874482aec3d82ad62bd4c4c:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 9e5689e5c1..b62c9ee046 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -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