3 # Build, install, and test the gmxapi 0.1.x Python package distributed with
6 # It is assumed that this script is run in an activated Python venv with the
7 # gmxapi dependencies already installed, with `python` resolvable by the shell
8 # to the appropriate Python interpreter.
10 # This script is intended to support automated GROMACS testing infrastructure,
11 # and may be removed without notice.
13 # WARNING: This script assumes OpenMPI mpiexec. Syntax for launch wrappers from
14 # other implementations will need different syntax, and we should get a
15 # MPIRUNNER from the environment, or something.
17 # Make sure the script errors if any commands error.
20 # Create "sdist" source distribution archive.
21 pushd python_packaging
/src
22 GMXTOOLCHAINDIR
=$INSTALL_DIR/share
/cmake
/gromacs \
24 # TODO: Identify SDIST
26 # Build and install from sdist.
27 GMXTOOLCHAINDIR
=$INSTALL_DIR/share
/cmake
/gromacs \
28 python
-m pip
install \
32 --no-build-isolation \
34 # TODO: Build and install from $SDIST instead of wildcard.
37 # Run Python unit tests.
38 python
-m pytest
$PWD/python_packaging
/src
/test --junitxml=$PY_UNIT_TEST_XML
40 # Note: Multiple pytest processes getting --junitxml output file argument
41 # may cause problems, so we set the option on only one of the launched processes.
42 # See also Multiple Instruction Multiple Data Model for OpenMPI mpirun:
43 # https://www.open-mpi.org/doc/v3.0/man1/mpiexec.1.php
44 PROGRAM
=(`which python` -m mpi4py
-m pytest \
46 $PWD/python_packaging
/src
/test)
47 # shellcheck disable=SC2068
48 if [ -x `which mpiexec` ]; then
49 PYTHONDONTWRITEBYTECODE
=1 \
50 mpiexec
--allow-run-as-root \
51 -x OMP_NUM_THREADS
=1 \
52 --mca opal_warn_on_missing_libcuda
0 \
53 --mca orte_base_help_aggregate
0 \
54 -n 1 ${PROGRAM[@]} --junitxml=$PLUGIN_MPI_TEST_XML : \
58 # Run Python acceptance tests.
59 python
-m pytest
$PWD/python_packaging
/test --junitxml=$PY_ACCEPTANCE_TEST_XML
61 # Note: Multiple pytest processes getting --junitxml output file argument
62 # may cause problems, so we set the option on only one of the launched processes.
63 # See also Multiple Instruction Multiple Data Model for OpenMPI mpirun:
64 # https://www.open-mpi.org/doc/v3.0/man1/mpiexec.1.php
65 PROGRAM
=(`which python` -m mpi4py
-m pytest \
67 $PWD/python_packaging
/test)
68 # shellcheck disable=SC2068
69 if [ -x `which mpiexec` ]; then
70 PYTHONDONTWRITEBYTECODE
=1 \
71 mpiexec
--allow-run-as-root \
72 -x OMP_NUM_THREADS
=1 \
73 --mca opal_warn_on_missing_libcuda
0 \
74 --mca orte_base_help_aggregate
0 \
75 -n 1 ${PROGRAM[@]} --junitxml=$PLUGIN_MPI_TEST_XML : \