Hello again.


I am working on yet another project.  I have a small script which generates random numbers in Rmpi.  I have it running nicely on a server.

I would also like to run this from the web.  However, it gets hung up on the mpi.spawn.Rslave statement.  I am using the FastRWeb and Rserver as produced by Simon Urbanek and described in Jay Emerson's blog.

#Good stuff
args <- commandArgs(TRUE)
n <- as.integer(args[1])
m <- as.integer(args[2])
library(Rmpi)
source("mpi3.R")
yy <- mpi3(n,m)
yy

mpi3 <- function(n=2,m=4) {


library(Rmpi)



library(FastRWeb)
if(mpi.comm.size(1)>0) {
    mpi.close.Rslaves()
}
else {
mpi.spawn.Rslaves(quiet=TRUE,nslaves=n)
}

mpi.setup.rngstream()

z <- mpi.remote.exec(rnorm,m)
mpi.close.Rslaves()
mpi.exit()
save.image()
return(z)
}


#Bad Stuff
run <- function(n=2,m=4,...) {
n <- as.integer(n)

library(FastRWeb)
host <- tolower(system("hostname -s",TRUE))
oprint(host)
if(mpi.comm.size(1)>0) {
    mpi.close.Rslaves()
}
xx <- paste("Rscript mpi-wrapper.R", n, m,sep=" ")
oprint(xx)
oprint(system(xx,intern=FALSE))

out("<b>Hello</b>")
done()


}


Thanks for any help!

Sincerely,
Erin









	[[alternative HTML version deleted]]

