bpoptions: Additional options to parallel evaluation

View source: R/bpoptions.R

bpoptionsR Documentation

Additional options to parallel evaluation

Description

This function is used to pass additional options to bplapply() and other functions function. One use case is to use the argument BPOPTIONS to temporarily change the parameter of BPPARAM (e.g. enabling the progressbar). A second use case is to change the behavior of the parallel evaluation (e.g. manually exporting some variables to the worker)

Usage

bpoptions(
    workers, tasks, jobname, log, logdir, threshold, resultdir,
    stop.on.error, timeout, exportglobals, exportvariables, progressbar,
    RNGseed, force.GC, fallback, exports, packages, ...
)

Arguments

workers

integer(1) or character() parameter for BPPARAM; see bpnworkers.

tasks

integer(1) parameter for BPPARAM; see bptasks.

jobname

character(1) parameter for BPPARAM; see bpjobname.

log

logical(1) parameter for BPPARAM; see bplog.

logdir

character(1) parameter for BPPARAM; see bplogdir.

threshold

A parameter for BPPARAM; see bpthreshold.

resultdir

character(1) parameter for BPPARAM; see bpresultdir.

stop.on.error

logical(1) parameter for BPPARAM; see bpstopOnError.

timeout

integer(1) parameter for BPPARAM; see bptimeout.

exportglobals

logical(1) parameter for BPPARAM; see bpexportglobals.

exportvariables

A parameter for BPPARAM; see bpexportvariables.

progressbar

logical(1) parameter for BPPARAM; see bpprogressbar.

RNGseed

integer(1) parameter for BPPARAM; see bpRNGseed.

force.GC

logical(1) parameter for BPPARAM; see bpforceGC.

fallback

logical(1) parameter for BPPARAM; see bpfallback.

exports

character() The names of the variables in the global environment which need to be exported to the global environment of the worker. This option works independently of the option exportvariables.

packages

character() The packages that needs to be attached by the worker prior to the evaluation of the task. This option works independently of the option exportvariables.

...

Additional arguments which may(or may not) work for some specific type of BPPARAM.

Value

A list of options

Author(s)

Jiefei Wang

See Also

BiocParallelParam, bplapply, bpiterate.

Examples

  p <- SerialParam()
  bplapply(1:5, function(x) Sys.sleep(1), BPPARAM = p,
         BPOPTIONS = bpoptions(progressbar = TRUE, tasks = 5L))

Bioconductor/BiocParallel documentation built on Oct. 31, 2024, 6:58 a.m.