X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b59c351d2cc41b4f036493b1686aa7f3870cb7dd..dc061ae1d3507d0e3b7d3569553b31cb6709702e:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index e478855fda..49ea4e1bb3 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -43,25 +43,33 @@ 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="*) + for OPT in ${1#*=} + do + SIMOPTS="$SIMOPTS ${1%%=*}=$OPT" + done + shift 1 + ;; *) break ;; @@ -135,15 +143,28 @@ 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 + if [ -n "${MAPOPT}" ]; then echo "[rank $i] -> ${hostnames[$j]}" fi @@ -165,15 +186,14 @@ cat >> ${APPLICATIONTMP} <