| 1 |
#!/bin/bash |
| 2 |
set -e |
| 3 |
|
| 4 |
# allow for the possibility that MPI tests are run |
| 5 |
# on systems with a single CPU |
| 6 |
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe |
| 7 |
|
| 8 |
# OpenMPI 5 often sends uphelpful warnings to stderr, which are not actually errors: |
| 9 |
# 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 |
| 10 |
# This env variable was identified as a workaround in Bug#1087784, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087784 |
| 11 |
export OMPI_MCA_btl_tcp_if_include=lo |
| 12 |
|
| 13 |
DEB_HOST_ARCH=$( dpkg-architecture -qDEB_HOST_ARCH ) |
| 14 |
DEB_HOST_ARCH_ENDIAN=$( dpkg-architecture -qDEB_HOST_ARCH_ENDIAN ) |
| 15 |
|
| 16 |
declare -a SKIP_TEST_LIST |
| 17 |
|
| 18 |
if [ "${MPIEXEC}x" != "x" ]; then |
| 19 |
TMPDIR_TAG=${TMPDIR_TAG}_mpi |
| 20 |
|
| 21 |
# https://github.com/scientificcomputing/io4dolfinx/issues/29 |
| 22 |
SKIP_TEST_LIST=("${SKIP_TEST_LIST[@]}" test_curve_mesh[10-2-float32]) |
| 23 |
fi |
| 24 |
|
| 25 |
if [[ $PETSC_DIR = *complex* ]]; then |
| 26 |
# test_xdmf_function fails with complex numbers, upstream Issue#22 |
| 27 |
SKIP_TEST_LIST=("${SKIP_TEST_LIST[@]}" test_xdmf_function) |
| 28 |
TMPDIR_TAG=${TMPDIR_TAG}_complex |
| 29 |
fi |
| 30 |
|
| 31 |
# adios2 is not well tested in bigendian systems and fails |
| 32 |
if [ ${DEB_HOST_ARCH_ENDIAN} = "big" ]; then |
| 33 |
SKIP_TEST_LIST=("${SKIP_TEST_LIST[@]}" adios) |
| 34 |
fi |
| 35 |
|
| 36 |
# specific tests may define more skips in EXTRA_SKIP_TEST_LIST (not an array) |
| 37 |
SKIP_TEST_LIST=("${SKIP_TEST_LIST[@]}" ${EXTRA_SKIP_TEST_LIST}) |
| 38 |
|
| 39 |
TEST_SELECTION="" |
| 40 |
for t in ${SKIP_TEST_LIST[@]}; do |
| 41 |
if [ "x${TEST_SELECTION}" = "x" ]; then |
| 42 |
TEST_SELECTION=$t |
| 43 |
else |
| 44 |
TEST_SELECTION="${TEST_SELECTION} or $t" |
| 45 |
fi |
| 46 |
done |
| 47 |
if [ "x${TEST_SELECTION}" != "x" ]; then |
| 48 |
TEST_SELECTION="not ( ${TEST_SELECTION} )" |
| 49 |
echo "skipping tests: ${TEST_SELECTION}" |
| 50 |
fi |
| 51 |
|
| 52 |
n_proc=`nproc` |
| 53 |
echo "${n_proc} CPUs are available" |
| 54 |
for pyver in `py3versions -sv`; do |
| 55 |
# By default, pytest tmp_path retains the temporary directory for the last 3 |
| 56 |
# pytest invocations. |
| 57 |
# Using the --basetemp option will remove the directory before every run, |
| 58 |
# effectively meaning the temporary directories of only the most recent run |
| 59 |
# will be kept. We definitely do not want to keep old runs, because they may |
| 60 |
# result in io4dolfinx trying to read in output files generated with a |
| 61 |
# different PETSc scalar type (real vs complex). |
| 62 |
#${MPIEXEC} python${pyver} -m pytest -v --basetemp=${AUTOPKGTEST_TMP}/io4dolfinx${TMPDIR_TAG}_py${pyver} --color=no -k "${TEST_SELECTION}" tests |
| 63 |
${MPIEXEC} python${pyver} -m pytest -v --basetemp=${AUTOPKGTEST_TMP}/io4dolfinx${TMPDIR_TAG}_py${pyver} --color=no tests |
| 64 |
done |