## ----------------------------------------------------------------------
## The registry
## ----------------------------------------------------------------------
## The default registry.
default <- registered()
default
## When default = TRUE the last param registered becomes the new default.
snowparam <- SnowParam(workers = 3, type = "SOCK")
register(snowparam, default = TRUE)
registered()
## Retrieve the default back-end,
bpparam()
## or a specific BiocParallelParam.
bpparam("SnowParam")
## restore original registry -- push the defaults in reverse order
for (param in rev(default))
register(param)
## ----------------------------------------------------------------------
## Specifying a back-end for evaluation
## ----------------------------------------------------------------------
## The back-end of choice is given as the BPPARAM argument to
## the BiocParallel functions. None, one, or multiple back-ends can be
## used.
bplapply(1:6, sqrt, BPPARAM = MulticoreParam(3))
## When not specified, the default from the registry is used.
bplapply(1:6, sqrt)
Run the code above in your browser using DataLab