Skip to main content

init_parallelism

Function init_parallelism 

Source
pub fn init_parallelism()
Expand description

Initialize faer’s global parallelism backend to a Rayon pool sized at rayon::current_num_threads(). Rayon’s pool itself honors the standard RAYON_NUM_THREADS environment variable on first use, so callers that need to constrain the worker count (e.g. the benchmark harnesses) set it once on the spawned subprocess and rayon picks it up natively.

Idempotent: only the first call has effect (guarded by std::sync::Once). Without this, faer’s global default is Par::Seq and matmul/factorizations run single-threaded even when the host has many cores.