pub struct FeralBackendPool { /* private fields */ }Expand description
Per-thread pool of serial FERAL backends for identical-sparsity batches (the issue-#126 “optional later optimization”: reuse the symbolic analysis across instances).
FERAL’s Solver keys its symbolic factorization (fill-reducing
ordering + supernode structure) on a pattern fingerprint and reuses
it across factor() calls — that is what already amortizes the
symbolic cost over a single instance’s IPM iterations. A fresh
backend per instance throws that cache away between instances; this
pool instead parks each worker thread’s backend when its solve
finishes and hands it to the next instance scheduled on that
thread. When the next instance’s KKT pattern is identical, its
first factorization hits the cached symbolic; when it differs, the
fingerprint mismatch triggers a fresh analysis — so pooling is
always correct, just only profitable for shared-structure
sweeps.
Determinism caveat (why this is opt-in): the pooled solver carries value-adjacent state across instances — most notably the MC64 scaling cache (reused only inside its validity bound) and any pivot-quality escalation a previous instance triggered. Solutions still satisfy the same tolerances, but are not guaranteed bit-identical to fresh-backend solves. The default batch entry points keep one fresh backend per instance.
Construct once per batch (Self::serial), share the Arc with
each worker’s configure via
install_pooled_serial_feral_backend. Restoration-phase inner
solves keep their own fresh backends. Pooled solvers (and their
cached factors) free when the Arc drops.
Implementations§
Source§impl FeralBackendPool
impl FeralBackendPool
Sourcepub fn serial(cfg: FeralConfig) -> Arc<Self>
pub fn serial(cfg: FeralConfig) -> Arc<Self>
A pool minting inner-serial backends with cfg (its parallel
field is forced off — pooling exists for the outer-parallel /
inner-serial batch shape).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FeralBackendPool
impl RefUnwindSafe for FeralBackendPool
impl Send for FeralBackendPool
impl Sync for FeralBackendPool
impl Unpin for FeralBackendPool
impl UnsafeUnpin for FeralBackendPool
impl UnwindSafe for FeralBackendPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more