Debian Codegraph @

debian/tests/gyoto-lorene-mpi

raw
1 #!/bin/sh
2 set -e
3
4 # Name of this script
5 script=`basename "$0"`
6
7 # Handle case of manually running this script
8 if [ "$AUTOPKGTEST_TMP" = "" ]; then
9 AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`;
10 echo "AUTOPKGTEST_TMP is $AUTOPKGTEST_TMP";
11 fi
12 if [ "$ADT_ARTIFACTS" = "" ] ; then
13 ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts
14 fi
15 mkdir -p "${AUTOPKGTEST_TMP}"
16 mkdir -p "${ADT_ARTIFACTS}"
17
18 # Save current directory (must be top of source tree)
19 SRC_ROOT=`pwd`
20
21 # Compute Lorene metric using Nrotstar "code"
22 export HOME_LORENE=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene
23 mkdir -p ${AUTOPKGTEST_TMP}/${script}
24 cd ${AUTOPKGTEST_TMP}/${script}
25 rm -Rf .check-lorene
26 cp -a ${HOME_LORENE}/Codes/Nrotstar ./.check-lorene
27 cd .check-lorene
28 rm -f nrotstar *.o
29 cp -f Parameters/GR/Kepler/*.d ./
30 sed -i.bak 's/1 graph/0 graph/' par_rot.d
31 make
32 ./nrotstar
33 cd ..
34
35 # Get list of Lorene examples
36 EXAMPLES_DIR=${SRC_ROOT}/doc/examples
37 BASE_NAMES=`basename -s.xml ${EXAMPLES_DIR}/*-rotstar3_1.xml`
38
39 # Build Gyoto command line
40 GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32 --plugins=stdplug,lorene"
41
42 # Determine default MPI implementation for this arch
43 HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script}
44 eval `grep ARCH_DEFAULT_MPI_IMPL /usr/share/mpi-default-dev/debian_defaults`
45 if [ "x$ARCH_DEFAULT_MPI_IMPL" = x"openmpi" ]
46 # Setup MPI environment to run on localhost with enough slots
47 then export OMPI_MCA_plm_rsh_agent=/bin/false
48 export OMPI_MCA_btl_tcp_if_include=lo
49 HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script}
50 echo localhost slots=5 > "${HOSTFILE}"
51 MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE} --oversubscribe"
52 elif [ "x$ARCH_DEFAULT_MPI_IMPL" = x"mpich" ]
53 then echo localhost > "${HOSTFILE}"
54 MPIRUN_CMD="mpirun.mpich -np 1 --hostfile ${HOSTFILE}"
55 else echo "unknown MPI implementation: " $ARCH_DEFAULT_MPI_IMPL
56 exit 1
57 fi
58
59 # Run each example in this environment
60 for base in ${BASE_NAMES} ; do
61 ${MPIRUN_CMD} ${GYOTO} \
62 ${EXAMPLES_DIR}/${base}.xml \
63 \!${ADT_ARTIFACTS}/${base}-mpi.fits ;
64 done
65
66 exit 0