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
1 change: 1 addition & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ runs:
EXTRA_PIP_FLAGS='--no-build-isolation'
elif [ ${{ inputs.base_ref }} = 'release' ]; then
EXTRA_PIP_FLAGS=''
export PIP_BUILD_CONSTRAINT=constraints.txt
else
echo "Unrecognised 'base_ref' input: '${{ inputs.base_ref }}"
exit 1
Expand Down
319 changes: 134 additions & 185 deletions AGENTS.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Ed Bueler

Henrik Buesing

Anastasia Chanbour

Justin Chang

Cyrus Cheng
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ copy_notebooks:
source/element_list.csv: source/element_list.py
cd source; python3 element_list.py

source/team.rst: source/team2.py
source/team.rst: source/team2.py source/team.ini
cd source; python3 team2.py; mv AUTHORS.rst ../..

source/apt_deps.txt:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/firedrake_19.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ presenters.
* Colin Cotter: `Time (integrator) parallel exponential integration
and phase-averaging for geophysical fluid dynamics
<_static/firedrake19-slides/cotter.pdf>`__
* Matt Knepley: `Understanding multivariate computation using the
Kolmogorov superposition theorem <https://cse.buffalo.edu/~knepley/presentations/PresFiredrake2019.pdf>`_
* Matt Knepley: Understanding multivariate computation using the
Kolmogorov superposition theorem
* Lawrence Mitchell: `PCPATCH: topological construction of multigrid
relaxation methods <_static/firedrake19-slides/mitchell.pdf>`__
* Joe Wallwork: `Anisotropic goal-oriented mesh adaptation in
Expand Down
Binary file added docs/source/images/anastasiachanbour.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/team.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Daiane I. Dolci:
Joshua Hope-Collins: https://www.imperial.ac.uk/people/joshua.hope-collins13
Umberto Zerbinati: https://www.uzerbinati.eu
Leo Collins:
Anastasia Chanbour:

[inactive-team]
Lawrence Mitchell: https://www.wence.uk/
Expand Down
9 changes: 8 additions & 1 deletion firedrake/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,14 @@ def parloops(self, tensor):
if hasattr(self, "_parloops"):
for (lknl, _), parloop in zip(self.local_kernels, self._parloops):
data = self._as_pyop2_type(tensor, lknl.indices)
parloop.arguments[0].data = data
if isinstance(data, op2.Global):
# In parloops we swap out globals with private ones so
# increments don't double add. The right attribute to swap
# out here is therefore reduced_globals instead of arguments.
tmp = parloop.arguments[0].data
parloop.reduced_globals[tmp] = op2.GlobalParloopArg(data)
else:
parloop.arguments[0].data = data

else:
# Make parloops for one concrete output tensor and cache them.
Expand Down
12 changes: 9 additions & 3 deletions firedrake/supermeshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pathlib
import libsupermesh
import petsctools
import rtree

from firedrake.cython.supermeshimpl import assemble_mixed_mass_matrix as ammm, intersection_finder
from firedrake.mg.utils import get_level
Expand Down Expand Up @@ -462,9 +463,14 @@ def likely(cell_A):

libsupermesh_dir = pathlib.Path(libsupermesh.get_include()).parent.absolute()
dirs = petsctools.get_petsc_dirs() + (libsupermesh_dir,)
includes = ["-I%s/include" % d for d in dirs]
libs = ["-L%s/lib" % d for d in dirs]
libs = libs + ["-Wl,-rpath,%s/lib" % d for d in dirs] + ["-lpetsc", "-lsupermesh"]
includes = [f"-I{d}/include" for d in dirs]
libs = [
*[f"-L{d}/lib" for d in dirs],
*[f"-Wl,-rpath,{d}/lib" for d in dirs],
"-lpetsc",
"-lsupermesh",
str(pathlib.Path(rtree.core.rt._name).absolute()), # libspatialindex.so
]
dll = load(
supermesh_kernel_str, "c",
cppargs=includes,
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ dependencies = [
"h5py>3.12.1",
"firedrake-rtree>=2026.2.0",
"immutabledict",
"libsupermesh>=2026.0",
# TODO RELEASE
"libsupermesh @ git+https://github.com/firedrakeproject/libsupermesh.git@main",
"loopy>2024.1",
"numpy",
"packaging",
Expand All @@ -41,6 +42,7 @@ dependencies = [
"pycparser",
"pytools[siphash]",
"requests",
"rtree",
"scipy",
"sympy",
"islpy<2026.2",
Expand Down Expand Up @@ -159,7 +161,8 @@ docker = [ # Used in firedrake-vanilla container
requires = [
"Cython>=3.0",
"firedrake-rtree>=2026.2.0",
"libsupermesh>=2026.0",
# TODO RELEASE
"libsupermesh @ git+https://github.com/firedrakeproject/libsupermesh.git@main",
"mpi4py>3; python_version >= '3.13'",
"mpi4py; python_version < '3.13'",
"numpy",
Expand All @@ -169,6 +172,7 @@ requires = [
"pkgconfig",
"pybind11",
"setuptools>=77.0.3",
"rtree",
]
build-backend = "setuptools.build_meta"

Expand Down
4 changes: 3 additions & 1 deletion requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Core build dependencies (adapted from pyproject.toml)
Cython>=3.0
firedrake-rtree>=2026.2.0
libsupermesh>=2026.0
# TODO RELEASE
libsupermesh @ git+https://github.com/firedrakeproject/libsupermesh.git@main
mpi4py>3; python_version >= '3.13'
mpi4py; python_version < '3.13'
numpy
pkgconfig
petsctools
pybind11
setuptools>=77.0.3
rtree

# Transitive build dependencies
hatchling
Expand Down
16 changes: 15 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import libsupermesh
import firedrake_rtree
import rtree
import numpy as np
import pybind11
import petsctools
Expand Down Expand Up @@ -138,6 +139,19 @@ def __getitem__(self, key):
],
)

# libspatialindex
# example:
# gcc -I/rtree/include
# gcc /rtree.libs/libspatialindex.so -Wl,-rpath,$ORIGIN/../../Rtree.libs
libspatialindex_so = Path(rtree.core.rt._name).absolute()
spatialindex_ = ExternalDependency(
include_dirs=[rtree.finder.get_include()],
extra_link_args=[str(libspatialindex_so)],
runtime_library_dirs=[
os.path.join(dir, "Rtree.libs") for dir in sitepackage_dirs
],
)

# libsupermesh
# example:
# gcc -Ipath/to/libsupermesh/include
Expand Down Expand Up @@ -205,7 +219,7 @@ def extensions():
name="firedrake.cython.supermeshimpl",
language="c",
sources=[os.path.join("firedrake", "cython", "supermeshimpl.pyx")],
**(mpi_ + petsc_ + numpy_ + libsupermesh_)
**(mpi_ + petsc_ + numpy_ + libsupermesh_ + spatialindex_)
))
# pyop2/sparsity.pyx: petsc, numpy,
cython_list.append(Extension(
Expand Down
20 changes: 20 additions & 0 deletions tests/firedrake/regression/test_real_space.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import pytest_mpi
import numpy as np

from firedrake import *
Expand Down Expand Up @@ -428,3 +429,22 @@ def test_real_space_hex():
assert np.allclose(val.dat.data_ro, [2.])
val = assemble(inner(r, TestFunction(DG)) * dx)
assert np.allclose(val.dat.data, [1., 1.])


@pytest.mark.parallel
def test_real_space_repeated_assembly():
"""Test that repeated assembly of the same form works in parallel.

This test is of particular importance to the Real space because Real
functions are globals and this can lead to problems with halo
increments.

"""
mesh = UnitSquareMesh(3, 3)
R = FunctionSpace(mesh, "R", 0)
q = TestFunction(R)

form = q*dx + q*ds # area + perimeter of the unit square = 1 + 4 = 5
for i in range(3):
x = assemble(form)
pytest_mpi.parallel_assert(np.isclose(x.dat.data_ro.item(), 5))
Loading