bpcontrols {BiocParallel}R Documentation

Control (start, stop, query) back-end Params

Description

Use functions on this page to start, stop, and query the ‘back-ends’ that perform a parallel evaluation.

Usage

bpworkers(x, ...)

bpstart(x, ...)
bpstop(x, ...)
bpisup(x, ...)

bpbackend(x, ...)
bpbackend(x, ...) <- value

Arguments

x

An instance of a BiocParallelParam class, e.g., MulticoreParam, SnowParam, DoparParam.

x can be missing, in which case the default back-end (see register) is used.

...

Additional arguments, perhaps used by methods.

value

Replace value for back-end.

Details

bpworkers reports the number of workers in the back-end as a scalar integer with value >= 0.

bpstart starts the back-end, if necessary. For instance, MulticoreParam back-ends do not need to be started, but SnowParam back-ends do. bp* functions like bplapply will automatically start the back-end if necessary.

bpstop stops the back-end, if necessary and possible.

bpisup tests whether the back-end is available for processing, returning a scalar logical value.

bpbackend retrieves an object representing the back end, if possible. Not all back-ends can be retrieved; see showMethods("backend").

bpbackend<- updates the back end, and is only meant for developer use.

Value

bpworkers returns a scalar integer >= 0.

bpisup returns a scalar logical.

bpstart, bpstop return an updated x, invisibly.

bpbackend, bpbackend<- return or accept back end-specific objects.

Author(s)

Martin Morgan mailto:mtmorgan@fhcrc.org.

See Also

BiocParallelParam for possible values of x.

Examples

bpworkers(SerialParam())

## Not run: 
  p <- SnowParam(2L)
  bpworkers(p)          # 2 local nodes, communicating via sockets
  bpstart(p)            # start cluster
  bplapply(1:10, sqrt, BPPARAM=p)
  bpstop(p)             # stop cluster

  p <- SnowParam(4L)
  bplapply(1:10, sqrt, BPPARAM=p)  # automatically start / stop cluster

## End(Not run)  


[Package BiocParallel version 0.6.1 Index]