mcframework.backends.worker_run_chunk#
- mcframework.backends.worker_run_chunk(sim: MonteCarloSimulation, chunk_size: int, seed_seq: np.random.SeedSequence, simulation_kwargs: dict[str, Any]) list[float][source]#
Execute a small batch of single simulations in a separate worker.
- Parameters:
- sim
Simulation instance to call (
MonteCarloSimulation.single_simulation()). Must be pickleable when used with a process backend.- chunk_size
int Number of draws to compute in this worker.
- seed_seq
numpy.random.SeedSequence Seed sequence for creating an independent RNG stream in the worker.
- simulation_kwargs
dict Keyword arguments forwarded to
MonteCarloSimulation.single_simulation().
- Returns:
Notes
Uses
numpy.random.Philoxto spawn a deterministic, independent stream per worker chunk.