X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3e7047f7353ca1853d3eb5415264714a0315a8d4..281c82411d0384fef85a37c39dc940ec2255f271:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 2aaea1635a..bc97526332 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -1,4 +1,4 @@ -#! /usr/bin/env bash +#! /bin/sh @CMAKE_SMPI_COMMAND@ @@ -18,7 +18,7 @@ POWER="${DEFAULT_POWER}" SIMOPTS="--cfg=maxmin/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP_gamma:4194304" #usage to print the way this script should be called -function usage () { +usage () { cat < -hostfile program [program-options] Options: @@ -52,6 +52,7 @@ fi EXTOPT="" WRAPPER="" +HOSTFILE="" while true; do case "$1" in @@ -234,20 +235,26 @@ if [ -z "${PLATFORM}" ]; then PLATFORMHEAD -for (( i=${NUMPROCS}; $i ; i=$i-1 )) do +i=${NUMPROCS} +while [ $i -gt 0 ]; do echo " " >> ${PLATFORMTMP} echo " " >> ${PLATFORMTMP} echo " " >> ${PLATFORMTMP} + i=$((i - 1)) done -for (( i=${NUMPROCS}; $i ; i=$i-1 )) do - for (( j=${NUMPROCS}; $j ; j=$j-1 )) do +i=${NUMPROCS} +while [ $i -gt 0 ]; do + j=${NUMPROCS} + while [ $j -gt 0 ]; do if [ $i -eq $j ]; then echo " " >> ${PLATFORMTMP} else echo " " >> ${PLATFORMTMP} fi + j=$((j - 1)) done + i=$((i - 1)) done cat >> ${PLATFORMTMP} <&2 exit 1 @@ -312,25 +319,25 @@ fi for i in ${SEQ} do if [ -n "${HOSTFILE}" ]; then - j=$(( $i % ${NUMHOSTS} )) + j=$(( $i % ${NUMHOSTS} + 1 )) fi ##---- optional display of ranks to process mapping if [ -n "${MAPOPT}" ]; then - echo "[rank $i] -> ${hostnames[$j]}" + echo "[rank $i] -> $(echo $hostnames|cut -d' ' -f$j)" fi - if [ -z "${hostnames[$j]}" ]; then - host="host"$(($j+1)) + if [ -z "$(echo $hostnames|cut -d' ' -f$j)" ]; then + host="host"$($j) else - host="${hostnames[$j]}" + host="$(echo $hostnames|cut -d' ' -f$j)" fi echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} if [ "${EXTOPT}" = "smpi_replay" ]; then if [ ${NUMTRACES} -gt 1 ]; then - echo " " >> ${APPLICATIONTMP} + echo " " >> ${APPLICATIONTMP} else - echo " " >> ${APPLICATIONTMP} + echo " " >> ${APPLICATIONTMP} fi else for ARG in $PROC_ARGS; do