solver: a job cancelled before it starts stops before any setup work

The cancel check came only at the factorization, so on a busy CI runner a
pre-cancelled frequency solve still spent 17 s on setup (cancel_tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-15 12:44:16 -04:00
1 parent 3e997dab43
commit f220c7108b
4 files changed
+11

No files matched your search

+2
View File
@@ -1069,6 +1069,8 @@ fn followers(model: &Model, resolved: &fieldcraft_model::Resolved, mesh: &Mesh,
/// Solve a nonlinear static step: the step named `step`, or the model's only nonlinear static
/// step.
pub fn solve_nonlinear(model: &Model, step: Option<&str>, limits: &Limits) -> Result<StaticResult> {
// A job cancelled before it starts stops here, before any setup work.
fieldcraft_model::progress::check()?;
let chosen = model.select_step(step, |p| matches!(p, Procedure::NonlinearStatic(_)), "nonlinear static")?;
let Procedure::NonlinearStatic(settings) = &chosen.procedure else {
return Err(Error::Internal("nonlinear static step".into()));