MulticoreParam-class {BiocParallel}R Documentation

Enable multi-core parallel evaluation

Description

This class is used to parameterize single computer multicore parallel evaluation on non-Windows computers. multicoreWorkers() chooses the number of workers based on operating system (Windows only supports 1 core), global user preference (options(mc.cores=...)), or number of detected cores (detectCores()).

Usage

MulticoreParam(workers = multicoreWorkers(), catch.errors = TRUE,
    setSeed = TRUE, recursive = TRUE, cleanup = TRUE,
    cleanupSignal = tools::SIGTERM, verbose = FALSE, ...) 
multicoreWorkers()

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.

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.

setSeed

logical(1), as described in parallel::mcparallel argument mc.set.seed.

recursive

logical(1) indicating whether recursive calls are evaluated in parallel; see parallel::mclapply argument mc.allow.recursive.

cleanup

logical(1) indicating whether forked children will be terminated before bplapply returns, as for parallel::mclapply argument cleanup. If TRUE, then the signal sent to the child is cleanupSignal.

cleanupSignal

integer(1) the signal sent to forked processes when cleanup=TRUE.

verbose

logical(1) when TRUE echo stdout of forked processes. This is the complement of parallel::mclapply's argument mc.silent.

...

Additional arguments passed to mclapply

MulticoreParam constructor

Return an object with specified values. The object may be saved to disk or reused within a session.

Methods

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

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 <- MulticoreParam()
bplapply(1:10, sqrt, BPPARAM=p)
bpvec(1:10, sqrt, BPPARAM=p)

## Not run: 
register(MulticoreParam(), default=TRUE)

## End(Not run)

[Package BiocParallel version 0.6.1 Index]