A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply the default settings of 'smpi/buffering' too
[simgrid.git]
/
src
/
smpi
/
smpirun.in
diff --git
a/src/smpi/smpirun.in
b/src/smpi/smpirun.in
index
d095d29
..
4bc1491
100755
(executable)
--- a/
src/smpi/smpirun.in
+++ b/
src/smpi/smpirun.in
@@
-72,6
+72,7
@@
HOSTFILE=""
HOSTFILETMP=0
MAPOPT=0
REPLAY=0
HOSTFILETMP=0
MAPOPT=0
REPLAY=0
+QUIET=""
unset pid
unset pid
@@
-202,6
+203,10
@@
while true; do
SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
shift 1
;;
SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
shift 1
;;
+ "-quiet")
+ QUIET="true"
+ shift 1
+ ;;
"-wrapper")
WRAPPER="$2"
shift 2
"-wrapper")
WRAPPER="$2"
shift 2
@@
-299,8
+304,6
@@
fi
if [ -z "${HOSTFILE}" ] ; then
HOSTFILETMP=1
HOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
if [ -z "${HOSTFILE}" ] ; then
HOSTFILETMP=1
HOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
- perl -ne 'print "$1\n" if /.*<host.*?id="(.*?)".*?\/>.*/' ${PLATFORM} > ${HOSTFILE}
- # put all <cluster tag on its own line.
@PYTHON_EXECUTABLE@ -c '
import xml.etree.ElementTree as ET
import sys
@PYTHON_EXECUTABLE@ -c '
import xml.etree.ElementTree as ET
import sys
@@
-308,6
+311,9
@@
import re
tree = ET.parse(sys.stdin)
tree = ET.parse(sys.stdin)
+for elem in tree.findall(".//host"):
+ print(elem.attrib["id"])
+
for elem in tree.findall(".//cluster"):
prefix = elem.attrib["prefix"]
radical = elem.attrib["radical"]
for elem in tree.findall(".//cluster"):
prefix = elem.attrib["prefix"]
radical = elem.attrib["radical"]
@@
-319,16
+325,26
@@
for elem in tree.findall(".//cluster"):
print(prefix + str(i) + suffix)
else:
print(prefix + r + suffix)
print(prefix + str(i) + suffix)
else:
print(prefix + r + suffix)
- ' < ${PLATFORM} >
>
${HOSTFILE}
+ ' < ${PLATFORM} > ${HOSTFILE}
fi
UNROLLEDHOSTFILETMP=0
fi
UNROLLEDHOSTFILETMP=0
-#parse if our lines are terminated by :num_process
-multiple_processes=$(grep -c ":" $HOSTFILE)
-if [ "${multiple_processes}" -gt 0 ] ; then
+# parse if our lines are terminated by :num_process
+if grep -q ':' $HOSTFILE ; then
UNROLLEDHOSTFILETMP=1
UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
UNROLLEDHOSTFILETMP=1
UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
- perl -ne ' do{ for ( 1 .. $2 ) { print "$1\n" } } if /(.*?):(\d+).*/' ${HOSTFILE} > ${UNROLLEDHOSTFILE}
+ @PYTHON_EXECUTABLE@ -c '
+import sys
+import re
+
+for line in sys.stdin:
+ m = re.match("(.*):(.*)", line)
+ if m:
+ for i in range(0, int(m.group(2))):
+ print(m.group(1))
+ else:
+ print(line.strip())
+' < ${HOSTFILE} > ${UNROLLEDHOSTFILE}
if [ ${HOSTFILETMP} = 1 ] ; then
rm ${HOSTFILE}
HOSTFILETMP=0
if [ ${HOSTFILETMP} = 1 ] ; then
rm ${HOSTFILE}
HOSTFILETMP=0
@@
-548,7
+564,7
@@
pid=""
# Keep temporary files on failures to help debugging
#
if [ ${status} -ne 0 ] ; then
# Keep temporary files on failures to help debugging
#
if [ ${status} -ne 0 ] ; then
- if [ -z "${KEEP}" ]; then
+ if [ -z "${KEEP}"
-a -z "${QUIET}"
]; then
echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
if [ ${HOSTFILETMP} = 1 ] ; then
echo "Generated hostfile ${HOSTFILE} kept."
echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
if [ ${HOSTFILETMP} = 1 ] ; then
echo "Generated hostfile ${HOSTFILE} kept."
@@
-556,9
+572,9
@@
if [ ${status} -ne 0 ] ; then
if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then
echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept."
fi
if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then
echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept."
fi
+ KEEP=true
fi
echo "Execution failed with code ${status}."
fi
echo "Execution failed with code ${status}."
- KEEP=true
fi
smpirun_cleanup
fi
smpirun_cleanup