[Rd] can someone help me understand LAM/MPI and Rmpi for use on a cluster
Martin Morgan
mtmorgan at fhcrc.org
Tue Jan 3 20:08:24 CET 2006
Here's my slow response; if there were other off-list replies it would
be great to have a summary.
Not exactly sure what you're looking for. You might adopt a parallel
program so that the 'master' node does something like
myprog.c:
MPI_Init(...)
/* parallel computations, e.g., of pi */
if (myid == 0) {
MPI_Comm_get_parent(&parent);
MPI_Send( &pi, 1, MPI_DOUBLE, 0, 0, parent );
}
MPI_Finalize()
then in R
library(Rmpi)
mpi.comm.spawn("myprog", ...)
mpi.recv(...)
This launches myprog as a child of the R process, and retrieves the
result via the send/receive exchange between the spawned program and
R. An extension of this would move the mpi.comm.spawn call into a C
function you'd invoked from R with .Call(...).
This could also be developed into a kind of 'shell' package
initializing MPI and then providing parallelized functions and a
light-weight mechanism for their dispatch.
Hope that's helpful and not too misleading.
Martin
"Izmirlian, Grant (NIH/NCI) [E]" <izmirlig at mail.nih.gov> writes:
> I'm fairly astute at C and R but new to parallelization. Would someone
> be willing to provide help in the form of a simple example that parallelizes
> an R function from the inside of a C routine?
>
> If so, write me back at izmirlig at mail.nih.gov
>
> Thanks!
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
More information about the R-devel
mailing list