This is an internal function. Draws are done in chunks labeled
by indices and of size determined by nsim. Users should call the wrapper
function simulate_from_model
.
simulate_parallel(
model_ref,
nsim,
index,
seeds,
socket_names,
libraries,
save_locally = TRUE
)
object of class ModelRef
number of simulations to be conducted on each chunk. Vector of
same length as index
a vector of positive integer indices. Allows simulations to be carried out in chunks. Each chunk gets a separate RNG stream, meaning that the results will be identical whether we run these in parallel or sequentially.
a list of length(index)
L'Ecuyer-CMRG seed vectors.
Each should be from a separate stream. In particular, starting from
the seed used to generate the model object, seeds[i] should be the
result of calling nextRNGStream
index[i]
times.
(quoting from makePSOCKcluster
"either a character vector of host names on which to run the worker
copies of R, or a positive integer (in which case that number of
copies is run on localhost)."
character vector of R packages that will be needed on the slaves.
if TRUE, then files will be saved on slaves. If FALSE, they will be saved on master.