snowWrapper: Parallel wrapper function to call from within a function

Description Usage Arguments Value Author(s) See Also

View source: R/snowWrapper.R

Description

This function is now replaced by parDosa.

Usage

1
2
3
4
5
6
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.

seq

A vector to split.

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 clusterExport. Data in cldata can be used by fun.

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 is integer).

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.)

Value

Usually a list with results returned by the cluster.

Author(s)

Peter Solymos, solymos@ualberta.ca

See Also

This function is now replaced by parDosa.


dclone documentation built on May 2, 2019, 6:08 p.m.