Skip to content

Commit 71b57a3

Browse files
committed
misc: Clean up
1 parent 4326bf9 commit 71b57a3

5 files changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/docker-petsc.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
# Use buildkit
1818
DOCKER_BUILDKIT: "1"
1919

20+
PETSC_REPO: https://gitlab.com/ZoeLeibowitz/petsc.git
21+
PETSC_BRANCH: zoe/feature-da-section-sf
22+
2023
steps:
2124
- name: Checkout devito
2225
uses: actions/checkout@v5
@@ -39,10 +42,13 @@ jobs:
3942
context: .
4043
file: docker/Dockerfile.petsc
4144
push: true
45+
platforms: linux/amd64
4246
tags: |
4347
devitocodes/devito-petsc:petscsection
44-
build-args: base=devitocodes/devito:gcc-dev-amd64
45-
platforms: linux/amd64
48+
build-args: |
49+
base=devitocodes/devito:gcc-dev-amd64
50+
PETSC_REPO=${{ env.PETSC_REPO }}
51+
PETSC_BRANCH=${{ env.PETSC_BRANCH }}
4652
4753
- name: Remove dangling layers
4854
run: docker system prune -f

.github/workflows/pytest-petsc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ jobs:
4848

4949
- name: Build docker image
5050
run: |
51-
docker build -f docker/Dockerfile.petsc --tag devito_petsc_image:test .
51+
docker build \
52+
-f docker/Dockerfile.petsc \
53+
--build-arg PETSC_REPO=https://gitlab.com/ZoeLeibowitz/petsc.git \
54+
--build-arg PETSC_BRANCH=zoe/feature-da-section-sf \
55+
--tag devito_petsc_image:test .
5256
5357
- name: Set run prefix
5458
run: |

devito/petsc/equations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def lower_exprs_petsc(expressions, **kwargs):
1313

14-
# Process `ConstrainBC` equations
14+
# Process `ConstrainBC` equations
1515
expressions = constrain_essential_bcs(expressions, **kwargs)
1616

1717
return expressions

docker/Dockerfile.petsc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
##############################################################
44

55
ARG base=devitocodes/devito:gcc-dev-amd64
6+
ARG PETSC_REPO=https://gitlab.com/petsc/petsc.git
7+
ARG PETSC_BRANCH=v3.24.0
68

79
FROM $base
810

11+
ARG PETSC_REPO
12+
ARG PETSC_BRANCH
13+
914
USER root
1015

1116
RUN python3 -m venv /venv && \
1217
mkdir -p /opt/petsc && \
1318
cd /opt/petsc && \
14-
git clone -b v3.24.0 https://gitlab.com/petsc/petsc.git petsc && \
19+
git clone -b ${PETSC_BRANCH} ${PETSC_REPO} petsc && \
1520
cd petsc && \
1621
./configure --with-fortran-bindings=0 --with-mpi-dir=/opt/openmpi \
1722
--with-openblas-include=$(pkg-config --variable=includedir openblas) \

tests/test_petsc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,8 +2264,8 @@ def _get_loop_bounds(self, shape, so, subdomain):
22642264

22652265
bounds = []
22662266
for _, dim in enumerate(grid.dimensions):
2267-
ub = max(args[f'i{dim.name}_min0'], args[f'{dim.name}_m'] - so)
2268-
lb = min(args[f'i{dim.name}_max0'], args[f'{dim.name}_M'] + so)
2267+
lb = max(args[f'i{dim.name}_min0'], args[f'{dim.name}_m'] - so)
2268+
ub = min(args[f'i{dim.name}_max0'], args[f'{dim.name}_M'] + so)
22692269
bounds.append((lb, ub))
22702270

22712271
return rank, tuple(bounds)

0 commit comments

Comments
 (0)