Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Restore environment variable used by StarPU.
[simgrid.git] / src / smpi / smpirun.in
index 8d28059..5fbc9b3 100755 (executable)
@@ -35,6 +35,9 @@ Usage: $0 [OPTIONS] -platform <xmldesc> -hostfile <hostfile> program [program-op
 Options:
   -keep-temps                # don't remove the generated files after execution
   -wrapper <command>         # use command to run the program (e.g. "valgrind" or "gdb --args")
+  -gdb                       # run within GDB (-wrapper "gdb --args" -keep-temps)
+  -lldb                      # run within LLDB (-wrapper "lldb --" -keep-temps)
+  -vgdb                      # run within Valgrind+GDB (-wrapper "valgrind --vgdb=yes --vgdb-error=0" -keep-temps)
   -map                       # display the machine on which each process rank is mapped
   -np <numprocs>             # use that amount of processes from the hostfile.
                              # By default, all processes of the hostfile are used.
@@ -195,14 +198,32 @@ while true; do
             shift 1
             ;;
         "-keep-temps")
-           KEEP="true"
-           SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
+            KEEP="true"
+            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
             shift 1
             ;;
         "-wrapper")
             WRAPPER="$2"
             shift 2
             ;;
+        "-gdb")
+            WRAPPER="gdb --args"
+            KEEP="true"
+            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
+            shift 1
+            ;;
+        "-vgdb")
+            WRAPPER="valgrind --vgdb=yes --vgdb-error=0"
+            KEEP="true"
+            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
+            shift 1
+            ;;
+        "-lldb")
+            WRAPPER="lldb --"
+            KEEP="true"
+            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
+            shift 1
+            ;;
         "-help" | "--help" | "-h")
             usage
             exit 0
@@ -484,6 +505,7 @@ if [ -n "${TRACE_ACTIVE}" ]; then
 fi
 ##---------------------- end SMPI TRACING OPTIONS ---------------------------------
 
+# Do not remove, this variable may be used by user code (e.g. StarPU)
 export SMPI_GLOBAL_SIZE=${NUMPROCS}
 if [ -n "${KEEP}" ] ; then
     echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}