Usage
snowWrapper(cl, seq, fun,
cldata, name = "cldata", use.env=FALSE,
lib = NULL, dir = NULL, evalq=NULL,
size = 1, balancing = c("none", "load", "size", "both"),
rng.type = c("none", "RNGstream", "SPRNG"),
cleanup = TRUE, unload = FALSE, envir = .GlobalEnv, ...)
Arguments
cl
A cluster object created by makeCluster
, or
an integer. It can also be NULL
, see Details. fun
A function or character string naming a function.
cldata
A list containing data. This will be assigned to
an object name
in the global environment
(an already existing object with same name will be
saved and replaced back in the end).
This list is then exported to the cluster by
name
Character, the name of cldata
as to be assigned
to the global environment and used in fun
.
use.env
Logical, if name
is to be treated as a
list object or an environment.
lib
Character, name of package(s). Optionally packages can be
loaded onto the cluster. More than one package can be
specified as character vector. Packages already loaded are skipped.
dir
Working directory to use, if NULL
working
directory is not set on workers (default).
Can be a vector to set different directories on workers.
evalq
Character, expressions to evaluate,
e.g. for changing global options (passed to clusterEvalQ
).
More than one expressions can be specified as character vector. balancing
Character, type of balancing to perform (see Details).
size
Vector of problem sizes (or relative performance information)
corresponding to elements of seq
(recycled if needed).
The default 1
indicates equality of problem sizes.
rng.type
Character, "none"
or the type of RNG on the workers
(see clusterSetupRNG
).
The logical value !(rng.type == "none")
is used for
forking (e.g. when cl
i cleanup
logical, if cldata
should be removed from
the workers after applying fun
.
If TRUE
, effects of dir
argument is also cleaned up.
unload
logical, if pkg
should be unloaded after applying fun
.
envir
environment to use when assigning data values.
...
Other arguments of fun
, that are simple values and not objects.
(Arguments passed as objects should be specified in cldata
,
otherwise those are not exported to the cluster by this function.)