doSMP pulled

March 1, 2012

(This article was first published on CYBAEA Data, and kindly contributed to R-bloggers)

They have finally pulled that buggy unreliable piece of code that was doSMP from the CRAN mirrors while (I hear) Revolutions are re-writing it. To use all your cores for analysis on the Windows platform, you can try doSNOW instead; my code is something like the fragment below. Neither option is as attractive as doMC on anything-but-Windows platforms, but sometimes you have to work with legacy systems.

if (.Platform$OS.type != "windows" && require("multicore")) {
} else if (FALSE &&                     # doSMP is buggy
           require("doSMP")) {
    w <- startWorkers()
    on.exit(stopWorkers(w), add = TRUE)
} else if (require("doSNOW")) {
    cl <- snow::makeCluster(4, type = "SOCK")
    on.exit(snow::stopCluster(cl), add = TRUE)
} else {

Change the number 4 to the number of cores that you want to use on the machine. The explicit name space (snow::) is to avoid confusion if you load the “parallel” package or any of the other packages that also define a makeCluster() function.

I hope Revolutions does a good job on the new version: it needs some love.

To leave a comment for the author, please follow the link and comment on their blog: CYBAEA Data. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)