Type: | Package |
Title: | Foreach Parallel Adaptor for 'parallel' |
Version: | 1.3.8 |
Description: | Provides a parallel backend for the %dopar% function using the multicore functionality of the parallel package. |
Depends: | R (≥ 2.14.0), foreach(≥ 1.2.0), iterators(≥ 1.0.0), parallel |
Imports: | utils |
Enhances: | compiler, RUnit |
License: | GPL-2 |
NeedsCompilation: | no |
Packaged: | 2022-01-16 18:26:44 UTC; folashade |
Author: | Folashade Daniel [cre], Revolution Analytics [aut, cph], Steve Weston [aut] |
Maintainer: | Folashade Daniel <fdaniel@microsoft.com> |
OS_type: | unix |
Repository: | CRAN |
Date/Publication: | 2022-02-05 00:30:24 UTC |
The doMC Package
Description
The doMC package provides a parallel backend for the foreach/%dopar% function using the multicore functionality of the parallel package.
Details
Further information is available in the following help topics:
registerDoMC | register doMC to be used by foreach/%dopar% |
To see a tutorial introduction to the doMC package,
use vignette("gettingstartedMC")
. To see a tutorial
introduction to the foreach package, use vignette("foreach")
.
To see a demo of doMC computing the sinc function,
use demo(sincMC)
.
Some examples (in addition to those in the help pages) are included in
the “examples” directory of the doMC package. To list the files in
the examples directory,
use list.files(system.file("examples", package="doMC"))
.
To run the bootstrap example, use
source(system.file("examples", "bootMC.R", package="doMC"))
.
This is a simple benchmark, executing both sequentally and in parallel.
There are many more examples that come with the foreach package,
which will work with the doMC package if it is registered as the
parallel backend.
For a complete list of functions with individual help pages,
use library(help="doMC")
.
registerDoMC
Description
The registerDoMC
function is used to register the multicore
parallel backend with the foreach
package.
Usage
registerDoMC(cores=NULL, ...)
Arguments
cores |
The number of cores to use for parallel execution. If not
specified, the number of cores is set to the value of
|
... |
Package options. Currently, only the |
Details
The multicore
functionality, originally written by Simon Urbanek and
subsumed in the parallel
package in R 2.14.0, provides functions
for parallel execution of R code on machines with multiple cores or
processors, using
the system fork
call to spawn copies of the current process. The
multicore
functionality, and therefore registerDoMC
, should
not be used
in a GUI environment, because multiple processes then share the same GUI.