pbdBASE (version 0.5-0)

gridinfo: Get BLACS Context Grid Information

Description

Grabs the existing BLACS context grid information.

Usage

base.blacs(ICTXT = 0)

blacs(ICTXT = 0)

Arguments

ICTXT

BLACS context number.

Value

Returns a list with 5 elements: NPROW and NPCOL, the number of process rows and columns respectively; ICTXT, the associated BLACS context number; MYROW and MYCOL, the current process' row and column position in the process grid.

Details

BLACS contexts have important internal use, and advanced users familiar with ScaLAPACK might find some advantage in directly manipulating these process grids. Most users should not need to directly manage BLACS contexts, in this function or elsewhere.

The function effectively serves as a shorthand for

eval(parse(text=paste(".__blacs_gridinfo_", ICTXT, sep="")))

Examples

Run this code
# NOT RUN {
spmd.code = "
  suppressMessages(library(pbdBASE))
  init.grid()

  mygrid <- blacs(0)

  pbdMPI::comm.print(mygrid)

  finalize()
"
 
pbdMPI::execmpi(spmd.code = spmd.code, nranks = 2L)

# }

Run the code above in your browser using DataLab