seqParallelSetup | R Documentation |
Setups a parallel environment in R for the current session.
seqParallelSetup(cluster=TRUE, verbose=TRUE)
seqGetParallel()
seqMulticoreSetup(num, type=c("psock", "fork"), verbose=TRUE)
cluster |
|
num |
the maximum number of cores used for the user-defined multicore setting; FALSE, NA or any value less than 2, to disable the multicore cluster |
type |
either PSOCK or Fork cluster setup for the multicore setting, the resulting parallel cluster will be used if 'parallel' is a number greater than one in associated functions |
verbose |
if |
When cl
is TRUE
or a numeric value, forking techniques are
used to create a new child process as a copy of the current R process, see
?parallel::mcfork
. However, forking is not available on Windows, so
multiple processes created by makeCluster
are used instead.
The R environment option seqarray.parallel
will be set according
to the value of cluster
.
Using seqParallelSetup(FALSE)
removes the registered cluster, as
does stopping the registered cluster.
seqParallelSetup()
has no return, and seqGetParallel()
returns
getOption("seqarray.parallel", FALSE)
.
Xiuwen Zheng
seqParallel
, seqApply
library(parallel)
seqParallelSetup(2L)
# the GDS file
(gds.fn <- seqExampleFileName("gds"))
# display
(f <- seqOpen(gds.fn))
# run in parallel
summary(seqMissing(f))
# close the GDS file
seqClose(f)
seqParallelSetup(FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.