################################################### ### chunk number 1: Roptions ################################################### options(width=60) options(continue=" ") ################################################### ### chunk number 2: parallelloadpackage ################################################### library(isa2) library(snow) library(Rmpi) ################################################### ### chunk number 3: paralleldata ################################################### pdata <- isa.in.silico() ################################################### ### chunk number 4: createcluster ################################################### clu <- makeMPIcluster(8) ################################################### ### chunk number 5: load isa2 package ################################################### invisible(clusterEvalQ(clu, library(isa2))) clusterExport(clu, "pdata") ################################################### ### chunk number 6: parthr ################################################### thr <- seq(1,3,by=0.2) thr.list <- expand.grid(thr, thr) ################################################### ### chunk number 7: seqrun ################################################### system.time(modules <- isa(pdata[[1]], thr.row=thr, thr.col=thr)) ################################################### ### chunk number 8: parrun ################################################### system.time(modules.par <- parApply(clu, thr.list, 1, function(x) { isa(pdata[[1]], thr.row=x[1], thr.col=x[2]) })) ################################################### ### chunk number 9: closecluster ################################################### stopCluster(clu) ################################################### ### chunk number 10: sessioninfo ################################################### toLatex(sessionInfo())