X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ecf5019d1028a03dcf78799ae6d2ef3b4b74b7c..16f4e0f8c37216b991db811ec15ab79da4481d12:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 51fc1751ee..e9eea0fc4b 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -18,6 +18,28 @@ POWER="${DEFAULT_POWER}" SIMOPTS="--cfg=maxmin/precision:1e-9 --cfg=network/model:SMPI --cfg=TCP_gamma:4194304" +#usage to print the way this script should be called +function usage () { + echo "usage:" + echo "$0 [-quiet] [-keep-temps]" + echo " [-np ] -platform -hostfile [-map] program [program-options]" + echo " [-trace] # activate tracing" + echo " [-trace-grouped] # group MPI processes by location" + echo " [-trace-resource] # trace resource utilization" + echo " [-trace-triva] # generate configuration for Triva's GraphView" + echo " [-trace-file ] # name of the tracefile (simgrid_smpi.trace)" + echo "or (deprecated usage):" + echo "$0 [-quiet] [-keep-temps] [-np ] [-bandwidth ] [-latency ] program [program-options]" + echo +} + +#check if we have at least one parameter +if [ $# -eq 0 ] +then + usage + exit +fi + while true; do case "$1" in "-np" | "-n") @@ -55,17 +77,27 @@ while true; do ;; "-trace") - TRACEOPT="$2" - shift 2 + TRACE_ACTIVE="true" + shift 1 + ;; + + "-trace-file") + TRACE_FILENAME="$2" + shift 2 ;; "-trace-grouped") - TRACE_GROUPED="true" + TRACE_GROUPED="true" + shift 1 + ;; + + "-trace-resource") + TRACE_RESOURCE="true" shift 1 ;; - "-triva") - TRIVA="true" + "-trace-triva") + TRACE_TRIVA="true" shift 1 ;; @@ -75,11 +107,7 @@ while true; do ;; "-help" | "--help" | "-h") - echo "usage:" - echo "$0 [-quiet] [-keep-temps] [-trace ] [-np ] -platform -hostfile [-map] program [program-options]" - echo "or (deprecated usage):" - echo "$0 [-quiet] [-keep-temps] [-np ] [-bandwidth ] [-latency ] program [program-options]" - echo + usage exit ;; @@ -101,6 +129,13 @@ shift ##----------------------------------- +# test if we have something to execute, otherwise show usage and exit +if [ -z ${EXEC} ] +then + echo "Program is missing" + usage + exit 1 +fi @@ -208,19 +243,25 @@ APPLICATIONFOOT ##-------------------------------- end DEFAULT APPLICATION -------------------------------------- ##---------------------- SMPI TRACING OPTIONS --------------------------------- - if [ -n "${TRACEOPT}" ]; then - TRACEOPTIONS="--cfg=tracing:1 --cfg=tracing/filename:${TRACEOPT} --cfg=tracing/smpi:1 --cfg=tracing/categorized:1 --cfg=tracing/uncategorized:1" - else - TRACEOPTIONS="" +if [ -n "${TRACE_ACTIVE}" ]; then + #define trace filename + if [ -z "${TRACE_FILENAME}" ]; then + TRACE_FILENAME="smpi_simgrid.trace" + fi + TRACEOPTIONS="--cfg=tracing:1 --cfg=tracing/filename:${TRACE_FILENAME} --cfg=tracing/smpi:1" + + if [ -n "${TRACE_GROUPED}" ]; then + TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/smpi/group:1" fi - if [ -n "${TRIVA}" ]; then - TRACEOPTIONS="$TRACEOPTIONS --cfg=triva/categorized:smpi_cat.plist --cfg=triva/uncategorized:smpi_uncat.plist" + if [ -n "${TRACE_RESOURCE}" ]; then + TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/categorized:1 --cfg=tracing/uncategorized:1" fi - if [ -n "${TRACE_GROUPED}" ]; then - TRACEOPTIONS="$TRACEOPTIONS --cfg=tracing/smpi/group:1" + if [ -n "${TRACE_TRIVA}" ]; then + TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/categorized:smpi_cat.plist --cfg=tracing/uncategorized:smpi_uncat.plist" fi +fi ##---------------------- end SMPI TRACING OPTIONS --------------------------------- export SMPI_GLOBAL_SIZE=${NUMPROCS}