Skip to content

Commit 7eeed11

Browse files
committed
merge conflict
2 parents 528800a + ec54928 commit 7eeed11

File tree

15 files changed

+160
-116
lines changed

15 files changed

+160
-116
lines changed

.github/workflows/core.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: Whether to run the test suite
1616
type: boolean
1717
default: true
18+
build_docs:
19+
description: Whether to build the documentation
20+
type: boolean
21+
default: true
1822
test_macos:
1923
description: Whether to test using macOS
2024
type: boolean
@@ -42,6 +46,10 @@ on:
4246
description: Whether to run the test suite
4347
type: boolean
4448
default: true
49+
build_docs:
50+
description: Whether to build the documentation
51+
type: boolean
52+
default: true
4553
test_macos:
4654
description: Whether to test using macOS
4755
type: boolean
@@ -82,7 +90,6 @@ jobs:
8290
OMP_NUM_THREADS: 1
8391
OPENBLAS_NUM_THREADS: 1
8492
FIREDRAKE_CI: 1
85-
PYOP2_CI_TESTS: 1
8693
PYOP2_SPMD_STRICT: 1
8794
# NOTE: One should occasionally update test_durations.json by running
8895
# 'make test_durations' inside a 'firedrake:latest' Docker image.
@@ -134,17 +141,6 @@ jobs:
134141
exit 1
135142
fi
136143
137-
# Raise an error if any 'TODO RELEASE' comments remain
138-
- name: Check no 'TODO RELEASE' comments (release only)
139-
if: inputs.target_branch == 'release'
140-
working-directory: firedrake-repo
141-
run: |
142-
if [ -z "$( grep -r --exclude-dir='.*' 'TODO RELEASE' )" ]; then
143-
exit 0
144-
else
145-
exit 1
146-
fi
147-
148144
- name: Install system dependencies (2)
149145
run: |
150146
apt-get -y install \
@@ -207,7 +203,7 @@ jobs:
207203
208204
: # Install from an sdist so we can make sure that it is not ill-formed
209205
pip install build
210-
python -m build ./firedrake-repo --sdist "$EXTRA_BUILD_ARGS"
206+
python -m build ./firedrake-repo --sdist $EXTRA_BUILD_ARGS
211207
212208
pip install --verbose $EXTRA_PIP_FLAGS \
213209
--no-binary h5py \
@@ -488,6 +484,7 @@ jobs:
488484
run: make lint GITHUB_ACTIONS_FORMATTING=1
489485

490486
build_docs:
487+
if: inputs.build_docs
491488
name: Build documentation
492489
runs-on: [self-hosted, Linux]
493490
container:

.github/workflows/docker.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,11 @@ jobs:
4141
matrix:
4242
os: [Linux, macOS]
4343
arch: [default, complex]
44-
platform: [linux/amd64, linux/arm64]
45-
# Cannot use inputs in exclude clauses, so add a dummy matrix dim
46-
build_dev:
47-
- ${{ inputs.build_dev }}
48-
# exclude incompatible os+platform, and only build linux dev containers
49-
exclude:
50-
- os: Linux
51-
platform: linux/arm64
52-
- os: macOS
53-
platform: linux/amd64
54-
- os: macOS
55-
build_dev: true
44+
include:
45+
- os: Linux
46+
platform: linux/amd64
47+
- os: macOS
48+
platform: linux/arm64
5649
uses: ./.github/workflows/docker_build.yml
5750
with:
5851
os: ${{ matrix.os }}

.github/workflows/release.yml

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,74 @@
11
name: Publish release
22

33
on:
4-
release:
5-
types: [released]
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: The branch to release from
8+
type: string
9+
required: true
10+
version:
11+
description: The version number to release
12+
type: string
13+
required: true
614

715
jobs:
8-
deploy:
16+
check:
17+
name: Pre-release checks
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
path: firedrake-repo
23+
ref: ${{ inputs.branch }}
24+
25+
- name: Check no 'TODO RELEASE' comments remain
26+
working-directory: firedrake-repo
27+
run: |
28+
if [ -z "$( grep -r --exclude-dir='.*' 'TODO RELEASE' )" ]; then
29+
exit 0
30+
else
31+
exit 1
32+
fi
33+
34+
- name: Check version number matches
35+
working-directory: firedrake-repo
36+
run: |
37+
if [ -z "$( grep 'version = \"${{ inputs.version }}\"' pyproject.toml )" ]; then
38+
exit 1
39+
else
40+
exit 0
41+
fi
42+
43+
pypi:
944
uses: ./.github/workflows/core.yml
45+
needs: check
1046
with:
11-
source_ref: release
47+
source_ref: ${{ inputs.branch }}
1248
target_branch: release
1349
run_tests: false
50+
build_docs: false
1451
upload_pypi: true
1552
secrets: inherit
1653

54+
github_release:
55+
name: Create GitHub release
56+
needs: pypi
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: write
60+
steps:
61+
- uses: actions/checkout@v5
62+
- name: Create release
63+
env:
64+
GH_TOKEN: ${{ github.token }}
65+
run: gh release create --title ${{ inputs.version }} --target ${{ inputs.branch }} --generate-notes ${{ inputs.version }}
66+
1767
docker:
1868
name: Build Docker containers
1969
uses: ./.github/workflows/docker.yml
70+
needs: pypi
2071
with:
21-
tag: ${{ github.ref_name }}
22-
branch: ${{ github.ref_name }}
23-
build_dev: false
72+
tag: ${{ inputs.version }}
73+
branch: ${{ inputs.branch }}
2474
secrets: inherit

demos/full_waveform_inversion/full_waveform_inversion.py.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ for 3 wave sources. Therefore, we will have 3 emsemble members, each with 2 rank
8383
processes launched by mpiexec must therefore be equal to the product of number of ensemble members
8484
(3, in this case) with the number of processes to be used for each ensemble member (``M=2``, in this case).
8585
Additional details about the ensemble parallelism can be found in the
86-
`Firedrake documentation <https://www.firedrakeproject.org/parallelism.html#ensemble-parallelism>`_.
86+
`Firedrake documentation <https://www.firedrakeproject.org/ensemble_parallelism.html>`_.
8787

8888
The subcommunicators in each ensemble member are: ``Ensemble.comm`` and ``Ensemble.ensemble_comm``.
8989
``Ensemble.comm`` is the spatial communicator. ``Ensemble.ensemble_comm`` allows communication between

docker/Dockerfile.vanilla

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,5 @@ ENV PYOP2_CFLAGS=$CFLAGS
168168

169169
# Run the smoke tests.
170170
RUN cd /opt/firedrake/ \
171-
&& firedrake-check \
171+
&& firedrake-check --mpiexec 'mpiexec --oversubscribe -n' \
172172
&& firedrake-clean

docs/source/install.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ firedrake-configure
6060
-------------------
6161

6262
To simplify the installation process, Firedrake provides a utility script called
63-
``firedrake-configure``. This script can be downloaded by executing::
63+
``firedrake-configure``. This script can be downloaded by executing:
6464

65-
$ curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/main/scripts/firedrake-configure
65+
.. only:: release
66+
67+
.. code-block:: text
68+
69+
$ curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/release/scripts/firedrake-configure
70+
71+
.. only:: main
72+
73+
.. code-block:: text
74+
75+
$ curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/main/scripts/firedrake-configure
6676
6777
Note that ``firedrake-configure`` **does not install Firedrake for you**. It
6878
is simply a helper script that emits the configuration options that Firedrake

firedrake/adjoint/ensemble_reduced_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class EnsembleReducedFunctional(AbstractReducedFunctional):
8585
The functionals :math:`J_i` and the control must be defined over a common
8686
`ensemble.comm` communicator. To understand more about how ensemble parallelism
8787
works, please refer to the `Firedrake manual
88-
<https://www.firedrakeproject.org/parallelism.html#ensemble-parallelism>`_.
88+
<https://www.firedrakeproject.org/ensemble_parallelism.html>`_.
8989
"""
9090
def __init__(self, functional, control, ensemble, scatter_control=True,
9191
gather_functional=None,

firedrake/formmanipulation.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -183,37 +183,41 @@ def matrix(self, o):
183183
bcs = ()
184184
return AssembledMatrix(tuple(args), bcs, submat)
185185

186+
def zero_base_form(self, o):
187+
return ZeroBaseForm(tuple(map(self, o.arguments())))
188+
186189
def interpolate(self, o, operand):
187190
if isinstance(operand, Zero):
188-
return ZeroBaseForm(o.arguments())
191+
return self(ZeroBaseForm(o.arguments()))
189192

190193
dual_arg, _ = o.argument_slots()
191-
V = dual_arg.function_space()
192-
if len(V) == 1 or len(dual_arg.arguments()) == 1:
194+
if len(dual_arg.arguments()) == 1 or len(dual_arg.arguments()[-1].function_space()) == 1:
195+
# The dual argument has been contracted or does not need to be split
193196
return o._ufl_expr_reconstruct_(operand, dual_arg)
194197

198+
if not isinstance(dual_arg, Coargument):
199+
raise NotImplementedError(f"I do not know how to split an Interpolate with a {type(dual_arg).__name__}.")
200+
201+
indices = self.blocks[dual_arg.number()]
202+
V = dual_arg.function_space()
203+
195204
# Split the target (dual) argument
196-
if isinstance(dual_arg, Coargument):
197-
dual_arg = self(dual_arg)
198-
indices = self.blocks[dual_arg.number()]
199-
else:
200-
raise NotImplementedError()
205+
sub_dual_arg = self(dual_arg)
206+
W = sub_dual_arg.function_space()
201207

202-
# Unflatten the expression into the target shapes
208+
# Unflatten the expression into the target shape
203209
cur = 0
204-
cindices = []
210+
components = []
205211
for i, Vi in enumerate(V):
206212
if i in indices:
207-
cindices.extend(range(cur, cur+Vi.value_size))
213+
components.extend(operand[i] for i in range(cur, cur+Vi.value_size))
208214
cur += Vi.value_size
209215

210-
W = dual_arg.function_space()
211-
components = [operand[i] for i in cindices]
212216
operand = as_tensor(numpy.reshape(components, W.value_shape))
213217
if isinstance(operand, Zero):
214-
return ZeroBaseForm(o.arguments())
218+
return self(ZeroBaseForm(o.arguments()))
215219

216-
return o._ufl_expr_reconstruct_(operand, dual_arg)
220+
return o._ufl_expr_reconstruct_(operand, sub_dual_arg)
217221

218222

219223
SplitForm = collections.namedtuple("SplitForm", ["indices", "form"])

0 commit comments

Comments
 (0)