multicore package calls within RStudio

jcborras's Avatar

jcborras

06 Apr, 2011 12:49 PM

The code below produces the following output in the RStudio console:
[1] "Single core took 16.89s. (92.42%)" select: Interrupted system call
select: Interrupted system call
select: Interrupted system call
[1] "Multicore took 8.1s. (0.37%)"

But the "select: Interrupted system call" messages do not appear when runnin a vanilla R console:
[1] "Single core took 11.58s. (94.65%)" [1] "Multicore took 5.53s. (0.36%)"

Notice the stopifnot() check at the end so it does not have an effect on the results. But I wonder if the "interrupted system call" messages above are the sign of something breaking and just a warning from some of the underlying dependencies.

And BTW fellas, thank-you for such a productive GUI.

[code] rm(list=ls())
library(multicore)

printElapsedTime <- function(ts, infostr=NULL) {
p <- round(unname(100*ts["user.self"]/ts["elapsed"]), digits=2) t <- unname(round(ts["elapsed"], digits=2)) print(paste(infostr, " took ", t,"s. (", p, "%)", sep='')) }

recursiveSum <- function(n) {
x <- sum(runif(500000,-1,1)) ifelse(n==1, 1, n+recursiveSum(n-1)) } f <- function(x) { recursiveSum(100) }

N <- 6
printElapsedTime(system.time(l1 <- lapply(c(1:N), f)), "Single core")
printElapsedTime(system.time(l2 <- mclapply(c(1:N), f, mc.cores=4 )), "Multicore")
stopifnot(Reduce(&, Map(==, l1, l2)))
[/code]

  1. Support Staff 2 Posted by Josh Paulson on 06 Apr, 2011 02:15 PM

    Josh Paulson's Avatar

    Thanks for the feedback here and the positive support. Multicore is not currently supported in RStudio and we have to look into this further for sure.

    Thanks again for reporting,

    Josh

  2. Josh Paulson closed this discussion on 06 Apr, 2011 02:15 PM.

Comments are currently closed for this discussion. You can start a new one.