SnowParam-class {BiocParallel}R Documentation

Enable simple network of workstations (SNOW)-style parallel evaluation

Description

This class is used to parameterize simple network of workstations (SNOW) parallel evaluation on one or several physical computers.

Usage

SnowParam(workers = 0L, type=c("SOCK", "PSOCK", "FORK", "MPI"),
    catch.errors = TRUE, ...)

## invoke as(cl, "SnowParam")
## S4 method for signature 'SOCKcluster,SnowParam'
coerce(from, to)
## S4 method for signature 'spawnedMPIcluster,SnowParam'
coerce(from, to)

Arguments

workers

integer(1)

Number of workers on with Multicore and SSH backend which defaults here to all workers available. On managed HPC workers defaults to NA but can be set to control chunking of jobs. See argument n.chunks in chunk and submitJobs for more information.

type

character(1) type of cluster to use, as described in clusterMap argument type. Use MulticoreParam instead of type=FORK.

catch.errors

logical(1) Flag to determine in apply-like functions (see e.g. bplapply) whether to quit with an error as soon as one application fails or encapsulation of function calls in try blocks which triggers a resume mechanism (see bpresume). Defaults to TRUE.

...

Additional arguments passed to makeCluster

from, to

(N.B. Use as(from, "SnowParam") to coerce from a cluster created with, e.g., parallel::makeCluster). from is a SOCKcluster or derived instance (e.g., from parallel::makeCluster), to be coerced to a SnowParam instance.

SnowParam constructor

Return an object representing a SNOW cluster. The cluster is not created until bpstart is called.

bpstart creates the cluster by invoking makeCluster with arguments spec=workers, type, and other arguments passed to ... in SnowParam.

Use as(cl, "SnowParam") to coerce a cluster created directly by parallel::param to a SnowParam instance. Instances created in this way cannot be started or stopped.

Methods

The following generics are implemented and perform as documented on the corresponding help page (e.g., ?bpisup): bpworkers, bpstart, bpstop, bpisup, bpbackend, bpbackend<-, bpvec.

Author(s)

Martin Morgan mailto:mtmorgan@fhcrc.org

See Also

getClass("BiocParallelParam") for additional parameter classes.

register for registering parameter classes for use in parallel evaluation.

Examples

p <- SnowParam(2L)
bplapply(1:10, sqrt, BPPARAM=p)
bpvec(1:10, sqrt, BPPARAM=p)

## Not run: 
register(SnowParam(2L), default=TRUE)

## End(Not run)

[Package BiocParallel version 0.6.1 Index]