-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.
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"
HOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
perl -ne 'print "$1\n" if /.*<host.*?id="(.*?)".*?\/>.*/' ${PLATFORM} > ${HOSTFILE}
# put all <cluster tag on its own line.
- cat ${PLATFORM} | tr '\n' ' ' | sed 's/<cluster/\n<cluster/' | \
- perl -ne 'if (m/.*<cluster.*?prefix="(.*?)".*?radical="(.*?)".*?suffix="(.*?)".*/s) {
- my ($pre,$rad,$post)=($1,$2,$3);
- for my $elm (split(",",$rad)) {
- if ($elm=~/^([^-]*?)-([^-]*)$/) {
- for (my $i=$1; $i<=$2;$i++) {
- print "$pre$i$post\n";
- }
- } else {
- print "$pre$elm$post\n";
- }
- }
- } elsif (/<cluster/) {
- die ("Unparsable cluster tag. smpirun uses a primitive regular expression to parse cluster tags. Either provide a hostfile yourself or give the attributes prefix, radical and suffix IN THAT ORDER.");
- }' ${PLATFORM} >> ${HOSTFILE}
+ @PYTHON_EXECUTABLE@ -c '
+import xml.etree.ElementTree as ET
+import sys
+import re
+
+tree = ET.parse(sys.stdin)
+
+for elem in tree.findall(".//cluster"):
+ prefix = elem.attrib["prefix"]
+ radical = elem.attrib["radical"]
+ suffix = elem.attrib["suffix"]
+ for r in radical.split(","):
+ m = re.match("^([^-]*?)-([^-]*)$", r)
+ if m:
+ for i in range(int(m.group(1)), int(m.group(2))):
+ print(prefix + str(i) + suffix)
+ else:
+ print(prefix + r + suffix)
+ ' < ${PLATFORM} >> ${HOSTFILE}
fi
UNROLLEDHOSTFILETMP=0
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}