Skip to content

schwarz-precond: drop LocalSolveInvoker generic#37

Merged
schroedk merged 1 commit into
mainfrom
refactor/drop-local-solve-invoker
May 11, 2026
Merged

schwarz-precond: drop LocalSolveInvoker generic#37
schroedk merged 1 commit into
mainfrom
refactor/drop-local-solve-invoker

Conversation

@schroedk
Copy link
Copy Markdown
Collaborator

Closes #31.

Summary

  • LocalSolver::solve_local now takes allow_inner_parallelism: bool directly. Solvers with no nested-parallel region ignore the hint (_allow_inner_parallelism).
  • SchwarzPreconditioner and AdditiveExecutor lose the I: LocalSolveInvoker type parameter. LocalSolveInvoker, DefaultLocalSolveInvoker, FeLocalSolveInvoker, and with_strategy_and_invoker are gone.
  • BlockElimSolver::solve_local_with_parallelism folds into its LocalSolver::solve_local impl. FeSchwarz is now SchwarzPreconditioner<BlockElimSolver>.
  • The nested-Rayon ParallelReduction regression test overrides LocalSolver::solve_local on its own impl (no custom invoker needed).

Net -107 LOC.

This is a breaking change to schwarz-precond's public trait surface. CHANGELOG [Unreleased] updated.

Test plan

  • cargo build --workspace --examples --tests
  • cargo test --workspace (all crates, including the nested-Rayon deadlock regression test_parallel_reduction_nested_rayon_does_not_deadlock)
  • cargo clippy --workspace --all-targets
  • cargo doc -p schwarz-precond --no-deps (crate has #![deny(missing_docs)])
  • pixi run test (98 Python tests)

The invoker trait existed to thread one bool ("may the local solver use
inner parallelism?") through three impls — a default, an FE-specific one,
and a test-only one — at the cost of an `I: LocalSolveInvoker` type
parameter on every preconditioner-using API.

Move the hint onto `LocalSolver::solve_local` directly. `SchwarzPreconditioner`
and `AdditiveExecutor` drop the `I` parameter. `FeLocalSolveInvoker` is gone;
`BlockElimSolver::solve_local_with_parallelism` folds into the trait method.
The nested-Rayon regression test now overrides `LocalSolver::solve_local`
on its own impl instead of carrying a custom invoker.

Net -107 LOC. All workspace tests, the Python suite, and the nested-Rayon
deadlock regression remain green.
@schroedk schroedk merged commit 8f6553b into main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop the LocalSolveInvoker generic parameter

1 participant