|
|
@ -2,7 +2,7 @@ if ( !is.loaded("mpi_initialize") ){ |
|
|
|
library(Rmpi) |
|
|
|
} |
|
|
|
|
|
|
|
number_of_plots = 5 |
|
|
|
number_of_plots = 10 |
|
|
|
nodes = mpi.universe.size()-1 |
|
|
|
mpi.spawn.Rslaves(nslaves=nodes) |
|
|
|
|
|
|
@ -11,7 +11,7 @@ generate_plot <- function(filename){ |
|
|
|
samples = rep(NA, 100000) |
|
|
|
for ( i in 1:100000 ){ samples[i] = mean(rexp(40, 0.2)) } |
|
|
|
|
|
|
|
jpeg(paste('plots/', filename, '.jpg', sep="")) |
|
|
|
jpeg(paste('plots/plot', filename, '.jpg', sep="")) |
|
|
|
|
|
|
|
hist(samples, main="", prob=T) |
|
|
|
lines(density(samples), col="darkblue", lwd=3) |
|
|
|