I think the chosen answer is too general and actually not accurate, since it didn't touch the detail of doParallel
package itself. If you read the vignettes, it's actually pretty clear.
The parallel package is essentially a merger of the multicore
package, which was written by Simon Urbanek, and the snow package,
which was written by Luke Tierney and others. The multicore
functionality supports multiple workers only on those operating
systems that support the fork system call; this excludes Windows. By
default, doParallel uses multicore functionality on Unix-like systems
and snow functionality on Windows.
We will use snow-like functionality in this vignette, so we start by
loading the package and starting a cluster
To use multicore-like functionality, we would specify the number of
cores to use instead
In summary, this is system dependent. Cluster is the more general mode cover all platforms, and cores is only for unix-like system.
To make the interface consistent, the package used same function for these two modes.
> library(doParallel)
> cl <- makeCluster(4)
> registerDoParallel(cl)
> getDoParName()
[1] "doParallelSNOW"
> registerDoParallel(cores=4)
> getDoParName()
[1] "doParallelMC"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…