Hi all!

If you look at doMPI and its vignettes, you will find lots of info.

Also, I have a function that does that.

[hodgess@grid bin]$ cat ar2.R
library(doMPI)
cl <- startMPIcluster()
registerDoMPI(cl)
n <- 10000
phi1 <- (-0.7)
opts <- list(chunkSize=100)
set.seed(279)
zz <- foreach(i=1:n,.combine=rbind,.options.mpi=opts) %dopar% {
        a1 <- rnorm(800)
        u <- numeric(length=360)
        for(j in 2:360) {
                u[j] <- phi1*u[j-1] + a1[200+j]
        }

 x <- ts(u,start=1975,freq=12)
 y <- aggregate(x,nfreq=4,sum)
 gg <- try(arima(y,order=c(1,0,1)),silent=TRUE)
if(inherits(gg, "try-error"))gg <- arima(y,order=c(0,0,0))
 c(gg$model$phi,gg$sigma2,gg$model$theta)
 }
     print(list(mean=mean(zz[,1]),sd=sd(zz[,1])/sqrt(n),
        sig=mean(zz[,2]),sds=sd(zz[,2])/sqrt(n),
        theta=mean(zz[,3]),thetas=sd(zz[,3])/sqrt(n)))

     closeCluster(cl)


Hope this helps!
Sincerely,
Erin



Erin M. Hodgess, PhD
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgesse@uhd.edu



-----Original Message-----
From: r-sig-hpc-bounces@r-project.org on behalf of Mark Kimpel
Sent: Tue 1/26/2010 8:27 AM
To: r-sig-hpc
Subject: [R-sig-hpc] "chunking" parallel tasks
 
I have seen references on this list to "chunking" parallel tasks. If I am
interpreting this correctly that is to decrease the overhead of multiple
system calls. For instance, if I  have a loop of 10000 simple tasks and 10
processors, then 10 chunks of 1000 would be processed.

Which of the parallel packages has the ability to take "chunk" (or its
equivalent) as an argument? I've googled chunk with R and come up with
everything but want I'm interested in.

Thanks,
Mark

Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN  46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 399-1219 Skype No Voicemail please

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-hpc mailing list
R-sig-hpc@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-hpc


	[[alternative HTML version deleted]]

