Skip to content
Prev 26571 / 63424 Next

Cell or PS3 Port

I have been experimenting with ways of parallelizing many of the
functions in the math library.  There are two experimental packages
available in http://www.stat.uiowa.edu/~luke/R/experimental: pnmath,
based on OpenMP, and pnmath0, based on basic pthreads.  I'm not sure
to what degree the approach there would carry over to GPUs or Cell
where the additional processors are different from the main processor
and may not share memory (I forget how that works on Cell).

The first issue is that you need some modifications to the some
functions to ensure they are thread-safe.  For the most part these are
minor; a few functions would require major changes and I have not
tackled them for now (Bessel functions, wilcox, signrank I believe).
RNG functions are also not suitable for parallelization given the
dependence on the sequential underlying RNG.

It is not too hard to get parallel versions to use all available
processor cores. The challenge is to make sure that the parallel
versions don't run slower than the serial versions. They may if the
amount of data is too small.  What is too small for each function
depends on the OS and the processor/memory architecture; if memory is
not shared this gets more complicated still.  For some very simple
functions (floor, ceiling, sign) I could not see any reliable benefit
of parallelization for reasonable data sizes on the systems I was
using so I left those alone for now.

luke
On Sat, 27 Oct 2007, Ed Knutson wrote: