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 \
23 # TODO: Get sdist artifact for other gmxapi versions.
24 # elif [ "2021" -eq "$GROMACS_MAJOR_VERSION" ]; then
25 # GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
26 # python -m pip install \
32 echo "Logic error in GROMACS version handling."
37 . $INSTALL_DIR/bin/GMXRC
38 pushd python_packaging/sample_restraint
41 # TODO: Update with respect to https://gitlab.com/gromacs/gromacs/-/issues/3133
43 -DPYTHON_EXECUTABLE=`which python` \
44 -DDOWNLOAD_GOOGLETEST=ON \
45 -DGMXAPI_EXTENSION_DOWNLOAD_PYBIND=ON
48 #TODO: Can we get ctest JUnitXML output here?
53 python -m pytest $PWD/tests --junitxml=$PLUGIN_TEST_XML --threads=2
55 # Note: Multiple pytest processes getting --junitxml output file argument
56 # may cause problems, so we set the option on only one of the launched processes.
57 # See also Multiple Instruction Multiple Data Model for OpenMPI mpirun:
58 # https://www.open-mpi.org/doc/v3.0/man1/mpiexec.1.php
59 PROGRAM=(`which python` -m mpi4py -m pytest \
63 # shellcheck disable=SC2068
64 if [ -x `which mpiexec` ]; then
65 PYTHONDONTWRITEBYTECODE=1 \
66 mpiexec --allow-run-as-root \
67 -x OMP_NUM_THREADS=1 \
68 --mca opal_warn_on_missing_libcuda 0 \
69 --mca orte_base_help_aggregate 0 \
70 -n 1 ${PROGRAM[@]} --junitxml=$PLUGIN_MPI_TEST_XML : \