A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed trailing whitespace
[simgrid.git]
/
src
/
smpi
/
smpirun.in
diff --git
a/src/smpi/smpirun.in
b/src/smpi/smpirun.in
index
70c8fa9
..
b2699d9
100755
(executable)
--- a/
src/smpi/smpirun.in
+++ b/
src/smpi/smpirun.in
@@
-45,23
+45,31
@@
while true; do
;;
"-map")
;;
"-map")
- MAPOPT="
on
"
+ MAPOPT="
true
"
shift 1
;;
shift 1
;;
- "-
quiet
")
-
QUIET
="true"
+ "-
keep-temps
")
+
KEEP
="true"
shift 1
;;
shift 1
;;
- "-help" | "--help" | "-h")
+ "-help" | "--help" | "-h")
echo "usage:"
echo "usage:"
- echo "$0 [-quiet] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
+ echo "$0 [-quiet] [-
keep-temps] [-
np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
echo "or (deprecated usage):"
echo "or (deprecated usage):"
- echo "$0 [-quiet] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
+ echo "$0 [-quiet] [-
keep-temps] [-
np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
echo
exit
;;
echo
exit
;;
+
+ "--cfg="*|"--log="*)
+ for OPT in ${1#*=}
+ do
+ SIMOPTS="$SIMOPTS ${1%%=*}=$OPT"
+ done
+ shift 1
+ ;;
*)
break
;;
*)
break
;;
@@
-77,7
+85,7
@@
shift
##-------------------------------- DEFAULT or SPECIFIED PLATFORM --------------------------------------
##-------------------------------- DEFAULT or SPECIFIED PLATFORM --------------------------------------
-if [ -z "${PLATFORM}" ]; then
+if [ -z "${PLATFORM}" ]; then
PLATFORMTMP="$(mktemp tmpXXXXXX)"
cat > ${PLATFORMTMP} <<PLATFORMHEAD
PLATFORMTMP="$(mktemp tmpXXXXXX)"
cat > ${PLATFORMTMP} <<PLATFORMHEAD
@@
-135,16
+143,29
@@
fi
## hostfile has less than i lines.
##----------------------------------------------------------
## 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 <process> tags------------------------------
##---- generate <process> tags------------------------------
-for i in
`seq 0 $((${NUMPROCS}-1))`
+for i in
${SEQ}
do
if [ -n "${HOSTFILE}" ]; then
j=$(( $i % ${NUMHOSTS} ))
do
if [ -n "${HOSTFILE}" ]; then
j=$(( $i % ${NUMHOSTS} ))
- fi
+ fi
##---- optional display of ranks to process mapping
##---- 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
fi
if [ -z "${hostnames[$j]}" ]; then
@@
-165,15
+186,14
@@
cat >> ${APPLICATIONTMP} <<APPLICATIONFOOT
APPLICATIONFOOT
##-------------------------------- end DEFAULT APPLICATION --------------------------------------
APPLICATIONFOOT
##-------------------------------- end DEFAULT APPLICATION --------------------------------------
-if [ -
z "${QUIET
}" ] ; then
- echo ${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP}
+if [ -
n "${KEEP
}" ] ; then
+ echo ${EXEC} ${
SIMOPTS} ${
PLATFORMTMP} ${APPLICATIONTMP}
fi
fi
-${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP}
+${EXEC} ${
SIMOPTS} ${
PLATFORMTMP} ${APPLICATIONTMP}
-if [ -z "${
QUIET
}" ] ; then
- echo "[$0] cleaning up temp files"
-fi
-if [ -z "${PLATFORM}" ]; then
- rm ${PLATFORMTMP}
+if [ -z "${
KEEP
}" ] ; then
+ if [ -z "${PLATFORM}" ]; then
+ rm ${PLATFORMTMP}
+ fi
+ rm ${APPLICATIONTMP}
fi
fi
-rm ${APPLICATIONTMP}