Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R package that automatically uses several cores?

Tags:

r

multicore

I have noticed that R only uses one core while executing one of my programs which requires lots of calculations. I would like to take advantage of my multi-core processor to make my program run faster. I have not yet investigated the question in depth but I would appreciate to benefit from your comments because I do not have good knowledge in computer science and it is difficult for me to get easily understandable information on that subject.

Is there a package that allows R to automatically use several cores when needed?

I guess it is not that simple.

like image 656
Marco Avatar asked Jan 23 '11 17:01

Marco


People also ask

Does R automatically use multiple cores?

The operating system will indeed always assign a different core to each new R instance.

Can one program run on multiple cores?

Yes, a single process can run multiple threads on different cores. Caching is specific to the hardware. Many modern Intel processors have three layers of caching, where the last level cache is shared across cores.


1 Answers

R can only make use of multiple cores with the help of add-on packages, and only for some types of operation. The options are discussed in detail on the High Performance Computing Task View on CRAN

Update: From R Version 2.14.0 add-on packages are not necessarily required due to the inclusion of the parallel package as a recommended package shipped with R. parallel includes functionality from the multicore and snow packages, largely unchanged.

like image 73
Gavin Simpson Avatar answered Sep 19 '22 21:09

Gavin Simpson