PERF-2 P1.1: the multigrid-PCG's prepared operator (hierarchy, f64 fine level, active cells, components) cached on the embedded solver and reused while the operator is bit-identical (an exact key over the coefficient bit patterns, the mask and the hierarchy parameters); solve_multigrid_pcg_cached gives the uncached solve's answer bit for bit (pin poisson_cache_exact.rs: five right-hand sides on one operator, a one-coefficient miss, both precisions); the CG driver split into Prepared::build + run_pcg
CI / Build (macos-latest) (push) Waiting to run
CI / CI Success (push) Blocked by required conditions
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / Build CPU-Only (Explicit) (push) Failing after 6s
Documentation / Build API Documentation (push) Failing after 6s
Documentation / Build User Guide (push) Successful in 6s
CI / Format Check (push) Failing after 16s
CI / Build (ubuntu-latest) (push) Failing after 2m13s
CI / Clippy Check (push) Failing after 2m41s
Performance Benchmarks / Run Benchmarks (push) Successful in 3m7s

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJPeT6WA2e7YvAnS875AHL
This commit is contained in:
Omar Sobh
2026-09-15 23:30:53 -05:00
co-authored by Claude Fable 5.1
parent 01830e5c8d
commit 79c18def32
5 changed files with 294 additions and 15 deletions
@@ -7,7 +7,7 @@ use super::EmbeddedPisoSolver;
use crate::CfdResult;
use crate::solvers::incompressible::ale::SideBoundary;
use crate::solvers::incompressible::poisson::{
MultigridParameters, PoissonProblem, PoissonSolverKind, solve_multigrid_pcg,
MultigridParameters, PoissonProblem, PoissonSolverKind, solve_multigrid_pcg_cached,
};
use crate::solvers::incompressible::{EmbeddedMask, FlowField};
@@ -294,7 +294,7 @@ impl EmbeddedPisoSolver {
}
let anchor_cell =
(!any_outlet && !self.has_fringe()).then_some(anchor.0 * nx + anchor.1);
let solution = solve_multigrid_pcg(
let solution = solve_multigrid_pcg_cached(
&problem,
&mut p_prime,
&MultigridParameters {
@@ -303,6 +303,7 @@ impl EmbeddedPisoSolver {
},
inner_stop,
anchor_cell,
&mut self.pcg_cache.borrow_mut(),
);
let (s0, i0, c0, k0) = self.poisson_profile.get();
self.poisson_profile.set((