Learn R Programming

pbdBASE (version 0.1-1)

Coords: Interchange Between Process Number and BLACS Coordinates

Description

Grabs the existing BLACS context grid information.

Usage

pnum(ICTXT, PROW, PCOL)
  pcoord(ICTXT, PNUM)

Arguments

ICTXT
BLACS context number.
PROW, PCOL
BLACS grid location row/column
PNUM
process rank

Value

  • pnum returns an integer; pcoord returns a list containing elements PROW and PCOL.

Details

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.

See Also

BLACS, InitGrid

Examples

Run this code
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

library(pbdBASE, quiet = TRUE)
init.grid()

blacs_ <- blacs(ICTXT = 0)

# get the ICTXT = 0 BLACS coordsinates for process 0
myCoords <- pcoord(ICTXT = 0, PNUM = 0)

comm.print(myCoords)

finalize()

Run the code above in your browser using DataLab