Skip to main content

run_sweep_parallel

Function run_sweep_parallel 

Source
pub fn run_sweep_parallel(
    lattice: &Lattice,
    realizations: &mut [Realization],
    n_replicas: usize,
    n_temps: usize,
    config: &SimConfig,
    interrupted: &AtomicBool,
    on_sweep: &(dyn Fn() + Sync),
) -> Result<SweepResult, String>
Expand description

Run the sweep loop in parallel over multiple disorder realizations.

Each realization is processed by run_sweep_loop, then results are averaged via SweepResult::aggregate. For a single realization the call is made directly, skipping rayon thread-pool overhead.