CarpetX: a Cactus driver for the Einstein Toolkit based on AMReX
#! /bin/bash

echo "Preparing:"
set -x                          # Output commands
set -e                          # Abort on errors

cd @RUNDIR@-active

echo "Checking:"
pwd
hostname
date

echo "Environment:"
export 'SIMULATION_ID=@SIMULATION_ID@'
export CACTUS_NUM_PROCS=@NUM_PROCS@
export CACTUS_NUM_THREADS=@NUM_THREADS@
export CACTUS_SET_THREAD_BINDINGS=0
export CXX_MAX_TASKS=1000
export GLIBCXX_FORCE_NEW=1
export GMON_OUT_PREFIX=gmon.out
export OMP_DISPLAY_ENV=TRUE
export OMP_MAX_TASKS=100
export OMP_NUM_THREADS=@NUM_THREADS@
export OMP_PLACES=cores     # threads, cores, sockets
export OMP_PROC_BIND=FALSE  # false, true, master, close, spread
export OMP_STACKSIZE=8192   # kByte
env | sort >SIMFACTORY/ENVIRONMENT

# Enable this to allow core files
# ulimit -c unlimited

echo "Starting:"
export CACTUS_STARTTIME=$(date +%s)
time                                            \
    /usr/bin/mpiexec                            \
    -n @NUM_PROCS@                              \
    @EXECUTABLE@ -L 3 @PARFILE@                 \
    >@SIMULATION_NAME@.out                      \
    2>@SIMULATION_NAME@.err

echo "Stopping:"
date

echo "Done."