File: python-gyoto-mpi

package info (click to toggle)
gyoto 1.4.4-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,072 kB
  • sloc: cpp: 35,825; sh: 18,796; python: 2,700; xml: 2,666; makefile: 662; ansic: 332
file content (57 lines) | stat: -rwxr-xr-x 1,671 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
set -e

# Name of this script
script=`basename "$0"`

# Handle case of manually running this script
if [ "$AUTOPKGTEST_TMP" = "" ]; then
    AUTOPKGTEST_TMP=`mktemp -d --tmpdir "$script"-XXX`;
    echo "AUTOPKGTEST_TMP is $AUTOPKGTEST_TMP";
fi
if [ "$ADT_ARTIFACTS" = "" ] ; then
    ADT_ARTIFACTS=${AUTOPKGTEST_TMP}/artifacts
fi
mkdir -p "${AUTOPKGTEST_TMP}"
mkdir -p "${ADT_ARTIFACTS}"

# Save current directory (must be top of source tree)
SRC_ROOT=`pwd`

# Setup Python example tree structure
mkdir -p ${AUTOPKGTEST_TMP}/doc
cp -a doc/examples ${AUTOPKGTEST_TMP}/doc/
mkdir -p ${AUTOPKGTEST_TMP}/python
cd ${AUTOPKGTEST_TMP}/python
echo "backend : PDF" > matplotlibrc
cp ${SRC_ROOT}/plugins/python/doc/examples/* ./
cp ${SRC_ROOT}/python/example-mpi.py ./

# Get list of Python examples
BASE_NAMES=`basename -s.xml *.xml`

# Build Gyoto command line
GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32"

# Setup MPI environment to run on localhost with enough slots
export OMPI_MCA_plm_rsh_agent=/bin/false
export OMPI_MCA_btl_tcp_if_include=lo
HOSTFILE="${AUTOPKGTEST_TMP}"/hostfile.${script}
echo localhost slots=5 > "${HOSTFILE}"
MPIRUN_CMD="mpirun.openmpi -np 5 --hostfile ${HOSTFILE}"

# Run each example in this environment
for python in python3 `py3versions -s` ; do
    echo "**** Testing Python version: $python ****" 
    unset GYOTO_PLUGINS
    ${MPIRUN_CMD} $python example-mpi.py ;
    mkdir -p ${ADT_ARTIFACTS}/${python}-mpi
    export GYOTO_PLUGINS=$python,stdplug
    for base in ${BASE_NAMES} ; do
	${MPIRUN_CMD} ${GYOTO} \
		      ${base}.xml \
		      \!${ADT_ARTIFACTS}/${python}-mpi/${base}.fits ;
    done ;
done

exit 0