Skip to content

Commit

Permalink
Merge branch 'master' into pbrubeck/single-source
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Dec 20, 2024
2 parents e65ec71 + 00127cc commit 2ec95ea
Show file tree
Hide file tree
Showing 25 changed files with 329 additions and 266 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
run: |
. ../firedrake_venv/bin/activate
python -m pytest -v tests/firedrake/regression/ -k "poisson_strong or stokes_mini or dg_advection"
# also test for 'problem libraries' (spatialindex and libsupermesh)
python -m pytest -v tests/firedrake/regression/test_locate_cell.py
python -m pytest -v tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py
timeout-minutes: 30
- name: Post-run cleanup
if: ${{ always() }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
--mpicxx="$MPICH_DIR"/mpicxx \
--mpif90="$MPICH_DIR"/mpif90 \
--mpiexec="$MPICH_DIR"/mpiexec \
--mpihome="$MPICH_DIR"/.. \
--venv-name firedrake_venv \
--no-package-manager \
--disable-ssh \
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/pip-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,6 @@ jobs:
--download-superlu_dist
make
- name: Install libsupermesh
run: |
source pip_venv/bin/activate
python -m pip install 'rtree>=1.2'
cd pip_venv/src
git clone https://github.com/firedrakeproject/libsupermesh.git
mkdir -p libsupermesh/build
cd libsupermesh/build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \
-DMPI_C_COMPILER=/opt/homebrew/bin/mpicc \
-DMPI_CXX_COMPILER=/opt/homebrew/bin/mpicxx \
-DMPI_Fortran_COMPILER=/opt/homebrew/bin/mpif90 \
-DCMAKE_Fortran_COMPILER=/opt/homebrew/bin/mpif90 \
-DMPIEXEC_EXECUTABLE=/opt/homebrew/bin/mpiexec
make
make install
- uses: actions/checkout@v4
with:
path: pip_venv/src/firedrake
Expand Down Expand Up @@ -118,6 +99,9 @@ jobs:
cd pip_venv/src/firedrake
python -m pytest --timeout=1800 -v tests/firedrake/regression \
-k "poisson_strong or stokes_mini or dg_advection"
# also test for 'problem libraries' (spatialindex and libsupermesh)
python -m pytest -v tests/firedrake/regression/test_locate_cell.py
python -m pytest -v tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py
timeout-minutes: 30

- name: Cleanup (post)
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,6 @@ jobs:
with:
path: src/firedrake

- name: Install libsupermesh
run: |
source pip_venv/bin/activate
python -m pip install 'rtree>=1.2'
cd pip_venv/src
git clone https://github.com/firedrakeproject/libsupermesh.git
mkdir -p libsupermesh/build
cd libsupermesh/build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \
-DMPI_C_COMPILER="$MPICH_DIR/mpicc" \
-DMPI_CXX_COMPILER="$MPICH_DIR/mpicxx" \
-DMPI_Fortran_COMPILER="$MPICH_DIR/mpif90" \
-DCMAKE_Fortran_COMPILER="$MPICH_DIR/mpif90" \
-DMPIEXEC_EXECUTABLE="$MPICH_DIR/mpiexec"
make
make install
- name: Pip install
run: |
source pip_venv/bin/activate
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/pyop2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ jobs:
id: setup-python
with:
python-version: ${{ matrix.python-version }}
# By default setup-python pollutes the environment in such a way that virtual
# environments cannot be used. This prevents us from building libsupermesh because
# it relies on having rtree installed into a venv.
# https://github.com/actions/setup-python/issues/851
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-update-environment-flag
update-environment: false

- name: Create virtual environment
shell: bash
run: |
${{ steps.setup-python.outputs.python-path }} -m venv venv

- name: Clone PETSc
uses: actions/checkout@v4
Expand All @@ -65,25 +54,6 @@ jobs:
--with-fortran-bindings=0
make
- name: Install libsupermesh
shell: bash
run: |
source venv/bin/activate
python -m pip install 'rtree>=1.2'
git clone https://github.com/firedrakeproject/libsupermesh.git
mkdir -p libsupermesh/build
cd libsupermesh/build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \
-DMPI_C_COMPILER=mpicc \
-DMPI_CXX_COMPILER=mpicxx \
-DMPI_Fortran_COMPILER=mpif90 \
-DCMAKE_Fortran_COMPILER=mpif90 \
-DMPIEXEC_EXECUTABLE=mpiexec
make
make install
- name: Checkout Firedrake
uses: actions/checkout@v4
with:
Expand All @@ -93,15 +63,13 @@ jobs:
shell: bash
working-directory: firedrake
run: |
source ../venv/bin/activate
python -m pip install -U pip
python -m pip install -U pytest-timeout
- name: Install PyOP2
shell: bash
working-directory: firedrake
run: |
source ../venv/bin/activate
export CC=mpicc
export HDF5_DIR="$PETSC_DIR/$PETSC_ARCH"
export HDF5_MPI=ON
Expand All @@ -111,15 +79,13 @@ jobs:
shell: bash
working-directory: firedrake
run: |
source ../venv/bin/activate
pytest --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/tsfc
timeout-minutes: 10

- name: Run PyOP2 tests
shell: bash
working-directory: firedrake
run: |
source ../venv/bin/activate
pytest -m "not parallel" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
mpiexec -n 2 --oversubscribe pytest -m "parallel[2]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
mpiexec -n 3 --oversubscribe pytest -m "parallel[3]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.complex
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ RUN bash -c "python3 firedrake-install \
--mpicxx=$MPICH_DIR/mpicxx \
--mpif90=$MPICH_DIR/mpif90 \
--mpiexec=$MPICH_DIR/mpiexec \
--mpihome=$MPICH_DIR/.. \
--slepc \
--documentation-dependencies"
3 changes: 2 additions & 1 deletion docker/Dockerfile.vanilla
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ RUN bash -c "python3 firedrake-install \
--mpicc=$MPICH_DIR/mpicc \
--mpicxx=$MPICH_DIR/mpicxx \
--mpif90=$MPICH_DIR/mpif90 \
--mpiexec=$MPICH_DIR/mpiexec"
--mpiexec=$MPICH_DIR/mpiexec \
--mpihome=$MPICH_DIR/.."
1 change: 0 additions & 1 deletion docs/source/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ Requirements
* An activated virtual environment.
* All the system requirements listed in :ref:`system-requirements`.
* A Firedrake-compatible PETSc installation (using our `fork of PETSc <https://github.com/firedrakeproject/petsc.git>`_). The set of flags passed to PETSc can be retrieved by passing the command ``--show-petsc-configure-options`` to ``firedrake-install``.
* `libsupermesh <https://github.com/firedrakeproject/libsupermesh.git>`_ to be installed inside the virtual environment (see `here <https://github.com/firedrakeproject/firedrake/blob/master/.github/workflows/pip.yml>`_ for an example of how to do this).
* The following environment variables to be set:

* ``PETSC_DIR`` and ``PETSC_ARCH`` to point to the correct location for the PETSc installation.
Expand Down
22 changes: 8 additions & 14 deletions docs/source/firedrake_usa_25.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ The conference will begin with a tutorial session on the morning of 28 February
Conference venue
----------------

The conference will take place in the Bill Daniel Student Center in Room 202 in the heart of the Baylor campus.
The conference will take place in the Bill Daniel Student Center in Room 202 in the heart of the Baylor campus. A `campus map <https://map.baylor.edu/>`__ is available online, and both Apple Maps and Google Maps accurately locate the Bill Daniel Student Center.


Accommodation
-------------

We will be reserving a room block in a hotel near campus. More information to follow.
We have reserved a block of hotel rooms at SpringHill Suites Waco, about a 15 minute walk from the Bill Daniel Student Center. Follow `this link <https://www.marriott.com/event-reservations/reservation-link.mi?id=1734040121673&key=GRP&guestreslink2=true&app=resvlink/>`__ to hold your room. The group rate is only available until 20 January 2025.


Conference dinner
Expand All @@ -53,9 +53,9 @@ The registration fees are as follows:
:widths: 25 50
:header-rows: 0

* - Student
* - Student:
- $50
* - Non-student
* - Non-student:
- $200

The `SIAM Texas-Louisiana Section <https://www.siam.org/get-involved/connect-with-a-community/sections/siam-texas-louisiana-section/>`__ is providing some support for students currently attending universities in Texas or Louisiana to attend.
Expand All @@ -66,7 +66,7 @@ Conference registration is coming soon.
Abstract submission
-------------------

Abstract submission will open soon via Easy Chair.
Abstracts can be submitted `via EasyChair <https://easychair.org/conferences/?conf=firedrakeusa25>`__.



Expand All @@ -79,17 +79,11 @@ The conference has been kindly supported by the SIAM TX-LA Section and EPSRC.
Travel to Waco
--------------

* By air
* By air: Waco has a small airport. There is daily service between Waco and Dallas/Fort Worth International Airport via American Airlines.

Waco has a small airport. There is daily service between Waco and Dallas/Fort Worth International Airport via American Airlines.
* By ground: We are less than two hours by car from the Dallas and Austin airports, and just under three hours from Bush Intercontinental Airport in Houston. Additionally, Waco is reachable by bus services such as Greyhound and FlixBus.

* By ground

We are less than two hours by car from the Dallas and Austin airports, and just under three hours from Bush Intercontinental Airport in Houston. Additionally, Waco is reachable by bus services such as Greyhound and FlixBus.

* Parking on campus

Baylor has plenty of visitor parking for your personal or rental vehicle, but conslut `these instructions <https://dps.web.baylor.edu/parking-transportation/visitors>__` and make sure to `register your vehicle <https://dps.web.baylor.edu/parking-transportation/visitors/visitor-parking-permit>__`.
* Parking on campus: Baylor has plenty of visitor parking for your personal or rental vehicle, but consult `these instructions <https://dps.web.baylor.edu/parking-transportation/visitors>`__ and make sure to `register your vehicle <https://dps.web.baylor.edu/parking-transportation/visitors/visitor-parking-permit>`__.



Expand Down
5 changes: 3 additions & 2 deletions docs/source/parallelism.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ firedrake installer to use it, by running:

.. code-block:: shell
python3 firedrake-install --mpiexec=mpiexec --mpicc=mpicc --mpicxx=mpicxx --mpif90=mpif90
python3 firedrake-install --mpiexec=mpiexec --mpicc=mpicc --mpicxx=mpicxx --mpif90=mpif90 --mpihome mpihome
where ``mpiexec``, ``mpicc``, ``mpicxx``, and ``mpif90`` are the
commands to run an MPI job and to compile C, C++, and Fortran 90 code,
respectively.
respectively. ``mpihome`` is an extra variable that must point to the
root directory of the MPI installation (e.g. ``/usr`` or ``/opt/mpich``).

Printing in parallel
====================
Expand Down
2 changes: 1 addition & 1 deletion firedrake/cython/dmcommon.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,7 @@ def make_global_numbering(PETSc.Section lsec, PETSc.Section gsec):
cdef:
PetscInt c, cc, p, pStart, pEnd, dof, cdof, loff, goff
np.ndarray val
PetscInt *dof_array = NULL
const PetscInt *dof_array = NULL

val = np.empty(lsec.getStorageSize(), dtype=IntType)
pStart, pEnd = lsec.getChart()
Expand Down
8 changes: 3 additions & 5 deletions firedrake/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,7 @@ def _interpolator(V, tensor, expr, subset, arguments, access, bcs=None):
# interpolation) we have to pass the finat element we construct
# here. Ideally we would only pass the UFL element through.
kernel = compile_expression(cell_set.comm, expr, to_element, V.ufl_element(),
domain=source_mesh, parameters=parameters,
log=PETSc.Log.isActive())
domain=source_mesh, parameters=parameters)
ast = kernel.ast
oriented = kernel.oriented
needs_cell_sizes = kernel.needs_cell_sizes
Expand Down Expand Up @@ -1221,10 +1220,9 @@ def _interpolator(V, tensor, expr, subset, arguments, access, bcs=None):
f"firedrake-tsfc-expression-kernel-cache-uid{os.getuid()}")


def _compile_expression_key(comm, expr, to_element, ufl_element, domain, parameters, log):
def _compile_expression_key(comm, expr, to_element, ufl_element, domain, parameters):
"""Generate a cache key suitable for :func:`tsfc.compile_expression_dual_evaluation`."""
key = hash_expr(expr), hash(ufl_element), utils.tuplify(parameters), log
return key
return (hash_expr(expr), hash(ufl_element), utils.tuplify(parameters))


@memory_and_disk_cache(
Expand Down
2 changes: 1 addition & 1 deletion firedrake/parloops.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def par_loop(kernel, measure, args, kernel_kwargs=None, **kwargs):
domain = '{[i]: 0 <= i < A.dofs}'
instructions = '''
for i
A[i] = max(A[i], B[0])
A[i] = fmax(A[i], B[0])
end
'''
par_loop((domain, instructions), dx, {'A' : (A, RW), 'B': (B, READ)})
Expand Down
2 changes: 1 addition & 1 deletion firedrake/preconditioners/pmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def coarsen_bc_value(self, bc, cV):

def prolongation_transfer_kernel_action(Vf, expr):
to_element = create_element(Vf.ufl_element())
kernel = compile_expression_dual_evaluation(expr, to_element, Vf.ufl_element(), log=PETSc.Log.isActive())
kernel = compile_expression_dual_evaluation(expr, to_element, Vf.ufl_element())
coefficients = extract_numbered_coefficients(expr, kernel.coefficient_numbers)
if kernel.needs_external_coords:
coefficients = [Vf.mesh().coordinates] + coefficients
Expand Down
2 changes: 1 addition & 1 deletion firedrake/slate/slac/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ def gem_to_loopy(gem_expr, var2terminal, scalar_type):

# Part B: impero_c to loopy
output_arg = OutputKernelArg(output_loopy_arg)
return generate_loopy(impero_c, args, scalar_type, "slate_loopy", [], log=PETSc.Log.isActive()), output_arg
return generate_loopy(impero_c, args, scalar_type, "slate_loopy", []), output_arg
6 changes: 4 additions & 2 deletions firedrake/supermeshing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Code for projections and other fun stuff involving supermeshes.
import firedrake
import ctypes
import sys
import pathlib
import libsupermesh
from firedrake.cython.supermeshimpl import assemble_mixed_mass_matrix as ammm, intersection_finder
from firedrake.mg.utils import get_level
from firedrake.petsc import PETSc
Expand Down Expand Up @@ -428,7 +429,8 @@ def likely(cell_A):
"complex_mode": 1 if complex_mode else 0
}

dirs = get_petsc_dir() + (sys.prefix, )
libsupermesh_dir = pathlib.Path(libsupermesh.get_include()).parent.absolute()
dirs = get_petsc_dir() + (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"]
Expand Down
6 changes: 3 additions & 3 deletions firedrake/tsfc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
)


def tsfc_compile_form_hashkey(form, prefix, parameters, interface, diagonal, log):
# Drop prefix as it's only used for naming and log
def tsfc_compile_form_hashkey(form, prefix, parameters, interface, diagonal):
# Drop prefix as it's only used for naming
return default_parallel_hashkey(form.signature(), prefix, parameters, interface, diagonal)


Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(
"""
tree = tsfc_compile_form(form, prefix=name, parameters=parameters,
interface=interface,
diagonal=diagonal, log=PETSc.Log.isActive())
diagonal=diagonal)
kernels = []
for kernel in tree:
# Individual kernels do not have to use all of the coefficients
Expand Down
Loading

0 comments on commit 2ec95ea

Please sign in to comment.