This is mostly a wrapper around several functions in the parallel package:
makeCluster
, clusterSetRNGStream
, detectCores
.
.setupCl(cl, numClus = NULL, outfile, sim = NULL, packages = NULL)
Either NULL, cluster, logical, or numeric. NULL returns NULL,
a TRUE
logical or numeric will spawn a new SOCK cluster with
an "optimal" cluster number or cl
cluster nodes respectively.
In the three latter cases, all necessary packages and objects will
be sent to each of the nodes.
The desired number of child clusters, passed to
.optimalClusterNum
via maxNumClusters
. If not provided,
cl
must be provided.
The location of the log file
An optional simList object; this will be used to find the
packages required via setting
packages = SpaDES.core::packages(sim, clean = TRUE)
a character vector indicating which packages to load in the
cluster. Will ignore this if the sim
is provided.