Skip to content

Commit

Permalink
misc: fix switchconfig bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Aug 8, 2023
1 parent 8a04203 commit 3b9091a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/examples-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
matrix:
mpi: ['openmpi', 'intelmpi']

include:
- mpi: openmpi
mpiarg: "-n 2 --oversubscribe"

- mpi: intelmpi
mpiarg: "-n 4"

env:
DEVITO_MPI: "1"
DEVITO_LANGUAGE: "openmp"
Expand All @@ -52,6 +59,7 @@ jobs:
pip install -e .[extras,mpi,tests]
- 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 @@ -62,11 +70,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
2 changes: 1 addition & 1 deletion devito/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def __enter__(self, condition=True, **params):
def __exit__(self, exc_type, exc_val, exc_tb):
for k, v in self.params.items():
try:
configuration.update(k, self.previous[k])
configuration[k] = self.previous[k]
except ValueError:
# E.g., `platform` and `compiler` will end up here
super(Parameters, configuration).__setitem__(k, self.previous[k])
Expand Down

0 comments on commit 3b9091a

Please sign in to comment.