X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3b7e5f4b4d7c87ee3e8827313ec966ea8fc8387..9b4e5a12b9e11e584c2c5af4d96e38b8220a72b9:/src/smpi/smpirun.in diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 74523e1dcf..e18553bd40 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -1,6 +1,6 @@ #!/usr/bin/env sh -# Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. +# Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the terms of the license (GNU LGPL) which comes with this package. @@ -26,12 +26,15 @@ PRIVATIZE="--cfg=smpi/privatization:${SMPI_PRIVATIZATION:-@HAVE_PRIVATIZATION@}" SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI" +SMPITMPDIR="$(dirname $(mktemp -u))" + #usage to print the way this script should be called usage () { cat < -hostfile program [program-options] $0 [OPTIONS] -platform -hostfile -replay [program] [program-options] Options: + -analyze # show information about allocations and timings at the end of execution -keep-temps # don't remove the generated files after execution -wrapper # use command to run the program (e.g. "valgrind" or "gdb --args") -gdb # run within GDB (-wrapper "gdb --args" -keep-temps) @@ -41,6 +44,7 @@ Options: -np # use that amount of processes from the hostfile. # By default, all processes of the hostfile are used. -no-privatize # Disable the globals privatization, that is activated by default + -tmpdir # Directory used to store temporary files. Defaults to system's. -trace-ti # activate time independent tracing (for replay, default in smpi_simgrid.txt) -trace # activate tracing (Paje, default in smpi_simgrid.trace) -trace-comment # put a comment on the top of the trace file @@ -143,29 +147,33 @@ while true; do shift 2 ;; "-platform") - PLATFORM="$2" + PLATFORM="$2" if [ ! -f "${PLATFORM}" ]; then die "the file '${PLATFORM}' does not exist" fi - shift 2 + shift 2 ;; "-hostfile" | "-machinefile") - HOSTFILE="$2" + HOSTFILE="$2" if [ ! -f "${HOSTFILE}" ]; then die "the file '${HOSTFILE}' does not exist" fi - shift 2 + shift 2 ;; "-replay") APP_TRACES="$2" shift 2 ;; - "-no-privatize") - PRIVATIZE="--cfg=smpi/privatization:no" - shift 1 - ;; + "-no-privatize") + PRIVATIZE="--cfg=smpi/privatization:no" + shift 1 + ;; "-map") - MAPOPT=1 + MAPOPT=1 + shift 1 + ;; + "-tmpdir") + SMPITMPDIR="$2" shift 1 ;; "-trace") @@ -202,10 +210,10 @@ while true; do SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes" shift 1 ;; - "-quiet") - QUIET="true" - shift 1 - ;; + "-quiet") + QUIET="true" + shift 1 + ;; "-wrapper") WRAPPER="$2" shift 2 @@ -228,6 +236,10 @@ while true; do SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes" shift 1 ;; + "-analyze") + SIMOPTS="$SIMOPTS --cfg=smpi/display-timing:yes --cfg=smpi/display-allocs:yes" + shift 1 + ;; "-help" | "--help" | "-h") usage exit 0 @@ -257,6 +269,10 @@ while true; do esac done +#setup tmp dir +SIMOPTS="$SIMOPTS --cfg=smpi/tmpdir:$SMPITMPDIR" +export LD_LIBRARY_PATH="$SMPITMPDIR:$LD_LIBRARY_PATH" + if [ -n "${APP_TRACES}" ] ; then if [ $# -eq 0 ] ; then EXEC="@SMPIREPLAYMAIN@" @@ -479,9 +495,11 @@ do if [ ${REPLAY} = 1 ]; then echo " " if [ "${NUMTRACES}" -gt 1 ]; then + # Give each process its trace file (as an argument) echo " " - else - echo " " + elif [ ${i} = 0 ]; then + # Give the shared trace file to rank 0 (as a property) + echo " " fi else echo "${XML_ARGS}"