Skip to content

examples: give each MPI rank its own JAX device for the subspace expansion #133

examples: give each MPI rank its own JAX device for the subspace expansion

examples: give each MPI rank its own JAX device for the subspace expansion #133

name: Tests
on:
push:
branches:
- main
- 'stable/**'
pull_request:
branches:
- main
- 'stable/**'
schedule:
- cron: '0 1 * * *'
jobs:
tests:
name: latest version tests (${{ matrix.os }}, ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
# Keep going after one cell fails, so a macOS-only or version-only break is
# visible as exactly that rather than masking the rest of the matrix.
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
with:
# The reference energies the tests check against come from data in the
# vendored upstream checkout, and setup.py needs its headers to compile.
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install MPI and BLAS (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libopenmpi-dev openmpi-bin libopenblas-dev
- name: Install MPI and BLAS (macOS)
if: runner.os == 'macOS'
# libomp on top of the Linux set: Apple clang ships without OpenMP, which the
# CPU extension needs. openblas is present on the runner images but keg-only,
# so setup.py locates it under `brew --prefix` rather than expecting it on the
# default library path.
run: |
brew install open-mpi libomp openblas
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test using tox environments
shell: bash
# One invocation rather than several, so that the extension is compiled once and
# the resulting wheel is installed into each environment. Running them as
# separate commands would compile it once per environment.
#
# Not --parallel: the environments would then race to install the same wheel,
# and the MPI tests want the runner's cores to themselves.
run: |
tox -e py,notebook,mpi