Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllAtOnceReducedFunctional - initial time-parallel implementation #3870

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6406402
aaorf - initial parallel impl
JHopeCollins Nov 15, 2024
806a605
EnsembleFunction - initial (incomplete) impl
JHopeCollins Nov 19, 2024
3515a52
aaorf - attach indices to stages and make obs0_err/norm not error
JHopeCollins Nov 19, 2024
aba4f6d
ensemble sequential context manager
JHopeCollins Nov 20, 2024
8891c08
Merge branch 'master' into JHopeCollins/aaorf_timeparallel
JHopeCollins Nov 20, 2024
6037483
REMOVE BEFORE MERGE: pyadjoint branch
JHopeCollins Nov 20, 2024
b42c8fc
REMOVE BEFORE MERGE: pyadjoint branch
JHopeCollins Nov 20, 2024
61f3e75
Update .github/workflows/build.yml
JHopeCollins Nov 26, 2024
92bf6ca
Merge remote-tracking branch 'origin' into JHopeCollins/aaorf_timepar…
JHopeCollins Nov 29, 2024
d581787
aaorf - ensemblefunction and pyadjoint minimize
JHopeCollins Nov 29, 2024
8aa6655
Merge branch 'allatoncereducedfunctional' into JHopeCollins/aaorf_tim…
JHopeCollins Nov 29, 2024
6360250
4dvar rf test
JHopeCollins Dec 4, 2024
2831daf
Merge branch 'allatoncereducedfunctional' into JHopeCollins/aaorf_tim…
JHopeCollins Dec 17, 2024
d15eba6
fix assign visitor for cofunction??
JHopeCollins Dec 17, 2024
74a0974
aaorf - pass riesz_representation through chained rfs properly
JHopeCollins Dec 17, 2024
6c4c5b7
aaorf - delegate converting derivative from intermediate type to pyad…
JHopeCollins Dec 17, 2024
c22531f
aaorf - restore strong constraint 4dvar
JHopeCollins Dec 23, 2024
93fdc83
rename aao_rf -> 4dvar_rf
JHopeCollins Dec 23, 2024
a33651a
aaorf - make sure that the user facing control tracks the internal co…
JHopeCollins Jan 2, 2025
37a46ac
revert "fix" for previous unknown (jetlag induced) "bug"
JHopeCollins Jan 2, 2025
9a6f65d
use SimpleNameSpace instead of handrolled context class
JHopeCollins Jan 2, 2025
39cc8f5
Merge branch 'master' into JHopeCollins/aaorf_timeparallel
JHopeCollins Jan 2, 2025
0447e7b
Merge branch 'allatoncereducedfunctional' into JHopeCollins/aaorf_tim…
JHopeCollins Jan 2, 2025
0a40dc8
aaorf - fix docstring
JHopeCollins Jan 2, 2025
15f6444
skip 4dvar tests using adjoint in complex mode
JHopeCollins Jan 3, 2025
f7b38d5
Merge branch 'JHopeCollins/aaorf_timeparallel' of https://github.com/…
JHopeCollins Jan 3, 2025
8e1c69c
4DVarRF Hessian action
JHopeCollins Jan 6, 2025
a56c615
Merge branch 'JHopeCollins/aaorf_timeparallel' of https://github.com/…
JHopeCollins Jan 7, 2025
d8db9da
TO REVERT: pyadjoint branch
JHopeCollins Jan 7, 2025
01e52c9
docstrings for composite and 4dvar rfs
JHopeCollins Jan 7, 2025
021506d
add markings argument to FunctionMergeBlock.evaluate_tlm
JHopeCollins Jan 7, 2025
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/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
--install defcon \
--install gadopt \
--install asQ \
--package-branch pyadjoint JHopeCollins/set_working_tape_decorator \
JHopeCollins marked this conversation as resolved.
Show resolved Hide resolved
|| (cat firedrake-install.log && /bin/false)
- name: Install test dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker_reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build and push ${{ inputs.target }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
no-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Setup flake8 annotations
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zenodo-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
fetch-depth: 1
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install deps
Expand Down
27 changes: 19 additions & 8 deletions demos/full_waveform_inversion/full_waveform_inversion.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,29 @@ The source number is defined with the ``Ensemble.ensemble_comm`` rank::
source_number = my_ensemble.ensemble_comm.rank

In this example, we consider a two-dimensional square domain with a side length of 1.0 km. The mesh is
built over the ``my_ensemble.comm`` (spatial) communicator::

Lx, Lz = 1.0, 1.0
mesh = UnitSquareMesh(80, 80, comm=my_ensemble.comm)
built over the ``my_ensemble.comm`` (spatial) communicator.

::

import os
if os.getenv("FIREDRAKE_CI_TESTS") == "1":
# Setup for a faster test execution.
dt = 0.03 # time step in seconds
final_time = 0.6 # final time in seconds
nx, ny = 15, 15
else:
dt = 0.002 # time step in seconds
final_time = 1.0 # final time in seconds
nx, ny = 80, 80

The basic input for the FWI problem are defined as follows::
mesh = UnitSquareMesh(nx, ny, comm=my_ensemble.comm)

The frequency of the Ricker wavelet, the source and receiver locations are defined as follows::

import numpy as np
frequency_peak = 7.0 # The dominant frequency of the Ricker wavelet in Hz.
source_locations = np.linspace((0.3, 0.1), (0.7, 0.1), num_sources)
receiver_locations = np.linspace((0.2, 0.9), (0.8, 0.9), 20)
dt = 0.002 # time step in seconds
final_time = 1.0 # final time in seconds
frequency_peak = 7.0 # The dominant frequency of the Ricker wavelet in Hz.

Sources and receivers locations are illustrated in the following figure:

Expand Down Expand Up @@ -251,6 +261,7 @@ To have the step 4, we need first to tape the forward problem. That is done by c

from firedrake.adjoint import *
continue_annotation()
get_working_tape().progress_bar = ProgressBar

**Steps 2-3**: Solve the wave equation and compute the functional::

Expand Down
6 changes: 3 additions & 3 deletions demos/multigrid/geometric_multigrid.py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bilinear form to the solver ourselves: ::
"fieldsplit_0_pc_type": "mg",
"fieldsplit_1_ksp_type": "preonly",
"fieldsplit_1_pc_type": "python",
"fieldsplit_1_pc_python_type": "__main__.Mass",
"fieldsplit_1_pc_python_type": "geometric_multigrid.Mass",
"fieldsplit_1_aux_pc_type": "bjacobi",
"fieldsplit_1_aux_sub_pc_type": "icc",
}
Expand Down Expand Up @@ -227,7 +227,7 @@ approximations.
"mg_coarse_fieldsplit_0_pc_type": "lu",
"mg_coarse_fieldsplit_1_ksp_type": "preonly",
"mg_coarse_fieldsplit_1_pc_type": "python",
"mg_coarse_fieldsplit_1_pc_python_type": "__main__.Mass",
"mg_coarse_fieldsplit_1_pc_python_type": "geometric_multigrid.Mass",
"mg_coarse_fieldsplit_1_aux_pc_type": "cholesky",
"mg_levels_ksp_type": "richardson",
"mg_levels_ksp_max_it": 1,
Expand All @@ -245,7 +245,7 @@ approximations.
"mg_levels_fieldsplit_1_ksp_richardson_self_scale": None,
"mg_levels_fieldsplit_1_ksp_max_it": 3,
"mg_levels_fieldsplit_1_pc_type": "python",
"mg_levels_fieldsplit_1_pc_python_type": "__main__.Mass",
"mg_levels_fieldsplit_1_pc_python_type": "geometric_multigrid.Mass",
"mg_levels_fieldsplit_1_aux_pc_type": "bjacobi",
"mg_levels_fieldsplit_1_aux_sub_pc_type": "icc",
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/advanced_tut.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ element systems.
A pressure-convection-diffusion preconditioner for the Navier-Stokes equations.</demos/navier_stokes.py>
Rayleigh-Benard convection.<demos/rayleigh-benard.py>
Netgen support.<demos/netgen_mesh.py>
Full-waveform inversion: Full-waveform inversion: spatial and wave sources parallelism.<demos/full_waveform_inversion.py>
Full-waveform inversion: spatial and wave sources parallelism.<demos/full_waveform_inversion.py>
4 changes: 2 additions & 2 deletions docs/source/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ packages can be installed into an existing Firedrake installation using
System requirements
-------------------

Firedrake requires Python 3.9 to 3.13. The installation script is
Firedrake requires Python 3.10 to 3.13. The installation script is
tested by CI on Ubuntu 24.04 LTS. On Ubuntu 22.04 or later, the system
installed Python 3 is supported. On MacOS, the homebrew_ installed
Python 3 is supported::
Expand All @@ -126,7 +126,7 @@ they have the system dependencies:
* A Fortran compiler (for PETSc)
* Blas and Lapack
* Git, Mercurial
* Python version 3.9-3.13
* Python version 3.10-3.13
* The Python headers
* autoconf, automake, libtool
* CMake
Expand Down
4 changes: 2 additions & 2 deletions docs/source/install-debug.dot
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ digraph triage {
venv_activated [label="venv activated?"];
install_script_up_to_date [label="Install script\nup to date?"];
using_anaconda [label="Using\nAnaconda?"];
python_version [label="Python <3.9?"];
python_version [label="Python <3.10?"];
using_macos [label="Using\nMacOS?"];
using_homebrew [label="Using\nHomebrew?"];
url_error [label="URL Error with SSL\ncertificate failure?"];
which_python [label="<which python3> points\nat <$(brew --prefix)/bin/python3>?"];

activate_venv [label="Activate the\nvenv first."];
uninstall_anaconda [label="Deactivate\nAnaconda."];
update_python [label="Get Python 3.9-3.13"];
update_python [label="Get Python 3.10-3.13"];
update_install_script [label="Fetch new\ninstall script"];
get_homebrew [label="Use Homebrew."];
brew_doctor [label="brew doctor"];
Expand Down
1 change: 1 addition & 0 deletions firedrake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
from firedrake.vector import *
from firedrake.version import __version__ as ver, __version_info__, check # noqa: F401
from firedrake.ensemble import *
from firedrake.ensemblefunction import *
from firedrake.randomfunctiongen import *
from firedrake.external_operators import *
from firedrake.progress_bar import ProgressBar # noqa: F401
Expand Down
Loading
Loading