# NOT RUN {
spmd.code <- "
suppressMessages(library(pbdMPI))
suppressMessages(library(pbdBASE))
init.grid()
### Do something with BLACS here.
### Don't use this unless you know what to do after this.
# blacsexit()
### Then, do others without BLACS here.
finalize() # This should be off since blacexit().
"
pbdMPI::execmpi(spmd.code = spmd.code, nranks = 2L)
# }
Run the code above in your browser using DataLab