SnowfastParam-class | R Documentation |
This class provides a enhanced version of the SnowParam
parallel backend from BiocParallel
based on the newer PSOCK cluster implementation from the parallel
package.
## Instance creation
SnowfastParam(workers = snowWorkers(),
tasks = 0L, stop.on.error = TRUE, progressbar = FALSE,
RNGseed = NULL, timeout = WORKER_TIMEOUT,
exportglobals = TRUE, exportvariables = TRUE,
resultdir = NA_character_, jobname = "BPJOB",
force.GC = FALSE, fallback = TRUE, useXDR = FALSE,
manager.hostname = NA_character_, manager.port = NA_character_, ...)
## Additional methods documented below
workers |
Either the number of workers or the names of cluster nodes. |
tasks |
The number of tasks per job. See |
stop.on.error |
Enable stop on error. See |
progressbar |
Enable text progress bar. See |
RNGseed |
The seed for random number generation. See |
timeout |
Time (in seconds) allowed for workers to complete a task. See |
exportglobals |
Export |
exportvariables |
Automatically export variables defined in the global environment and used by the function? See |
resultdir |
Job results directory. See |
jobname |
The name of the job for logging and results. See |
force.GC |
Whether to invoke the garbage collector after each call to |
fallback |
Fall back to using |
useXDR |
Should data be converted to network byte order when serializing from the manager to the workers? The default ( |
manager.hostname |
Host name of the manager node. |
manager.port |
Port on the manager with which workers communicate. |
... |
Additional arguments passed to |
SnowfastParam
is a faster but somewhat more limited version of SnowParam
. Like SnowParam
, it uses simple network of workstations (SNOW)-style parallelism so that it is available on all operating systems.
The workers are initialized in parallel, so cluster startup can often be significantly faster than SnowParam
if utilizing a large number of workers.
Because the workers are started using makePSOCKcluster
from the parallel
package rather than using BiocParallel
's startup script, some features of BiocParallel
-managed backends such as logging are unsupported or only partially available.
The default parameter useXDR=TRUE
assumes that all nodes are little endian so that data can be sent to workers without the overhead of conversion to network byte order. This should result in overall faster performance for large datasets on compatible clusters.
SnowfastParam
is intended to be used as a drop-in replacement for SnowParam
in most situations and as a more stable alternative to MulticoreParam
for long-running jobs in graphical environments like RStudio where forking the R process should be avoided.
An parallel backend derived from class BiocParallelParam
.
BiocParallelParam
methods:
bpstart(x):
Start the cluster.
bpstop(x):
Stop the cluster.
Additional methods documented in BiocParallelParam
.
Kylie A. Bemis
SnowParam
,
MulticoreParam
x <- replicate(1000, runif(200), simplify=FALSE)
bp <- SnowfastParam(workers=4, tasks=20, progressbar=TRUE)
ans <- chunkLapply(x, sum, BPPARAM=bp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.