Skip to content

Merge pull request #2177 from devitocodes/pytest-fix #3771

Merge pull request #2177 from devitocodes/pytest-fix

Merge pull request #2177 from devitocodes/pytest-fix #3771

Workflow file for this run

# Runner information:
# CPU: Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz (24 cores)
name: Examples-mpi
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 master branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Examples with mpi
runs-on: ["self-hosted", "mpi", "examples"]
env:
DEVITO_MPI: "1"
DEVITO_LANGUAGE: "openmp"
OMP_NUM_THREADS: "2"
DEVITO_ARCH: "gcc"
CC: "gcc"
CXX: "g++"
steps:
- name: Checkout devito
uses: actions/checkout@v3
- name: Set environment
run: |
source $ENVHOME/devito-cpu-mpi/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .[extras,mpi,tests]
- 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 20
py.test --nbval examples/mpi
ipcluster stop --profile=mpi
- name: Test seismic examples
run: |
mpirun -n 4 pytest examples/seismic/tti/tti_example.py
mpirun -n 4 pytest examples/seismic/elastic/elastic_example.py
mpirun -n 4 pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
mpirun -n 4 pytest examples/seismic/viscoelastic/viscoelastic_example.py
- name: Test fwi examples with mpi
run: |
mpirun -n 4 python examples/seismic/inversion/fwi.py