pcoords {pbdBASE} | R Documentation |
Grabs the existing BLACS context grid information.
base.pnum(ICTXT, PROW, PCOL) base.pcoord(ICTXT, PNUM)
ICTXT |
BLACS context number. |
PROW, PCOL |
BLACS grid location row/column |
PNUM |
process rank |
For advanced users only. These functions are simple recreations of the BLACS
routines BLACS_PNUM
and BLACS_PCOORD
. The former gets the
process number associated with the BLACS process grid location
c(MYPROW, MYPCOL)
, while the latter does the reverse.
pnum
returns an integer; pcoord
returns a list
containing elements PROW
and PCOL
.
spmd.code = " suppressMessages(library(pbdBASE)) init.grid() blacs_ <- blacs(ICTXT = 0) # get the ICTXT = 0 BLACS coordsinates for process 0 myCoords <- base.pcoord(ICTXT = 0, PNUM = 0) comm.print(myCoords) finalize() " pbdMPI::execmpi(spmd.code = spmd.code, nranks = 2L)