From 05a2f271033bd32c4f81e9a1ae07e5456008f797 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 23 Oct 2012 10:54:14 +0200 Subject: [PATCH] Define an additional parameter for the hack around smpi_replay in smpirun. Relying on the command name is too fragile. --- examples/smpi/replay/smpi_replay.tesh | 6 +++--- src/smpi/smpirun.in | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/smpi/replay/smpi_replay.tesh b/examples/smpi/replay/smpi_replay.tesh index 9cd7493cc9..62fa116b00 100644 --- a/examples/smpi/replay/smpi_replay.tesh +++ b/examples/smpi/replay/smpi_replay.tesh @@ -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' diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 9145e70b52..d1d395edbb 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -33,6 +33,7 @@ Options: -trace-resource # trace resource utilization -trace-triva # generate configuration for Triva's GraphView -trace-file # name of the tracefile (simgrid_smpi.trace) + -ext # additional parameter (reserved) or (deprecated usage): $0 [-keep-temps] [-np ] [-bandwidth ] [-latency ] 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 " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} - if [ "${EXEC}" = "./smpi_replay" ]; then + if [ "${EXTOPT}" = "smpi_replay" ]; then if [ ${NUMTRACES} -gt 1 ]; then echo " " >> ${APPLICATIONTMP} else -- 2.20.1