tileApply() is parallelized through either future.apply::future_lapply()
(default) or BiocParallel::bplapply().
Additional parameters to control parallelization can be passed as a list
through the parallel_params argument in tileApply() methods.
Value
getTileworkParMethod returns character. The parallelization
method being used.
setTileworkParMethod returns NULL invisibly
Parameters
Available parameters for the parallel_params list:
method- character. Either"future"(default) or"biocparallel". Which parallelization framework to use. OverridessetTileworkParMethod()future_seed- logical (default =TRUE). Passed to thefuture.seedparameter infuture.apply::future_lapply(). Only used whenmethod = "future".BPPARAM- a {BiocParallel} parallelization parameter object. Only used whenmethod = "biocparallel".
Additional parameters relevant to the underlying functions may also be
passed in the list and will be forwarded via ....
Package Options
"tilework.warn_sequential"- logical (default =TRUE). Whether to warn when using parallelization defaults that run sequentially (i.e.,future::sequential()orBiocParallel::SerialParam())."tilework.par_method"- character (default ="future"). Either"future"or"biocparallel". Which parallelization framework to use."tilework.bpparam"- a {BiocParallel} parameter object. Set this to automatically use a specific BPPARAM, analogous to setting afuture::plan()for the {future} backend.
See also
Other parallel settings:
tilework_management
Examples
getTileworkParMethod()
#> [1] "future"
# Set to BiocParallel
setTileworkParMethod("biocparallel")
getTileworkParMethod()
#> [1] "biocparallel"
if (FALSE) { # \dontrun{
# Using future backend with multisession
future::plan(future::multisession, workers = 4)
tileApply(x, tiles, fun)
# Using BiocParallel backend
setTileworkParMethod("biocparallel")
options(tilework.bpparam = BiocParallel::SnowParam(workers = 4))
tileApply(x, tiles, fun)
# Or override per-call
setTileworkParMethod("future") # global default is future
tileApply(x, tiles, fun,
parallel_params = list(method = "biocparallel")
) # but use BiocParallel here
# Suppress sequential warnings
options(tilework.warn_sequential = FALSE)
} # }