Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
self-hosted-runner:
labels:
- asv
- amdgpu
- nvidiagpu
6 changes: 3 additions & 3 deletions .github/workflows/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:

- name: Set VIRTUAL_ENV
run: |
echo "VIRTUAL_ENV=$ENVHOME/asv" >> $GITHUB_ENV
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV
echo "VIRTUAL_ENV=$ENVHOME/asv" >> "$GITHUB_ENV"
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> "$GITHUB_ENV"

- name: Set PATH
run: |
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> "$GITHUB_ENV"

- name: Install dependencies
run: |
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docker-bases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ jobs:
TAG_BASE: ${{ format('cpu-gcc{0}', matrix.gcc) }}
run: |
docker buildx imagetools create \
--tag devitocodes/bases:${TAG_BASE} \
devitocodes/bases:${TAG_BASE}-amd64 \
devitocodes/bases:${TAG_BASE}-arm64
docker buildx imagetools inspect devitocodes/bases:${TAG_BASE}
--tag "devitocodes/bases:${TAG_BASE}" \
"devitocodes/bases:${TAG_BASE}-amd64" \
"devitocodes/bases:${TAG_BASE}-arm64"
docker buildx imagetools inspect "devitocodes/bases:${TAG_BASE}"

#######################################################
############## Intel OneApi CPU #######################
Expand Down Expand Up @@ -296,10 +296,10 @@ jobs:
FINAL_TAG: ${{ matrix.final_tag }}
run: |
docker buildx imagetools create \
--tag devitocodes/bases:${FINAL_TAG} \
devitocodes/bases:${FINAL_TAG}-amd64 \
devitocodes/bases:${FINAL_TAG}-arm64
docker buildx imagetools inspect devitocodes/bases:${FINAL_TAG}
--tag "devitocodes/bases:${FINAL_TAG}" \
"devitocodes/bases:${FINAL_TAG}-amd64" \
"devitocodes/bases:${FINAL_TAG}-arm64"
docker buildx imagetools inspect "devitocodes/bases:${FINAL_TAG}"

#######################################################
##################### AMD #############################
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker-devito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:

- name: Set per‑runner variables
run: |
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> "$GITHUB_ENV"

- name: Check event name
run: echo ${{ github.event_name }}
Expand Down Expand Up @@ -246,8 +246,8 @@ jobs:
refs="$refs devitocodes/devito:${tag}-${arch}"
done
echo "Creating manifest for devitocodes/devito:${tag} using:${refs}"
docker buildx imagetools create --tag devitocodes/devito:${tag} $refs
docker buildx imagetools inspect devitocodes/devito:${tag}
docker buildx imagetools create --tag "devitocodes/devito:${tag}" "$refs"
docker buildx imagetools inspect "devitocodes/devito:${tag}"
done

test-devito:
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:

- name: Set per‑runner variables
run: |
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> "$GITHUB_ENV"

- name: Run tests against multi-arch image
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .[extras,mpi,tests]
pip install -e ".[extras,mpi,tests]"
python3 scripts/clear_devito_cache.py

- name: Test mpi notebooks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}
name: Examples
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
name: "Spellcheck everything"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
Expand All @@ -69,7 +69,7 @@ jobs:
# #example-error-annotation-on-github-actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Check workflow files
uses: docker://rhysd/actionlint:latest
with:
Expand All @@ -81,9 +81,9 @@ jobs:
container:
image: hadolint/hadolint:latest-alpine
env:
HADOLINT_IGNORE: "DL3005,DL3007,DL3008,DL3015,DL3059"
HADOLINT_IGNORE: "DL3003,DL3004,DL3005,DL3007,DL3008,DL3009,DL3013,DL3015,DL3042,DL3059,SC2103,SC2046,SC2086"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Lint dockerfiles inside hadolint container
run: |
for DOCKERFILE in docker/Dockerfile.*; \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ jobs:
- name: Set run prefix
run: |
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
echo "RUN_CMD=docker run --init -t --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --init -t --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> "$GITHUB_ENV"
else
echo "RUN_CMD=" >> $GITHUB_ENV
echo "RUN_CMD=" >> "$GITHUB_ENV"
fi
id: set-run

Expand All @@ -168,7 +168,7 @@ jobs:
run : |
if [ "${{ runner.os }}" == 'macOS' ]; then
brew install llvm libomp
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH"
fi
id: set-tests

Expand All @@ -178,14 +178,14 @@ jobs:
major=${ver%%.*}
minor=${ver#*.}; minor=${minor%%.*}
if [ "$major" -eq 3 ] && [ "$minor" -ge 12 ]; then
echo "PIPFLAGS='--break-system-packages'" >> $GITHUB_ENV
echo "PIPFLAGS='--break-system-packages'" >> "$GITHUB_ENV"
fi

- name: Install dependencies
if: "!contains(matrix.name, 'docker')"
run: |
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
python3 -m pip install ${{ env.PIPFLAGS }} -e .[tests,extras]
python3 -m pip install ${{ env.PIPFLAGS }} -e ".[tests,extras]"
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}

- name: Check Docker image Python version
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:

- name: Set per-runner tags
run: |
echo "DOCKER_IMAGE=${{ matrix.name }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
echo "CONTAINER_BASENAME=testrun-${{ matrix.name }}-${RUNNER_NAME// /_}-${{ github.sha }}" >> $GITHUB_ENV
echo "DOCKER_IMAGE=${{ matrix.name }}-${RUNNER_NAME// /_}" >> "$GITHUB_ENV"
echo "CONTAINER_BASENAME=testrun-${{ matrix.name }}-${RUNNER_NAME// /_}-${{ github.sha }}" >> "$GITHUB_ENV"

- name: Ensure buildx builder
run: |
Expand All @@ -93,7 +93,7 @@ jobs:
docker buildx build . \
--builder "${RUNNER_NAME// /_}" \
--load \
--label ci-run=$GITHUB_RUN_ID \
--label ci-run="$GITHUB_RUN_ID" \
--rm --pull \
--file docker/Dockerfile.devito \
--tag "${DOCKER_IMAGE}" \
Expand All @@ -107,7 +107,7 @@ jobs:
# Make sure CUDA_VISIBLE_DEVICES is at least *something* on NVIDIA
# runners; fall back to "all" so the driver probe does not fail.
if [[ "${{ matrix.runner_label }}" == "nvidiagpu" && -z "${CUDA_VISIBLE_DEVICES:-}" ]]; then
echo "CUDA_VISIBLE_DEVICES=all" >> $GITHUB_ENV
echo "CUDA_VISIBLE_DEVICES=all" >> "$GITHUB_ENV"
fi

# Run a simple driver-probe command (nvidia-smi / rocm-smi)
Expand All @@ -124,7 +124,7 @@ jobs:

# Run the test suite using the matrix-defined flags
docker run ${{ matrix.flags }} \
${ci_env} \
"${ci_env}" \
-e CI=true \
-e PYTHONFAULTHANDLER=1 \
-e DEVITO_LOGGING=DEBUG \
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
docker rmi -f "${DOCKER_IMAGE}" || true

# Classic image layers created in this job
docker image prune -f --filter label=ci-run=$GITHUB_RUN_ID
docker image prune -f --filter label=ci-run="$GITHUB_RUN_ID"

# BuildKit cache: target the per-runner builder explicitly
docker builder prune --builder "${RUNNER_NAME// /_}" \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ jobs:
- name: Set run prefix
run: |
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py310' ]; then
echo "RUN_CMD=docker run --init -t --rm --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --init -t --rm --name testrun devito_img" >> "$GITHUB_ENV"
else
echo "RUN_CMD=" >> $GITHUB_ENV
echo "RUN_CMD=" >> "$GITHUB_ENV"
fi
id: set-run

- name: Install dependencies
if: matrix.name != 'tutos-docker-gcc-py310'
run: |
python -m pip install --upgrade pip
pip install -e .[tests,extras]
pip install -e ".[tests,extras]"
pip install blosc

- name: Check Docker image Python version
Expand Down
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ repos:
hooks:
# Run isort to check only (don't modify files)
- id: isort
args: [ --check-only ]
args: [--check-only, --filter-files]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.4
hooks:
# Run the linter to check only (don't modify files)
- id: ruff-check
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies: [flake8-pyproject]
- repo: https://github.com/crate-ci/typos
rev: v1.39.1
hooks:
Expand All @@ -33,3 +38,4 @@ repos:
rev: v2.12.0
hooks:
- id: hadolint-docker
entry: -e HADOLINT_IGNORE=DL3003,DL3004,DL3005,DL3007,DL3008,DL3009,DL3013,DL3015,DL3042,DL3059,SC2103,SC2046,SC2086 ghcr.io/hadolint/hadolint hadolint
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Focus on modeling and math — Devito handles the performance.


## What Devito is not
As is hopefully implied by the preceeding section, Devito is *not* a seismic modelling or imaging framework, nor is it a set of pre-baked solvers. Whilst Devito is often associated with seismic imaging, this is just one application domain. Our RTM and FWI examples use Devito under the hood, but the engine itself is physics-agnostic. There’s no built-in assumption about waves, seismics, or domains — you provide the physics, and Devito delivers efficient, architecture-aware implementations.
As is hopefully implied by the preceding section, Devito is *not* a seismic modelling or imaging framework, nor is it a set of pre-baked solvers. Whilst Devito is often associated with seismic imaging, this is just one application domain. Our RTM and FWI examples use Devito under the hood, but the engine itself is physics-agnostic. There’s no built-in assumption about waves, seismics, or domains — you provide the physics, and Devito delivers efficient, architecture-aware implementations.

Furthermore, the examples provided with Devito are often conflated with the core DSL and compiler. However, the purpose of this collection of tutorials, code samples, and helper functions is fourfold:

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/regression/benchmarks/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class Processing:
def setup(self):
grid = Grid(shape=(5, 5, 5))

funcs = [Function(name='f%d' % n, grid=grid) for n in range(30)]
tfuncs = [TimeFunction(name='u%d' % n, grid=grid) for n in range(30)]
stfuncs = [SparseTimeFunction(name='su%d' % n, grid=grid, npoint=1, nt=100)
funcs = [Function(name=f'f{n}', grid=grid) for n in range(30)]
tfuncs = [TimeFunction(name=f'u{n}', grid=grid) for n in range(30)]
stfuncs = [SparseTimeFunction(name=f'su{n}', grid=grid, npoint=1, nt=100)
for n in range(30)]
v = TimeFunction(name='v', grid=grid, space_order=2)

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/user/advisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We recommend going through tutorial [02_advisor_roofline.ipynb](https://github.c
* Support is guaranteed only for Intel oneAPI 2025; earlier versions may not work.
You may download Intel oneAPI [here](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?packages=oneapi-toolkit&oneapi-toolkit-os=linux&oneapi-lin=apt).

* Add Advisor (advixe-cl) and compilers (icx) in the path. The right env variables should be sourced along the lines of (depending on your isntallation folder):
* Add Advisor (advixe-cl) and compilers (icx) in the path. The right env variables should be sourced along the lines of (depending on your installation folder):
```sh
source /opt/intel/oneapi/advisor/latest/env/vars.sh
source /opt/intel/oneapi/compiler/latest/env/vars.sh
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/user/advisor/advisor_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ def check(cond, msg):


def err(msg):
print('\033[1;37;31m%s\033[0m' % msg) # print in RED
print(f'\033[1;37;31m{msg}\033[0m') # print in RED


def log(msg):
print('\033[1;37;32m%s\033[0m' % msg) # print in GREEN
print(f'\033[1;37;32m{msg}\033[0m') # print in GREEN


@contextmanager
def progress(msg):
print('\033[1;37;32m%s ... \033[0m' % msg, end='', flush=True) # print in GREEN
print(f'\033[1;37;32m{msg} ... \033[0m', end='', flush=True) # print in GREEN
yield
print('\033[1;37;32m%s\033[0m' % 'Done!')
print('\033[1;37;32m{}\033[0m'.format('Done!'))


def log_process(process, logger):
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/user/advisor/roofline.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def roofline(name, project, scale, precision, mode, th):
log(f'\nFigure saved in {figpath}{name}.pdf.')

# Save the JSON file
with open('%s.json' % name, 'w') as f:
with open(f'{name}.json', 'w') as f:
f.write(json.dumps(roofline_data))

log(f'\nJSON file saved as {name}.json.')
Expand Down
7 changes: 3 additions & 4 deletions benchmarks/user/advisor/run_advisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,16 @@ def run_with_advisor(path, output, name, exec_args):
# Before collecting the `survey` and `tripcounts` a "pure" python run
# to warmup the jit cache is preceded

log('Starting Intel Advisor\'s `roofline` analysis for `%s`' % name)
log(f'Starting Intel Advisor\'s `roofline` analysis for `{name}`')
dt = datetime.datetime.now()

# Set up a file logger that will track the output of the advisor profiling
advixe_logger = logging.getLogger('run_advisor_logger')
advixe_logger.setLevel(logging.INFO)

advixe_formatter = logging.Formatter('%(asctime)s: %(message)s')
logger_datetime = '%d.%d.%d.%d.%d.%d' % (dt.year, dt.month,
dt.day, dt.hour, dt.minute, dt.second)
advixe_handler = logging.FileHandler('%s/%s_%s.log' % (output, name, logger_datetime))
logger_datetime = f'{dt.year}.{dt.month}.{dt.day}.{dt.hour}.{dt.minute}.{dt.second}'
advixe_handler = logging.FileHandler(f'{output}/{name}_{logger_datetime}.log')
advixe_handler.setFormatter(advixe_formatter)
advixe_logger.addHandler(advixe_handler)

Expand Down
Loading