# NOT RUN {
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r
library(pbdDMAT)
init.grid()
x <- ddmatrix(1:100, 10, bldim=c(2, 2))
val <- getLocal(x, 5, 1)
comm.print(val, all.rank=TRUE)
val <- getLocal(x, 5, 1, all.rank=FALSE)
comm.print(val, all.rank=TRUE)
finalize()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab