# 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.
# 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.
-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.
-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.
-trace-ti # activate time independant tracing (for replay, default in smpi_simgrid.txt)
-trace # activate tracing (Paje, default in smpi_simgrid.trace)
-trace-comment <comment> # put a comment on the top of the trace file
-trace-ti # activate time independant tracing (for replay, default in smpi_simgrid.txt)
-trace # activate tracing (Paje, default in smpi_simgrid.trace)
-trace-comment <comment> # put a comment on the top of the trace file
- die ("Unparsable cluster tag. Either provide an hostfile yourself or give the attributes prefix, radical and suffix in that order on the <cluster line");
+ 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 and ON THE SAME LINE as the opening tag (<cluster)");
# Don't use wc -l to compute it to avoid issues with trailing \n at EOF
hostfile_procs=`grep -c "[a-zA-Z0-9]" $HOSTFILE`
if [ ${hostfile_procs} = 0 ] ; then
# Don't use wc -l to compute it to avoid issues with trailing \n at EOF
hostfile_procs=`grep -c "[a-zA-Z0-9]" $HOSTFILE`
if [ ${hostfile_procs} = 0 ] ; then
if [ ${NUMPROCS} -gt ${hostfile_procs} ] ; then
echo "You requested to use ${NUMPROCS} processes, but there is only ${hostfile_procs} processes in your hostfile..." >&2
fi
if [ ${NUMPROCS} -gt ${hostfile_procs} ] ; then
echo "You requested to use ${NUMPROCS} processes, but there is only ${hostfile_procs} processes in your hostfile..." >&2
fi
##-------------------------------- DEFAULT APPLICATION --------------------------------------
APPLICATIONTMP="$(mktemp smpitmp-appXXXXXX)"
#APPLICATIONTMP="app.xml"
##-------------------------------- DEFAULT APPLICATION --------------------------------------
APPLICATIONTMP="$(mktemp smpitmp-appXXXXXX)"
#APPLICATIONTMP="app.xml"
cat > ${APPLICATIONTMP} <<APPLICATIONHEAD
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
cat > ${APPLICATIONTMP} <<APPLICATIONHEAD
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
##----------------------------------------------------------
## generate application.xml with hostnames from hostfile:
##----------------------------------------------------------
## generate application.xml with hostnames from hostfile:
-## the name of host_i (1<=i<=p, where -np p) is the line i
-## in hostfile (where -hostfile hostfile), or "host$i" if
+## the name of host_i (1<=i<=p, where -np p) is the line i in hostfile (where -hostfile hostfile), or "host$i" if
echo " <process host=\"${host}\" function=\"$i\"> <!-- function name used only for logging -->" >> ${APPLICATIONTMP}
echo " <argument value=\"1\"/> <!-- instance -->" >> ${APPLICATIONTMP}
echo " <argument value=\"$i\"/> <!-- rank -->" >> ${APPLICATIONTMP}
echo " <process host=\"${host}\" function=\"$i\"> <!-- function name used only for logging -->" >> ${APPLICATIONTMP}
echo " <argument value=\"1\"/> <!-- instance -->" >> ${APPLICATIONTMP}
echo " <argument value=\"$i\"/> <!-- rank -->" >> ${APPLICATIONTMP}
##---------------------- SMPI TRACING OPTIONS ---------------------------------
if [ -n "${TRACE_ACTIVE}" ]; then
#define trace filename
##---------------------- SMPI TRACING OPTIONS ---------------------------------
if [ -n "${TRACE_ACTIVE}" ]; then
#define trace filename
-# * The FD 3 is used to temporarily store FD 1. This is because the shell
-# connects FD 1 to /dev/null when the command is launched in the
-# background: this can be overriden in bash but not in standard bourne shell.
+# * The FD 3 is used to temporarily store FD 1. This is because the shell connects FD 1 to /dev/null when the command
+# is launched in the background: this can be overriden in bash but not in standard bourne shell.