[R] mcapply not using more than 1 core

joe meiring josephmeiring at gmail.com
Wed Aug 28 07:54:24 CEST 2013


This does speed up on an OsX install, so something must be wacky with the 
linux install. Any ideas as to what would cause this? 

On Tuesday, August 27, 2013 4:19:31 PM UTC-7, joe meiring wrote:
>
> I can't seem to get mclapply to use more than a single core. I have a 64 
> core server running Linux. 
>
> Fore example: 
>
> library(parallel) 
>
> test <- lapply(1:100,function(x) rnorm(10000)) 
> system.time(x <- lapply(test,function(x) loess.smooth(x,x))) 
> system.time(x <- mclapply(test,function(x) loess.smooth(x,x), 
> mc.cores=32)) 
>
> gives me: 
>
>    user  system elapsed 
>   0.000   0.000   7.441 
>    user  system elapsed 
>   0.000   0.000   8.868 
>
> i.e. mclapply is taking longer than lapply(). What is going wrong here? 
>
>         [[alternative HTML version deleted]] 
>
> ______________________________________________ 
> R-help at r-project.org mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help 
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html 
> and provide commented, minimal, self-contained, reproducible code. 
>


More information about the R-help mailing list