PERF-2 P0: intra-step profiler — StepTimers on the overset solver (RTX_PROFILE; overlap build / predictors / patch BiCGSTAB / background Poisson with its setup-vs-iterate split / round exchange / apply / end exchange), PoissonSolution carries setup_ns and iterate_ns, the harness times advance / restore / snapshot / load sampling / force / FEA predictor and prints the wall split of the coupled phase; no clock is read when profiling is off; the reclassified/step progress denominator fixed (was ×4)
CI / Build (macos-latest) (push) Waiting to run
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 / CI Success (push) Blocked by required conditions
CI / Format Check (push) Failing after 6s
CI / Build (ubuntu-latest) (push) Failing after 5s
CI / Clippy Check (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 6s
Performance Benchmarks / Run Benchmarks (push) Failing after 27s
CI / Build CPU-Only (Explicit) (push) Failing after 1m24s
Documentation / Build API Documentation (push) Failing after 1m34s

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 22:25:52 -05:00
co-authored by Claude Fable 5.1
parent 2d2fed7181
commit 172a26dee4
11 changed files with 223 additions and 40 deletions
@@ -377,6 +377,8 @@ pub fn run_march_overset(case: BenchmarkCase, config: &OversetMarchConfig) -> Ov
f
});
let (t_fluid, t_structure) = (std::cell::Cell::new(0.0_f64), std::cell::Cell::new(0.0_f64));
// PERF-2 P0: the FEA predictor step (outside both buckets before).
let t_predictor = std::cell::Cell::new(0.0_f64);
let prev_area = std::cell::Cell::new(fluid.borrow().shared.read().unwrap().area());
let save_from: f64 = std::env::var("RTX_FSI2O_SAVE_FROM")
.ok()
@@ -395,9 +397,11 @@ pub fn run_march_overset(case: BenchmarkCase, config: &OversetMarchConfig) -> Ov
let v = extract_velocity(&flag_state);
d_n.iter().zip(&v).map(|(d, v)| d + dt * v).collect()
} else {
let ps = std::time::Instant::now();
flag.borrow_mut()
.set_nodal_forces(&with_fict(&committed_nodal, &extract_accel(&flag_state)));
let (predicted, _) = flag.borrow_mut().step(&flag_state).unwrap();
t_predictor.set(t_predictor.get() + ps.elapsed().as_secs_f64());
extract(&predicted)
};
if robin_alpha > 0.0 {
@@ -582,7 +586,7 @@ pub fn run_march_overset(case: BenchmarkCase, config: &OversetMarchConfig) -> Ov
total_subiterations as f64 / (step + 1) as f64,
fl.rounds_total.get() as f64 / fl.correctors_total.get().max(1) as f64,
fl.reclassified_total.get() as f64
/ (rigid_steps + (step + 1) * cfg.subcycle * 4).max(1) as f64,
/ (rigid_steps + (step + 1) * cfg.subcycle).max(1) as f64,
fl.regen_seconds.get(),
t_fluid.get(),
phase_start.elapsed().as_secs_f64()
@@ -590,6 +594,37 @@ pub fn run_march_overset(case: BenchmarkCase, config: &OversetMarchConfig) -> Ov
}
}
let fl = fluid.borrow();
// PERF-2 P0: the wall split of the coupled phase (every bucket the
// harness can see; `other` is what none of them caught).
{
let wall = phase_start.elapsed().as_secs_f64().max(1e-300);
let pct = |x: f64| 100.0 * x / wall;
let (adv, res, snap, samp, force, regen) = (
fl.t_advance.get(),
fl.t_restore.get(),
fl.t_snapshot.get(),
fl.t_sample.get(),
fl.t_force.get(),
fl.regen_seconds.get(),
);
let (st, pr) = (t_structure.get(), t_predictor.get());
let other = wall - (adv + res + snap + samp + force + regen + st + pr);
println!(
" wall split over the coupled phase ({wall:.0} s): fluid advance {adv:.0} s ({:.1}%), patch regeneration {regen:.0} s ({:.1}%), restore {res:.0} s ({:.1}%), snapshot {snap:.0} s ({:.1}%), load sampling {samp:.0} s ({:.1}%), force {force:.0} s ({:.1}%), structure {st:.0} s ({:.1}%), FEA predictor {pr:.0} s ({:.1}%), other {other:.0} s ({:.1}%)",
pct(adv),
pct(regen),
pct(res),
pct(snap),
pct(samp),
pct(force),
pct(st),
pct(pr),
pct(other)
);
if let Some(line) = fl.profile_line() {
println!("{line}");
}
}
let final_state_finite = flag_state.displacement.iter().all(|v| v.is_finite());
let steps_done = times.len();
OversetMarchResult {