X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8c644956d9e43243f2e9a54cf36b95897988415c..174ff5d9a704689bdbeb8aaabe4557bcd96841c4:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 09ea663c3f..aea4116b55 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -18,6 +18,24 @@ 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] [-trace ] [-np ] -platform -hostfile [-map] program [program-options]" + 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") @@ -59,6 +77,11 @@ while true; do shift 2 ;; + "-trace-grouped") + TRACE_GROUPED="true" + shift 1 + ;; + "-triva") TRIVA="true" shift 1 @@ -70,11 +93,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 ;; @@ -96,6 +115,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 @@ -210,17 +236,19 @@ APPLICATIONFOOT fi if [ -n "${TRIVA}" ]; then - TRIVAOPTIONS="--cfg=triva/categorized:smpi_cat.plist --cfg=triva/uncategorized:smpi_uncat.plist" - else - TRIVAOPTIONS="" + TRACEOPTIONS="$TRACEOPTIONS --cfg=triva/categorized:smpi_cat.plist --cfg=triva/uncategorized:smpi_uncat.plist" + fi + + if [ -n "${TRACE_GROUPED}" ]; then + TRACEOPTIONS="$TRACEOPTIONS --cfg=tracing/smpi/group:1" fi ##---------------------- end SMPI TRACING OPTIONS --------------------------------- export SMPI_GLOBAL_SIZE=${NUMPROCS} if [ -n "${KEEP}" ] ; then - echo ${EXEC} ${SIMOPTS} ${TRACEOPTIONS} ${TRIVAOPTIONS} ${PLATFORMTMP} ${APPLICATIONTMP} + echo ${EXEC} ${SIMOPTS} ${TRACEOPTIONS} ${PLATFORMTMP} ${APPLICATIONTMP} fi -${EXEC} ${SIMOPTS} ${TRACEOPTIONS} ${TRIVAOPTIONS} ${PLATFORMTMP} ${APPLICATIONTMP} +${EXEC} ${SIMOPTS} ${TRACEOPTIONS} ${PLATFORMTMP} ${APPLICATIONTMP} if [ -z "${KEEP}" ] ; then if [ -z "${PLATFORM}" ]; then