Skip to content

Commit

Permalink
Merge pull request GeoSymCodes#8 from GeoSymCodes/updateMaster
Browse files Browse the repository at this point in the history
Update main branch in relation to original devito
  • Loading branch information
nogueirapeterson authored Dec 29, 2023
2 parents f53e545 + 40c8c7a commit 7e493fa
Show file tree
Hide file tree
Showing 177 changed files with 7,254 additions and 4,537 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/documentation.yml

This file was deleted.

33 changes: 22 additions & 11 deletions .github/workflows/examples-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ on:
jobs:
build:
name: Examples with mpi
runs-on: ["self-hosted", "mpi", "examples"]
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"
Expand All @@ -38,18 +48,19 @@ jobs:
- 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: 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
continue-on-error: true
run : |
./scripts/create_ipyparallel_mpi_profile.sh
ipcluster start --profile=mpi --engines=mpi -n 4 --daemonize
Expand All @@ -60,11 +71,11 @@ jobs:
- 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
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/tti/tti_example.py
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/elastic/elastic_example.py
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
mpirun ${{ matrix.mpiarg }} pytest examples/seismic/viscoelastic/viscoelastic_example.py
- name: Test fwi examples with mpi
run: |
mpirun -n 4 python examples/seismic/inversion/fwi.py
mpirun ${{ matrix.mpiarg }} python examples/seismic/inversion/fwi.py
7 changes: 3 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:

- name: Install dependencies
run: |
pip install -e .[tests]
pip install matplotlib pyrevolve
pip install -e .[tests,extras]
- name: Tests in examples
run: py.test --cov --cov-config=.coveragerc --cov-report=xml examples/
run: |
py.test --cov --cov-config=.coveragerc --cov-report=xml examples/
- name: Seismic acoustic examples
run: |
Expand Down Expand Up @@ -87,7 +87,6 @@ jobs:
python examples/cfd/example_diffusion.py
- name: Upload coverage to Codecov
if: matrix.name != 'pytest-docker-py37-gcc-omp'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/pytest-core-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- main

jobs:
build:
test-mpi-basic:
name: pytest-mpi
runs-on: ubuntu-20.04
strategy:
Expand All @@ -25,6 +25,7 @@ jobs:
env:
DEVITO_LANGUAGE: "openmp"
DEVITO_ARCH: "gcc-9"
OMP_NUM_THREADS: "1"
CC: "gcc-9"
CXX: "g++-9"

Expand Down Expand Up @@ -52,3 +53,29 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: pytest-mpi

test-mpi-docker:
name: pytest-mpi
runs-on: ${{ matrix.os }}
strategy:
matrix:
name: [gcc, icx]
include:
- name: gcc
arch: gcc
os: ubuntu-latest
- name: icx
arch: icx
os: ubuntu-latest

steps:
- name: Checkout devito
uses: actions/checkout@v3

- name: Build docker image
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/bases:cpu-${{ matrix.arch }}
- name: Test with pytest
run: |
docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e OMP_NUM_THREADS=1 --name testrun devito_img pytest tests/test_mpi.py
23 changes: 13 additions & 10 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:

matrix:
name: [
pytest-ubuntu-py39-gcc11-noomp,
pytest-ubuntu-py311-gcc11-noomp,
pytest-ubuntu-py38-gcc12-omp,
pytest-ubuntu-py39-gcc7-omp,
pytest-ubuntu-py37-gcc7-omp,
pytest-ubuntu-py310-gcc10-noomp,
pytest-ubuntu-py38-gcc8-omp,
pytest-ubuntu-py39-gcc9-omp,
pytest-osx-py37-clang-omp,
]
set: [base, adjoint]
include:
- name: pytest-ubuntu-py39-gcc11-noomp
python-version: '3.9'
- name: pytest-ubuntu-py311-gcc11-noomp
python-version: '3.11'
os: ubuntu-22.04
arch: "gcc-11"
language: "C"
Expand All @@ -54,8 +54,8 @@ jobs:
language: "openmp"
sympy: "1.10"

- name: pytest-ubuntu-py39-gcc7-omp
python-version: '3.9'
- name: pytest-ubuntu-py37-gcc7-omp
python-version: '3.7'
os: ubuntu-20.04
arch: "gcc-7"
language: "openmp"
Expand All @@ -78,7 +78,7 @@ jobs:
- name: pytest-ubuntu-py39-gcc9-omp
python-version: '3.9'
os: ubuntu-20.04
arch: "gcc-9"
arch: "custom"
language: "openmp"
sympy: "1.9"

Expand Down Expand Up @@ -117,14 +117,14 @@ jobs:
- name: Set run prefix
run: |
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e DEVITO_ARCH=${{ matrix.arch }} --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
id: set-run

- name: Install ${{ matrix.arch }} compiler
if: "runner.os == 'linux' && !contains(matrix.name, 'docker')"
if: "runner.os == 'linux' && !contains(matrix.name, 'docker') && matrix.arch !='custom' "
run : |
sudo apt-get install -y ${{ matrix.arch }}
Expand All @@ -144,9 +144,12 @@ jobs:
pip install -e .[tests]
pip install sympy==${{matrix.sympy}}
- name: Check configuration
run: |
${{ env.RUN_CMD }} python3 -c "from devito import configuration; print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))"
- name: Test with pytest
run: |
${{ env.RUN_CMD }} ${{ matrix.arch }} --version
${{ env.RUN_CMD }} pytest -k "${{ matrix.test-set }}" -m "not parallel" --cov --cov-config=.coveragerc --cov-report=xml ${{ env.TESTS }}
- name: Upload coverage to Codecov
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/triggers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Master triggers

on:
push:
branches:
- master # Push events on master branch

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Trigger doc build
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEPLOY_DOC_PAT }}
repository: devitocodes/devitoproject.org
event-type: deploy-docs

- name: Trigger pro submodule update
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PRO_SUBMODULE }}
repository: devitocodespro/devitopro
event-type: update-submodule
31 changes: 15 additions & 16 deletions .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,64 +22,63 @@ jobs:
env:
DEVITO_ARCH: "${{ matrix.compiler }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
PYTHON_VERSION: "3.7"
PYTHON_VERSION: "3.9"

strategy:
# Prevent all build to stop if a single one fails
fail-fast: false
matrix:
name: [
tutos-ubuntu-gcc-py37,
tutos-osx-gcc-py37,
tutos-osx-clang-py37,
tutos-ubuntu-gcc-py39,
tutos-osx-clang-py39,
]

include:
- name: tutos-ubuntu-gcc-py37
- name: tutos-ubuntu-gcc-py39
os: ubuntu-latest
compiler: gcc
language: "openmp"

- name: tutos-osx-gcc-py37
- name: tutos-osx-clang-py39
os: macos-latest
compiler: gcc-11
language: "openmp"
compiler: clang
language: "C"

steps:
- name: Checkout devito
uses: actions/checkout@v3

- name: Set up Python 3.7
if: matrix.name != 'tutos-docker-gcc-py37'
- name: Set up Python 3.9
if: "!contains(matrix.name, 'docker')"
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9

- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: latest-stable

- name: Build docker image
if: matrix.name == 'tutos-docker-gcc-py37'
if: "contains(matrix.name, 'docker')"
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img
- name: Set run prefix
run: |
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py37' ]; then
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py39' ]; then
echo "RUN_CMD=docker run --rm --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
id: set-run

- name: Install dependencies
if: matrix.name != 'tutos-docker-gcc-py37'
if: matrix.name != 'tutos-docker-gcc-py39'
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
pip install matplotlib blosc
pip install -e .[tests,extras]
pip install blosc
- name: Seismic notebooks
run: |
Expand Down
Loading

0 comments on commit 7e493fa

Please sign in to comment.