Debian Codegraph @

debian/tests/test-io4dolfinx-network

raw
1 #!/bin/bash
2 set -e
3
4 # run tests requiring network access
5 # (test_exodus.py pulls data files from github)
6
7 # allow for the possibility that MPI tests are run
8 # on systems with a single CPU
9 export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
10
11 # OpenMPI 5 often sends uphelpful warnings to stderr, which are not actually errors:
12 # opal/mca/btl/tcp/btl_tcp_proc.c:266:mca_btl_tcp_proc_create_interface_graph] Unable to find reachable pairing between local and remote interfaces
13 # This env variable was identified as a workaround in Bug#1087784, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087784
14 export OMPI_MCA_btl_tcp_if_include=lo
15
16 n_proc=`nproc`
17 echo "${n_proc} CPUs are available"
18 for pyver in `py3versions -sv`; do
19 # By default, pytest tmp_path retains the temporary directory for the last 3
20 # pytest invocations.
21 # Using the --basetemp option will remove the directory before every run,
22 # effectively meaning the temporary directories of only the most recent run
23 # will be kept. We definitely do not want to keep old runs, because they may
24 # result in io4dolfinx trying to read in output files generated with a
25 # different PETSc scalar type (real vs complex).
26
27 echo "=== network tests for python $pyver (serial) ==="
28 python${pyver} -m pytest -v --basetemp=${AUTOPKGTEST_TMP}/io4dolfinx${TMPDIR_TAG}_py${pyver} --color=no tests/test_exodus.py
29
30 echo "=== network tests for python $pyver (MPI) ==="
31 mpirun -n 2 python${pyver} -m pytest -v --basetemp=${AUTOPKGTEST_TMP}/io4dolfinx${TMPDIR_TAG}_py${pyver}_mpi --color=no tests/test_exodus.py
32
33 echo "=== network tests for python $pyver (serial with complex numbers) ==="
34 PETSC_DIR=/usr/lib/petscdir/petsc-complex python${pyver} -m pytest -v --basetemp=${AUTOPKGTEST_TMP}/io4dolfinx${TMPDIR_TAG}_py${pyver}_complex --color=no tests/test_exodus.py
35
36 echo "=== network tests for python $pyver (MPI with complex numbers) ==="
37 PETSC_DIR=/usr/lib/petscdir/petsc-complex mpirun -n 2 python${pyver} -m pytest -v --basetemp=${AUTOPKGTEST_TMP}/io4dolfinx${TMPDIR_TAG}_py${pyver}_complex_mpi --color=no tests/test_exodus.py
38 done