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_sizeint

Number of draws to compute in this worker.

seed_seqnumpy.random.SeedSequence

Seed sequence for creating an independent RNG stream in the worker.

simulation_kwargsdict

Keyword arguments forwarded to MonteCarloSimulation.single_simulation().

Returns:
list[float]

The simulated values.

Notes

Uses numpy.random.Philox to spawn a deterministic, independent stream per worker chunk.