3 # Build and test the sample_restraint package distributed with GROMACS 2022.
5 # This script is intended to support automated GROMACS testing infrastructure,
6 # and may be removed without notice.
8 # WARNING: This script assumes OpenMPI mpiexec. Syntax for launch wrappers from
9 # other implementations will need different syntax, and we should get a
10 # MPIRUNNER from the environment, or something.
12 # Make sure the script errors if any commands error.
15 pushd python_packaging/src
16 # Build and install gmxapi python package from local source.
17 # Note that tool chain may be provided differently across GROMACS versions.
18 if [ "2022" -eq "$GROMACS_MAJOR_VERSION" ]; then
19 GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
20 python -m pip install \
24 --no-build-isolation \
26 # TODO: Get sdist artifact for other gmxapi versions.
27 # elif [ "2021" -eq "$GROMACS_MAJOR_VERSION" ]; then
28 # GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
29 # python -m pip install \
33 # --no-build-isolation \
36 echo "Logic error in GROMACS version handling."
41 . $INSTALL_DIR/bin/GMXRC
42 pushd python_packaging/sample_restraint
45 # TODO: Update with respect to https://gitlab.com/gromacs/gromacs/-/issues/3133
47 -DDOWNLOAD_GOOGLETEST=ON \
48 -DGMXAPI_EXTENSION_DOWNLOAD_PYBIND=ON
52 #TODO: Can we get ctest JUnitXML output here?
57 python -m pytest $PWD/tests --junitxml=$PLUGIN_TEST_XML --threads=2
59 # Note: Multiple pytest processes getting --junitxml output file argument
60 # may cause problems, so we set the option on only one of the launched processes.
61 # See also Multiple Instruction Multiple Data Model for OpenMPI mpirun:
62 # https://www.open-mpi.org/doc/v3.0/man1/mpiexec.1.php
63 PROGRAM=(`which python` -m mpi4py -m pytest \
67 # shellcheck disable=SC2068
68 if [ -x `which mpiexec` ]; then
69 PYTHONDONTWRITEBYTECODE=1 \
70 mpiexec --allow-run-as-root \
71 -x OMP_NUM_THREADS=1 \
72 --mca opal_warn_on_missing_libcuda 0 \
73 --mca orte_base_help_aggregate 0 \
74 -n 1 ${PROGRAM[@]} --junitxml=$PLUGIN_MPI_TEST_XML : \