Skip to content

MPI: revamp mpi indexing for full arbitrary indexing support #675

MPI: revamp mpi indexing for full arbitrary indexing support

MPI: revamp mpi indexing for full arbitrary indexing support #675

Workflow file for this run

# Runner information:
# CPU: Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz (24 cores)
name: Examples-mpi
permissions:
contents: read
env:
OUTPUT_PATH: ${{ github.workspace }}
ENVHOME: "/home/devito/environments"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# Trigger the workflow on push or pull request, but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Examples with mpi
runs-on: ubuntu-latest
strategy:
matrix:
mpi: ['openmpi', 'intelmpi']
include:
- mpi: openmpi
mpiarg: "-n 2 --oversubscribe"
- mpi: intelmpi
mpiarg: "-n 4"
env:
DEVITO_MPI: "1"
DEVITO_LANGUAGE: "openmp"
OMP_NUM_THREADS: "2"
DEVITO_ARCH: "gcc"
CC: "gcc"
CXX: "g++"
# Make OpenMPI yield the CPU while waiting instead of busy-spinning. With
# 4 ipyparallel engines contending for cores, the point-to-point routing
# in the data notebooks otherwise livelocks under OpenMPI (IntelMPI yields
# by default, so it is unaffected and ignores this OMPI_* setting).
OMPI_MCA_mpi_yield_when_idle: "1"
steps:
- name: Checkout devito
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e ".[extras,mpi,tests]"
python3 scripts/clear_devito_cache.py
- name: Test mpi notebooks
run : |
./scripts/create_ipyparallel_mpi_profile.sh
ipcluster start --profile=mpi --engines=mpi -n 4 --daemonize
# A few seconds to ensure workers are ready
sleep 10
pytest -v --nbval examples/mpi
ipcluster stop --profile=mpi
- name: Test seismic examples
run: |
mpirun ${{ matrix.mpiarg }} \
pytest -v \
examples/seismic/tti/tti_example.py \
examples/seismic/elastic/elastic_example.py \
examples/seismic/viscoacoustic/viscoacoustic_example.py \
examples/seismic/viscoelastic/viscoelastic_example.py
- name: Test fwi examples with mpi
run: |
mpirun ${{ matrix.mpiarg }} python examples/seismic/inversion/fwi.py