if (FALSE) {
### Save code in a file "demo.r" and run with 2 processors by
### SHELL> mpiexec -np 2 Rscript demo.r
spmd.code <- "
### Initialize
suppressMessages(library(pbdMPI, quietly = TRUE))
.comm.size <- comm.size()
.comm.rank <- comm.rank()
### Examples.
info.create(0L)
info.set(0L, \"file\", \"appschema\")
info.free(0L)
### Finish.
finalize()
"
# execmpi(spmd.code, nranks = 2L)
}
Run the code above in your browser using DataLab