# NOT RUN {
spmd.code <- "
suppressMessages(library(pbdMPI))
suppressMessages(library(pbdBASE))
init.grid()
### get the ICTXT = 0 BLACS coordsinates for process 3
myCoords <- base.pcoord(ICTXT = 0, PNUM = 3)
comm.print(myCoords)
### get the ICTXT = 1 BLACS coordsinates for process 3
myCoords <- base.pcoord(ICTXT = 1, PNUM = 3)
comm.print(myCoords)
### get the ICTXT = 2 BLACS coordsinates for process 3
myCoords <- base.pcoord(ICTXT = 2, PNUM = 3)
comm.print(myCoords)
finalize()
"
pbdMPI::execmpi(spmd.code = spmd.code, nranks = 4L)
# }
Run the code above in your browser using DataLab