- Date
Sept 27, 2011
- Authors
Whit Armstrong
- Contact
- Web site
- License
GPL-3
deathstar is a distributed computing tool for R
deathstar allows distributed lapply into Amazon's EC2 cloud or across local compute nodes
- dead simple
- allows both local and remote compute nodes to be used simultaneously
A minimal example of parallel remote execution.:
require(deathstar)
estimatePi <- function(seed) {
set.seed(seed)
numDraws <- 1e5
r <- .5
x <- runif(numDraws, min=-r, max=r)
y <- runif(numDraws, min=-r, max=r)
inCircle <- ifelse( (x^2 + y^2)^.5 < r , 1, 0)
sum(inCircle) / length(inCircle) * 4
}
cluster <- c("krypton","node1","mongodb","xenon","research")
run.time <-
system.time(ans <-
zmq.cluster.lapply(cluster=cluster,
as.list(1:1e3),
estimatePi))
print(mean(unlist(ans)))
print(run.time)
print(attr(ans,"execution.report"))