#!/bin/bash # please do not move this script as relies on ../.. being DYNAMICO_ROOT # usage : ./python.sh mode [n] script script_args # mode is 'serial' or mpi # if mode is 'mpi' then argument [n] specifies the number of MPI processes function cmd_serial() { LD_PRELOAD=$PYTHON_PRELOAD python -u $* } function cmd_gdb() { set -x LD_PRELOAD=$PYTHON_PRELOAD gdb --args python -u $* } function cmd_mpi() { NB_MPI=$1 shift mpirun -np $NB_MPI python -u $* } TEST=$PWD DYNAMICO_ROOT=$(cd -P $(dirname $0)/../.. ; pwd) cd $DYNAMICO_ROOT cp -i -u Python/dynamico/* lib/dynamico/ . arch.env . arch.path cd $DYNAMICO_ROOT/Python/env . $CURRENT_ARCH.env cd $TEST export OMP_STACKSIZE=128M ulimit -s unlimited CMD=$1 shift cmd_$CMD $*