[R] help with random numbers and Rmpi

Faheem Mitha faheem at email.unc.edu
Mon Dec 1 22:39:59 CET 2003



On Mon, 1 Dec 2003, A.J. Rossini wrote:

> Faheem Mitha <faheem at email.unc.edu> writes:
>
> > On Mon, 1 Dec 2003, A.J. Rossini wrote:
> >
> >>
> >> use snow.
> >>
> >> The general approach highlighted in
> >>
> >> http://www.analytics.washington.edu/~rossini/courses/cph-statcomp
> >>
> >> in Lab 4 works with Rmpi as well.
> >
> > Forgive my cluelessness, but are the slaves spawned by snow R slaves or C
> > slaves? I need to work low level with C.
>
> R slaves.
>
> If you need to work with C slaves, you need to be pretty careful with
> SPRNG.
>
> Is there a reason you can't use C from R code?  If so, you get SPRNG
> for free, if not, it's a royal pain.

It would be great if I could do it that way. I've used the .C interface to
R (for example) for ages. However, I need to parallise the code at the C
level, which is where I do nearly all of the heavy lifting. More
explicitly, I want the C code to do different things on different
processors, pass data back and forth and so on, where everything would be
controlled from the R level.

My impression is that if I was to use C from R, then the parallelization
would only be done at the R level.

So, can this (parallelization at the C level) be done without running a
bunch of C slaves along the lines I had previously written? Any examples
would be helpful.

> I'd be careful about SPRNG's MPI code, as well -- works with MPICH,
> but it's been touchy with LAM-MPI, at least with the versions (LAM,
> MPICH) I've worked with.  And versions seem to be somewhat important.

Yes, the whole SPRNG thing seems rather difficult. Thanks for your help.

                                                                Faheem.




More information about the R-help mailing list