Enable MPI ensemble testing for gmxapi.
[gromacs.git] / admin / ci-scripts / build-and-test-sample_restraint-2020.sh
blobfdf2d0c49c5353b28fc8627d09c1a11391b501c7
1 #!/usr/bin/env bash
3 # Build and test the sample_restraint package distributed with GROMACS 2020.
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.
13 set -ev
15 source $VENVPATH/bin/activate
17 # TODO: We should be able to just use a $GMXAPI_0_1_SDIST or venv artifact...
18 pushd python_packaging/src
19 GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
20 python -m pip install \
21 --no-cache-dir \
22 --no-deps \
23 --no-index \
24 --no-build-isolation \
26 popd
28 . $INSTALL_DIR/bin/GMXRC
29 pushd python_packaging/sample_restraint
30 mkdir build
31 pushd build
32 # TODO: Update with respect to https://redmine.gromacs.org/issues/3133
33 cmake .. \
34 -DDOWNLOAD_GOOGLETEST=ON \
35 -DGMXAPI_EXTENSION_DOWNLOAD_PYBIND=ON
36 make
38 make test
39 #TODO: Can we get ctest JUnitXML output here?
41 make install
42 popd
44 python -m pytest $PWD/tests --junitxml=$PLUGIN_TEST_XML
45 if [ -x `which mpiexec` ]; then
46 PYTHONDONTWRITEBYTECODE=1 \
47 mpiexec --allow-run-as-root \
48 --mca opal_warn_on_missing_libcuda 0 \
49 --mca orte_base_help_aggregate 0 \
50 -n 2 \
51 `which python` -m pytest \
52 -p no:cacheprovider \
53 $PWD/tests \
54 --junitxml=$PLUGIN_MPI_TEST_XML
56 popd