Skip to content

[WIP] ABLASTR: MLMGOptions for computePhi - #1646

Open
ax3l wants to merge 2 commits into
BLAST-ImpactX:developmentfrom
ax3l:topic-ablastr-mlmg-options
Open

ax3l wants to merge 2 commits into
BLAST-ImpactX:developmentfrom
ax3l:topic-ablastr-mlmg-options

Conversation

@ax3l

@ax3l ax3l commented Sep 1, 2026

Copy link
Copy Markdown
Member

Prepare ImpactX for the breaking ABLASTR change in BLAST-WarpX/warpx#7228.

That PR replaces the four loose MLMG solver arguments of
ablastr::fields::computePhi with a single ablastr::fields::MLMGOptions
struct, which additionally exposes the bottom solver and the coarse-level
(agglomeration/consolidation/coarsening) controls.

Do not merge as-is. This is a work-in-progress PR so we can validate the
migration early and land it quickly once upstream is in. Before merging, the
first commit has to be replaced by a regular dependency update that resets
ImpactX_ablastr_repo/ImpactX_ablastr_branch to BLAST-WarpX/warpx and a
development commit that contains #7228.

Changes

  • cmake/dependencies/ABLASTR.cmake: temporarily track
    roelof-groenewald/WarpX @ mlmg_solver_options (marked with a TODO).
  • src/particles/spacecharge/PoissonSolve.cpp: fill an
    ablastr::fields::MLMGOptions from the existing defaults and algo.mlmg_*
    inputs and pass it to computePhi.

computePhi is the only ImpactX call site touched by #7228 — ImpactX does not
use computeEffectivePotentialPhi or getMaxNormRho, and the remaining
ABLASTR delta is additive.

No user-facing change

The algo.mlmg_relative_tolerance, algo.mlmg_absolute_tolerance,
algo.mlmg_max_iters and algo.mlmg_verbosity inputs and their sim.mlmg_*
Python properties are unchanged. The MLMGOptions members that ImpactX does
not set (bottom solver, bottom verbosity/iterations/tolerances, max coarsening
level, agglomeration, consolidation, final smoothing sweeps) default to the
same AMReX defaults that ImpactX used implicitly before, so the solve is
unchanged. Existing space-charge tests provide the coverage.

Testing

Built against the #7228 branch (OMP, MPI, FFT, double precision) with the
AMReX commit ImpactX currently pins — no bump needed, no new warnings.
The full CTest suite passes (201/201), including
cfchannel_spacecharge_mlmg, cfchannel_spacecharge_fft,
expanding_beam_mlmg, expanding_beam_fft, kurth_10nC_periodic,
expanding-fft-2d and chicane_csr.

Follow-ups

  • Optionally expose the new bottom solver and coarse-level controls as
    ImpactX inputs — they gave a 16% runtime win on 8 A100s upstream.
  • #7228 also lands ablastr::warn_manager::WMClear(), which would let ImpactX
    reset the ABLASTR warning state between ImpactX re-creations.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U98bFCQjdzryCL3idcxWgh

ax3l and others added 2 commits September 1, 2026 16:17
Temporarily point the ABLASTR dependency at the branch of
BLAST-WarpX/warpx#7228, which replaces the loose MLMG solver arguments of
`ablastr::fields::computePhi` with an `ablastr::fields::MLMGOptions`
struct.

This is a work-in-progress reference so we can migrate the ImpactX call
site ahead of time. Reset the repository and branch to a
BLAST-WarpX/warpx development commit once the upstream PR landed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U98bFCQjdzryCL3idcxWgh
`ablastr::fields::computePhi` now takes the MLMG solver settings in an
`ablastr::fields::MLMGOptions` struct instead of as four loose arguments.

Fill the struct with the same defaults and `algo.mlmg_*` inputs as before.
The struct members that ImpactX does not set (bottom solver, coarsening,
agglomeration, consolidation, final smoothing sweeps) default to the
AMReX defaults that ImpactX used implicitly, so the solve is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U98bFCQjdzryCL3idcxWgh
@ax3l ax3l added component: third party Changes in ImpactX that reflect a change in a third-party library component: space charge Space charge & potential solver labels Sep 1, 2026
@codspeed

codspeed Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 70 untouched benchmarks


Comparing ax3l:topic-ablastr-mlmg-options (f81e473) with development (75a7d5e)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: space charge Space charge & potential solver component: third party Changes in ImpactX that reflect a change in a third-party library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant