Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update on smpirun script to accept -trace argument with the name of the tracefile
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 10 Aug 2010 11:32:26 +0000 (11:32 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 10 Aug 2010 11:32:26 +0000 (11:32 +0000)
details:
- among other parameters, smpirun accepts:
smpirun (...) -trace tracefile.trace (...) ./bcast (...)
- the parameter is translated to the following options to the simulator
--cfg=tracing/filename:${TRACEOPT} --cfg=tracing/smpi:1 where TRACEOPT
is the trace file passed as parameter

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8147 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/smpirun.in

index 236eab7..6762c62 100755 (executable)
@@ -54,6 +54,11 @@ while true; do
       shift 1
    ;;
 
       shift 1
    ;;
 
+   "-trace")
+       TRACEOPT="$2"
+         shift 2
+   ;;
+
    "-keep-temps")
        KEEP="true"
       shift 1
    "-keep-temps")
        KEEP="true"
       shift 1
@@ -61,7 +66,7 @@ while true; do
 
    "-help" | "--help" | "-h")
       echo "usage:"
 
    "-help" | "--help" | "-h")
       echo "usage:"
-      echo "$0 [-quiet] [-keep-temps] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
+      echo "$0 [-quiet] [-keep-temps] [-trace <tracefile>] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
       echo "or (deprecated usage):"
       echo "$0 [-quiet] [-keep-temps] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
       echo
       echo "or (deprecated usage):"
       echo "$0 [-quiet] [-keep-temps] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
       echo
@@ -190,10 +195,18 @@ cat >> ${APPLICATIONTMP} <<APPLICATIONFOOT
 APPLICATIONFOOT
 ##-------------------------------- end DEFAULT APPLICATION --------------------------------------
 
 APPLICATIONFOOT
 ##-------------------------------- end DEFAULT APPLICATION --------------------------------------
 
+##---------------------- SMPI TRACING OPTIONS ---------------------------------
+  if [ -n "${TRACEOPT}" ]; then
+    TRACEOPTIONS="--cfg=tracing/filename:${TRACEOPT} --cfg=tracing/smpi:1"
+  else
+    TRACEOPTIONS=""
+  fi
+##---------------------- end SMPI TRACING OPTIONS ---------------------------------
+
 if [ -n "${KEEP}" ] ; then
 if [ -n "${KEEP}" ] ; then
-  echo ${EXEC} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
+  echo ${EXEC} ${SIMOPTS} ${TRACEOPTIONS} ${PLATFORMTMP} ${APPLICATIONTMP}
 fi
 fi
-${EXEC} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
+${EXEC} ${SIMOPTS} ${TRACEOPTIONS} ${PLATFORMTMP} ${APPLICATIONTMP}
 
 if [ -z "${KEEP}" ] ; then
    if [ -z "${PLATFORM}" ]; then
 
 if [ -z "${KEEP}" ] ; then
    if [ -z "${PLATFORM}" ]; then