[12/13][Adjoint Module] Scalable Pade extrapolation for DFT monitors - #3294
Draft
smartalecH wants to merge 2 commits into
Draft
[12/13][Adjoint Module] Scalable Pade extrapolation for DFT monitors#3294smartalecH wants to merge 2 commits into
smartalecH wants to merge 2 commits into
Conversation
This was referenced Sep 2, 2026
Closed
Draft
Draft
Draft
Accumulate the DFT as usual and extrapolate its tail from the last n samples, which both shortens the run and yields a convergence error estimate that stop_when_dft_pade_converged can act on. The estimate is aggregated across monitors and ranks weighted by field magnitude rather than by taking a max over independently normalised ratios: a component that is near zero for a symmetry reason (Ey under a y mirror, say) otherwise has a meaningless ratio that vetoes convergence for everything else. Also lets a rank place no adjoint source at all. The old assertion was a local check on a globally true condition, so a point monitor that landed outside a given rank's chunk deadlocked under MPI.
smartalecH
force-pushed
the
feat/adjoint-pade-dft
branch
from
September 4, 2026 17:32
1ea5b31 to
ae4e1ec
Compare
This PR's meepgeom.cpp changes were assembled file-wise and carried a function reordering along with them, putting ivec_in_box, matching_dft_chunk and forward_dft_value below geometry_addgradient, which calls them. Nothing depended on the order until geometry_addgradient started using those helpers lower in the stack, at which point rungs from here up stopped compiling. Move them back ahead of their caller.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on the dispersive-smoothing PR. Addresses #3217.
Accumulates the DFT as usual and extrapolates its tail from the last n samples, which both shortens the run and gives a convergence error estimate that
stop_when_dft_pade_convergedcan act on. On a real grating this is ~14% fewer timesteps at matched accuracy.The estimate is aggregated across monitors and ranks weighted by field magnitude rather than by a max over independently normalised ratios. A component that is near zero for a symmetry reason -- Ey under a y mirror, say -- otherwise has a meaningless ratio that vetoes convergence for everything else; the aggregate went from 3.4e-1 to 1.7e-2 on the case that motivated this.
Also lets a rank place no adjoint source at all. The old assertion was a local check on a globally true condition, so a point monitor landing outside a given rank's chunk deadlocked under MPI.