Skip to content

Explicit parallelism budget and caller-owned scratch on faer's operator contract - #486

Draft
schroedk wants to merge 3 commits into
mainfrom
feat/365-budget-workspace
Draft

schroedk wants to merge 3 commits into
mainfrom
feat/365-budget-workspace

Conversation

@schroedk

@schroedk schroedk commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #365.

Every operator apply takes a thread budget (Par) and caller-owned scratch (MemStack) on faer's LinOp/BiLinOp contract, and cannot fail.

  • schwarz-precond: Operator and the Schwarz buffer pool are removed; LocalSolver declares scratch per RHS count and budget; mlsmr(op, b, m, x, start, &options, stall, par, scratch) writes into x.
  • Kernels: data-parallel loops fork under the whole budget; Schwarz subdomains divide it.
  • within: operators implement LinOp; solve still fans RHS out on the ambient pool and hands each apply Par::rayon(0); Preconditioner::apply → apply_slices.

Stacked on #485. Test fixtures are faer matrices. thread_count checks equal bits at 1/2/3/8 threads. Rust 502 passed, pytest 117 passed / 2 skipped.

…get and caller scratch (#365)

Every apply in schwarz-precond and within takes a thread budget (Par) and
caller-owned scratch (MemStack) and cannot fail; Operator, the Schwarz buffer
pool and LocalSolveError are gone. LocalSolver declares its scratch per
right-hand-side count and budget. Data-parallel kernels fork under the whole
budget; independent regions (Schwarz subdomains) divide it through the new par
helpers. mlsmr writes into a caller x, starts from an explicit InitialGuess,
stops on an optional Staleness rule, and panics on mismatched shapes. within's
solve still fans right-hand sides out on the ambient pool and hands each apply
Par::rayon(0). Tests build fixtures from faer matrices.
approx-chol splits a block's solve only where it keeps Cᵀ, above 2^17
nonzeros, and splittable_work is then at least 2^18; a subdomain's sum is
0 or past the 200,000 gate, so the gate never changed a decision.
@schroedk
schroedk force-pushed the feat/365-budget-workspace branch from 8fe1764 to a6b01fb Compare November 1, 2026 14:52
Base automatically changed from refactor/one-mlsmr to main November 1, 2026 16:28
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.

1 participant