Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define an additional parameter for the hack around smpi_replay in smpirun.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 23 Oct 2012 08:54:14 +0000 (10:54 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 23 Oct 2012 13:58:09 +0000 (15:58 +0200)
Relying on the command name is too fragile.

examples/smpi/replay/smpi_replay.tesh
src/smpi/smpirun.in

index 9cd7493..62fa116 100644 (file)
@@ -2,7 +2,7 @@
 # (since we want to pass it to the child, it has to be redefined before each command)
 # Go for the first test
 p Test of trace replay with SMPI (one trace for all processes)
-$ ../../bin/smpirun --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/one_trace
+$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -27,7 +27,7 @@ $ ../../bin/smpirun --log=replay.thresh:critical --log=smpi_replay.thresh:verbos
 
 
 p The same with tracing activated
-$ ../../bin/smpirun --log=replay.thresh:critical --log=no_loc  --cfg=tracing:1 --cfg=tracing/smpi:1 --cfg=tracing/smpi/computing:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/one_trace
+$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc  --cfg=tracing:1 --cfg=tracing/smpi:1 --cfg=tracing/smpi/computing:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -205,7 +205,7 @@ $ tail -n +3 ./simgrid.trace
 $ rm -f ./simgrid.trace
 
 p Another test of trace replay with SMPI (one trace per process)
-$ ../../bin/smpirun --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc -np 2 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/split_traces
+$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc -np 2 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/split_traces
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
index 9145e70..d1d395e 100755 (executable)
@@ -33,6 +33,7 @@ Options:
   -trace-resource            # trace resource utilization
   -trace-triva               # generate configuration for Triva's GraphView
   -trace-file <tracefile>    # name of the tracefile (simgrid_smpi.trace)
+  -ext <value>               # additional parameter (reserved)
 
 or (deprecated usage):
   $0 [-keep-temps] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]
@@ -47,6 +48,8 @@ then
     exit
 fi
 
+EXTOPT=""
+
 while true; do
   case "$1" in
    "-np" | "-n")
@@ -78,6 +81,11 @@ while true; do
        shift 2
     ;;
 
+   "-ext")
+      EXTOPT="$2"
+      shift 2
+   ;;
+
    "-map")
        MAPOPT="true"
       shift 1
@@ -226,7 +234,7 @@ if [ -n "${HOSTFILE}" ] && [ -f ${HOSTFILE} ]; then
       NUMHOSTS=`cat ${HOSTFILE} | wc -l`
 fi
 
-if [ "${EXEC}" = "./smpi_replay" ]; then
+if [ "${EXTOPT}" = "smpi_replay" ]; then
   APP_TRACES=$1;
   if [ -n "${APP_TRACES}" ] && [ -f ${APP_TRACES} ]; then
      hosttraces=(`cat ${APP_TRACES} | tr \\\n " "`)
@@ -272,7 +280,7 @@ do
   fi
   echo "  <process host=\"${host}\" function=\"$i\"> <!-- function name used only for logging -->" >> ${APPLICATIONTMP}
   echo "    <argument value=\"$i\"/> <!-- rank -->" >> ${APPLICATIONTMP}
-  if [ "${EXEC}" = "./smpi_replay" ]; then
+  if [ "${EXTOPT}" = "smpi_replay" ]; then
     if  [ ${NUMTRACES} -gt 1 ]; then
       echo "    <argument value=\"${hosttraces[$j]}\"/>" >> ${APPLICATIONTMP}
     else