Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
check that specified platform and hostfile exist.
[simgrid.git] / src / smpi / smpirun.in
index 29e4c87..a57e61a 100755 (executable)
@@ -29,10 +29,18 @@ while true; do
     ;;
    "-platform")
        PLATFORM="$2"
+      if [ ! -f ${PLATFORM} ]; then
+               echo "[$0] ** error: the file '${PLATFORM}' does not exist. Aborting."
+               exit 1
+      fi
        shift 2
     ;;
    "-hostfile")
        HOSTFILE="$2"
+      if [ ! -f ${HOSTFILE} ]; then
+               echo "[$0] ** error: the file '${HOSTFILE}' does not exist. Aborting."
+               exit 1
+      fi
        shift 2
     ;;
 
@@ -51,10 +59,14 @@ done
 EXEC="$1"
 shift
 
+##-----------------------------------
+
+
+
+
 ##-------------------------------- DEFAULT or SPECIFIED PLATFORM --------------------------------------
 if [ -z "${PLATFORM}" ]; then  
        PLATFORMTMP="$(mktemp tmpXXXXXX)"
-       #PLATFORMTMP="pla.xml"
 
        cat > ${PLATFORMTMP} <<PLATFORMHEAD
 <?xml version='1.0'?>
@@ -117,6 +129,7 @@ for (( i=${NUMPROCS}; $i ; i=$i-1 )) do
        host="${hostnames[$j]}"
   fi
   echo "  <process host=\"${host}\" function=\"smpi_simulated_main\">" >> ${APPLICATIONTMP}
+    echo "    <argument value=\"$j\"/> <!-- rank -->" >> ${APPLICATIONTMP}
   for ARG in $*; do
     echo "    <argument value=\"${ARG}\"/>" >> ${APPLICATIONTMP}
   done
@@ -130,9 +143,6 @@ for (( i=${NUMPROCS}; $i ; i=$i-1 )) do
   else
        host="${hostnames[$j]}"
   fi
-#  echo "  <process host=\"${host}\" function=\"smpi_sender\"/>" >> ${APPLICATIONTMP}
-#  echo "  <process host=\"${host}\" function=\"smpi_receiver\"/>" >> ${APPLICATIONTMP}
 done
 
 cat >> ${APPLICATIONTMP} <<APPLICATIONFOOT