Debian Codegraph @

debian/tests/test-dolfin-python-demo

raw
1 #!/bin/bash
2 set -e
3
4 # MPI tests are set up to run on 3 processes.
5 N_MPI=3
6 export PRTE_MCA_plm_ssh_agent=/bin/false
7 export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
8 export OMPI_MCA_btl_base_warn_component_unused=0
9
10 DEB_HOST_ARCH=$( dpkg-architecture -q DEB_HOST_ARCH )
11
12 # test default python only to reduce test burden
13 PYVER=$(py3versions -dv)
14
15 # store demos to be skipped in this array variable
16 declare -a SKIP_DEMO_LIST
17
18 # skip slowest demos to reduce test burden
19 # leave stokes-taylor-hood and meshview-3D2D running as a test of functionality
20 SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" matnest curl-curl stokes-iterative meshview-3D3D meshview-3D1D poisson-disc)
21
22 # the -k keyword option doesn't handle the hyphen in navier-stokes or cahn-hilliard with multiple tests skipped
23 # so need to identify by single name
24 SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" cahn hyperelasticity elastodynamics navier elasticity block-assembly-3D buckling)
25
26 # matplotlib crashes with malloc(): unaligned tcache chunk detected on several arches
27 SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" mesh-quality)
28
29 case " i386 armhf " in \
30 *\ ${DEB_HOST_ARCH}\ *) SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" iterative block meshview assignment);; \
31 esac
32
33 # demo_waveguide fails on ppc64el with openblas (Bug#1121177)
34 case " ppc64el " in \
35 *\ ${DEB_HOST_ARCH}\ *) SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" waveguide );; \
36 esac
37
38 # skip slowest demos on riscv64
39 case " riscv64 " in \
40 *\ ${DEB_HOST_ARCH}\ *) SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" meshview-3D stokes-iterative);; \
41 esac
42
43 case " s390x " in \
44 *\ ${DEB_HOST_ARCH}\ *) SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" matnest);; \
45 esac
46
47 # TAO segfaults since PETSc 3.25 (probably since PR 9029)
48 SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" contact-vi-tao)
49
50 SKIP_DEMOS=""
51 list_initialised=0
52 for t in "${SKIP_DEMO_LIST[@]}"; do
53 if [ ${list_initialised} = 0 ]; then
54 SKIP_DEMOS="$t"
55 list_initialised=1
56 else
57 SKIP_DEMOS="${SKIP_DEMOS} or $t"
58 fi
59 done
60 if [ "x${SKIP_DEMOS}" != "x" ]; then
61 SKIP_DEMOS="not ( ${SKIP_DEMOS} )"
62 fi
63
64 if [ "x${SKIP_DEMOS}" != "x" ]; then
65 echo "skipping demos with SKIP_DEMOS=${SKIP_DEMOS}"
66 fi
67
68 python3 python/demo/generate-demo-files.py
69
70 for pyver in $PYVER; do
71 echo "=== python $pyver demo test (serial) ==="
72 python$pyver -m pytest -v --durations=20 -k "${SKIP_DEMOS}" python/demo/test.py
73 done
74
75
76 # these demos sometimes hang (race condition) or fail in the MPI test environment
77 declare -a MPI_SKIP_DEMO_LIST
78 MPI_SKIP_DEMO_LIST=("${SKIP_DEMO_LIST[@]}" block-assembly-2D2D contact-vi-tao meshview-2D2D meshview-3D mixed-poisson)
79
80 # matplotlib crashes with malloc(): unaligned tcache chunk detected on several arches
81 MPI_SKIP_DEMO_LIST=("${MPI_SKIP_DEMO_LIST[@]}" ghost-mesh)
82
83 # avoid timeout on riscv64
84 case " riscv64 " in \
85 *\ ${DEB_HOST_ARCH}\ *) MPI_SKIP_DEMO_LIST=("${MPI_SKIP_DEMO_LIST[@]}" built-in-meshes);; \
86 esac
87
88
89 MPI_SKIP_DEMOS=""
90 list_initialised=0
91 for t in "${MPI_SKIP_DEMO_LIST[@]}"; do
92 if [ ${list_initialised} = 0 ]; then
93 MPI_SKIP_DEMOS=$t
94 list_initialised=1
95 else
96 MPI_SKIP_DEMOS="${MPI_SKIP_DEMOS} or $t"
97 fi
98 done
99 if [ "x${MPI_SKIP_DEMOS}" != "x" ]; then
100 MPI_SKIP_DEMOS="not ( ${MPI_SKIP_DEMOS} )"
101 fi
102
103 if [ "x${MPI_SKIP_DEMOS}" != "x" ]; then
104 echo "skipping MPI demos with MPI_SKIP_DEMOS=${MPI_SKIP_DEMOS}"
105 fi
106
107 for pyver in $PYVER; do
108 echo "=== python $pyver demo test (MPI) ==="
109 python$pyver -m pytest -v --durations=20 -k "${MPI_SKIP_DEMOS}" python/demo/test.py --mpiexec=mpiexec --num-proc=${N_MPI}
110 done