Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix copyright headers
[simgrid.git] / src / smpi / smpirun.in
index 278a49e..8966eb9 100755 (executable)
@@ -43,7 +43,7 @@ while true; do
       fi
        shift 2
     ;;
-   
+
    "-map")
        MAPOPT="true"
       shift 1
@@ -54,7 +54,7 @@ while true; do
       shift 1
    ;;
 
-   "-help" | "--help" | "-h") 
+   "-help" | "--help" | "-h")
       echo "usage:"
       echo "$0 [-quiet] [-keep-temps] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
       echo "or (deprecated usage):"
@@ -62,9 +62,12 @@ while true; do
       echo
       exit
    ;;
-   
-   "--cfg="*)
-     SIMOPTS="$SIMOPTS $1"
+
+   "--cfg="*|"--log="*)
+     for OPT in ${1#*=}
+     do
+       SIMOPTS="$SIMOPTS ${1%%=*}=$OPT"
+     done
      shift 1
    ;;
     *)
@@ -82,7 +85,7 @@ shift
 
 
 ##-------------------------------- DEFAULT or SPECIFIED PLATFORM --------------------------------------
-if [ -z "${PLATFORM}" ]; then  
+if [ -z "${PLATFORM}" ]; then
        PLATFORMTMP="$(mktemp tmpXXXXXX)"
 
        cat > ${PLATFORMTMP} <<PLATFORMHEAD
@@ -140,8 +143,7 @@ fi
 ##  hostfile has less than i lines.
 ##----------------------------------------------------------
 
-HAVE_SEQ="`which seq`"
-HAVE_JOT="`which jot`"
+HAVE_SEQ="`which seq 2>/dev/null`"
 
 if [ -n "${HAVE_SEQ}" ]; then
        SEQ=`${HAVE_SEQ} 0 $((${NUMPROCS}-1))`
@@ -155,14 +157,14 @@ fi
 
 ##---- generate <process> tags------------------------------
 
-for i in ${SEQ} 
+for i in ${SEQ}
 do
   if [ -n "${HOSTFILE}" ]; then
        j=$(( $i % ${NUMHOSTS} ))
-  fi 
+  fi
   ##---- optional display of ranks to process mapping
   if [ -n "${MAPOPT}" ]; then
-       echo "[rank $i] -> ${hostnames[$j]}"  
+       echo "[rank $i] -> ${hostnames[$j]}"
   fi
 
   if [ -z "${hostnames[$j]}" ]; then
@@ -190,7 +192,7 @@ ${EXEC} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
 
 if [ -z "${KEEP}" ] ; then
    if [ -z "${PLATFORM}" ]; then
-       rm ${PLATFORMTMP} 
+       rm ${PLATFORMTMP}
    fi
    rm ${APPLICATIONTMP}
 fi