PRIVATIZE="--cfg=smpi/privatization:@HAVE_PRIVATIZATION@"
-SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP-gamma:4194304"
+SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI"
#usage to print the way this script should be called
usage () {
trapped_signals="HUP INT QUIT ILL ABRT SEGV FPE ALRM TERM USR1 USR2 BUS"
+die () {
+ printf '[%s] ** error: %s. Aborting.\n' "$(basename $0)" "$*" >&2
+ exit 1
+}
+
smpirun_cleanup()
{
if [ -z "${KEEP}" ] ; then
"-platform")
PLATFORM="$2"
if [ ! -f "${PLATFORM}" ]; then
- echo "[`basename $0`] ** error: the file '${PLATFORM}' does not exist. Aborting."
- exit 1
+ die "the file '${PLATFORM}' does not exist"
fi
shift 2
;;
"-hostfile")
HOSTFILE="$2"
if [ ! -f "${HOSTFILE}" ]; then
- echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
- exit 1
+ die "the file '${HOSTFILE}' does not exist"
fi
shift 2
;;
"-machinefile")
HOSTFILE="$2"
if [ ! -f "${HOSTFILE}" ]; then
- echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
- exit 1
+ die "the file '${HOSTFILE}' does not exist"
fi
shift 2
;;
# 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
- echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2
- exit 1
+ die "the hostfile '${HOSTFILE}' is empty"
fi
if [ -z "${NUMPROCS}" ] ; then
# Keep temporary files on failures to help debugging
#
if [ ${status} -ne 0 ] ; then
- if [ -z ${KEEP} ]; then
+ if [ -z "${KEEP}" ]; then
echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
if [ ${HOSTFILETMP} = 1 ] ; then
echo "Generated hostfile ${HOSTFILE} kept."