[R] No speed up using the parallel package and ncpus > 1 with boot() on linux machines

Chris Evans chrishold at psyctc.org
Sun Oct 18 11:23:42 CEST 2015



----- Original Message -----
> From: "Milan Bouchet-Valat" <nalimilan at club.fr>
> To: "Chris Evans" <chrishold at psyctc.org>, r-help at r-project.org
> Sent: Saturday, 17 October, 2015 18:13:40
> Subject: Re: [R] No speed up using the parallel package and ncpus > 1 with boot() on linux machines

> Le samedi 17 octobre 2015 à 17:18 +0100, Chris Evans a écrit :
>> I think I am failing to understand how boot() uses the parallel
>> package on linux machines, using R 3.2.2 on three different machines
>> with 2, 4 and 8 cores all results in a slow down if I use "multicore"
>> and "ncpus".  Here's the code that creates a very simple reproducible
>> example:
... rest of my post deleted to save space ...

> Parallel execution is useful only when the operation you want to run
> takes enough time. Here, starting the workers takes more time than
> computing the means. You should try with a larger number of replicates,
> or a slower computation.
> 

Aha.  Makes perfect sense of course and explains what I'm seeing both for this and the real work which also involves bootstrapping a pretty simple function.

Merci Milan,

Chris



More information about the R-help mailing list