X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/025965074dbe4c1b04466cc260260470f28b7472..58f56bf3dd3beeb8e252d1f55998aafc0794afbe:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index d51b4d01f3..cad450d0d8 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -43,25 +43,30 @@ while true; do fi shift 2 ;; - + "-map") - MAPOPT="on" + MAPOPT="true" shift 1 ;; - "-quiet") - QUIET="true" + "-keep-temps") + KEEP="true" shift 1 ;; "-help" | "--help" | "-h") echo "usage:" - echo "$0 [-quiet] [-np ] -platform -hostfile [-map] program [program-options]" + echo "$0 [-quiet] [-keep-temps] [-np ] -platform -hostfile [-map] program [program-options]" echo "or (deprecated usage):" - echo "$0 [-quiet] [-np ] [-bandwidth ] [-latency ] program [program-options]" + echo "$0 [-quiet] [-keep-temps] [-np ] [-bandwidth ] [-latency ] program [program-options]" echo exit ;; + + "--cfg="*|"--log="*|"--network_model="*) + SIMOPTS="$SIMOPTS $1" + shift 1 + ;; *) break ;; @@ -135,16 +140,29 @@ fi ## hostfile has less than i lines. ##---------------------------------------------------------- +HAVE_SEQ="`which seq`" +HAVE_JOT="`which jot`" + +if [ -n "${HAVE_SEQ}" ]; then + SEQ=`${HAVE_SEQ} 0 $((${NUMPROCS}-1))` +else + cnt=0 + while (( $cnt < ${NUMPROCS} )) ; do + SEQ="$SEQ $cnt" + cnt=$((cnt + 1)); + done +fi + ##---- generate tags------------------------------ -for i in `seq 0 $((${NUMPROCS}-1))` +for i in ${SEQ} do if [ -n "${HOSTFILE}" ]; then j=$(( $i % ${NUMHOSTS} )) fi ##---- optional display of ranks to process mapping - if [ -n ${MAPOPT} ]; then - echo "[rank $j] -> ${hostnames[$j]}" + if [ -n "${MAPOPT}" ]; then + echo "[rank $i] -> ${hostnames[$j]}" fi if [ -z "${hostnames[$j]}" ]; then @@ -165,15 +183,14 @@ cat >> ${APPLICATIONTMP} <