Skip to content

Commit c51d394

Browse files
committed
Merge branch 'main' into petsc
2 parents cdb83ef + 4111ee6 commit c51d394

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4904
-176
lines changed

.github/workflows/asv.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ on:
1313
inputs:
1414
tags:
1515
description: 'Run ASV'
16-
# Trigger the workflow on push to the main branch
17-
push:
18-
branches:
19-
- main
2016

2117
jobs:
2218

.github/workflows/examples-mpi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
uses: actions/checkout@v5
5252

5353
- name: Set up Python
54-
uses: actions/setup-python@v5
54+
uses: actions/setup-python@v6
5555
with:
5656
python-version: 3.11
5757

.github/workflows/examples.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
- name: Checkout devito
3939
uses: actions/checkout@v5
4040

41+
- name: Checkout data
42+
uses: actions/checkout@v5
43+
with:
44+
repository: 'devitocodes/data'
45+
path: 'data'
46+
4147
- name: Setup conda
4248
uses: conda-incubator/setup-miniconda@v3
4349
with:
@@ -83,6 +89,13 @@ jobs:
8389
run: |
8490
python examples/cfd/example_diffusion.py
8591
92+
- name: Timestepping examples
93+
run: |
94+
python examples/timestepping/ic_superstep.py -d 1
95+
python examples/timestepping/ic_superstep.py -d 2
96+
python examples/timestepping/acoustic_superstep.py --model layered
97+
python examples/timestepping/acoustic_superstep.py --model marmousi
98+
8699
- name: Upload coverage to Codecov
87100
uses: codecov/codecov-action@v5
88101
with:

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v5
2626
- name: Set up Python 3.10
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@v6
2828
with:
2929
python-version: "3.10"
3030
- name: Install dependencies

.github/workflows/pytest-core-mpi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
RDMAV_FORK_SAFE: 1
3434

3535
steps:
36-
- uses: actions/setup-python@v5
36+
- uses: actions/setup-python@v6
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939

.github/workflows/pytest-core-nompi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131

132132
- name: Set up Python ${{ matrix.python-version }}
133133
if: "!contains(matrix.name, 'docker')"
134-
uses: actions/setup-python@v5
134+
uses: actions/setup-python@v6
135135
with:
136136
python-version: ${{ matrix.python-version }}
137137
allow-prereleases: true

.github/workflows/pythonpublish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v5
1212
- name: Set up Python
13-
uses: actions/setup-python@v5
13+
uses: actions/setup-python@v6
1414
with:
1515
python-version: '3.x'
1616
- name: Install dependencies

.github/workflows/tutorials.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Set up Python ${{ matrix.pyver }}
6262
if: "!contains(matrix.name, 'docker')"
63-
uses: actions/setup-python@v5
63+
uses: actions/setup-python@v6
6464
with:
6565
python-version: ${{ matrix.pyver }}
6666

@@ -144,3 +144,7 @@ jobs:
144144
- name: ABC Notebooks
145145
run: |
146146
${{ env.RUN_CMD }} py.test --nbval examples/seismic/abc_methods
147+
148+
- name: Timestepping Notebooks
149+
run: |
150+
${{ env.RUN_CMD }} py.test --nbval examples/timestepping

conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pytest
66
from sympy import Add
7+
from sympy.printing import sstr
78

89
from devito import Eq, configuration, Revolver # noqa
910
from devito.checkpointing import NoopRevolver
@@ -294,6 +295,20 @@ def pytest_runtest_makereport(item, call):
294295
result.outcome = 'passed'
295296

296297

298+
def pytest_make_parametrize_id(config, val, argname):
299+
"""
300+
Prevents pytest from making obscure parameter names (param0, param1, ...)
301+
and default to sympy.sstr(val) instead for better log readability.
302+
"""
303+
# First see if it has a name
304+
if hasattr(val, '__name__'):
305+
return val.__name__
306+
try:
307+
return sstr(val)
308+
except Exception:
309+
return None # Fall back to default behavior
310+
311+
297312
# A list of optimization options/pipelines to be used in testing
298313
# regarding spatial and/or temporal blocking.
299314
opts_tiling = ['advanced',

devito/arch/compiler.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def __init__(self):
180180
"""
181181

182182
fields = {'cc', 'ld'}
183+
linker_opt = '-Wl,'
183184
_default_cpp = False
184185
_cxxstd = 'c++14'
185186
_cstd = 'c99'
@@ -290,6 +291,22 @@ def load(self, soname):
290291
"""
291292
return npct.load_library(str(self.get_jit_dir().joinpath(soname)), '.')
292293

294+
def save_header(self, filename, code):
295+
"""
296+
Store some source code into a header file within the same temporary directory
297+
used for JIT compilation.
298+
299+
Parameters
300+
----------
301+
filename : str
302+
The name of the header file (w/o the suffix).
303+
code : str
304+
The source code to be stored.
305+
"""
306+
hfile = self.get_jit_dir().joinpath(filename).with_suffix('.h')
307+
with open(str(hfile), 'w') as f:
308+
f.write(code)
309+
293310
def save(self, soname, binary):
294311
"""
295312
Store a binary into a file within a temporary directory.
@@ -425,7 +442,7 @@ def add_library_dirs(self, dirs, rpath=False):
425442
if rpath:
426443
# Add rpath flag to embed library dir
427444
for d in as_list(dirs):
428-
self.ldflags.append(f'-Wl,-rpath,{d}')
445+
self.ldflags.append(f'{self.linker_opt}-rpath,{d}')
429446

430447
def add_libraries(self, libs):
431448
self.libraries = filter_ordered(self.libraries + as_list(libs))
@@ -662,6 +679,7 @@ def __lookup_cmds__(self):
662679
class CudaCompiler(Compiler):
663680

664681
_default_cpp = True
682+
linker_opt = "--linker-options="
665683

666684
def __init_finalize__(self, **kwargs):
667685

0 commit comments

Comments
 (0)