Skip to content
Prev 1354 / 15075 Next

How to Speed up R on the G5

On 08/02/2005, at 11:44 AM, Byron Ellis wrote:
As I understand the Rmpi package it works inconjunction with SPRNG (a 
synchronised parallel RNG) and MPI libraries to allow the writing of R 
code which can run in multiple processes on more than one CPU/machine.
Normal R code only runs on one CPU but using Rmpi it should be almost 
trivially easy (once you get Rmpi to work) to get multiple MCMC chains 
to run on multiple CPUs.  Whether you can do the same with other code, 
depends on the code.  'GIL' means nothing to me I'm afraid.
Of course the way to find out is to profile the code using Shark.  I 
would take a lot of convincing that SPECint measures had much relevance 
to running simulations in R.
That is why you need Shark.  Using it shows that the MCMC spend 
extremely small amounts of time in the MCMC sampler, and lots of time 
in libm.  There are only two possible ways to speed it up:
1.  Use a better sampler which makes fewer calls to the R Weibull stuff 
and hence to libm.
and/or
2.  Replace the calls to libm with something faster (and possibly lower 
precision) such as Altivec calls.

Either or both together should work.

Bill Northcott