base.ownany: Determining Local Ownership of a Distributed Matrix

Description Usage Arguments Details Value Examples

View source: R/dims.r

Description

For advanced users only. See pbdDMAT for high-level functions.

Usage

1
base.ownany(dim, bldim, ICTXT = 0)

Arguments

dim

global dimension

bldim

blocking dimension

ICTXT

BLACS context

Details

A simple wrapper of numroc. The return is the answer to the question 'do I own any of the global matrix?'. Passing a distributed matrix is allowed, but often it is convenient to determine that information without even having a distributed matrix on hand. In this case, explicitly passing the appropriate information to the arguments dim=, bldim= (and CTXT= as necessary, since it defaults to 0) while leaving x missing will produce the desired result. See the examples below for more clarity.

The return for each function is local.

Value

TRUE or FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spmd.code <- "
  suppressMessages(library(pbdMPI))
  suppressMessages(library(pbdBASE))
  init.grid()

  iown <- base.ownany(dim=c(4, 4), bldim=c(4, 4), ICTXT=0)
  comm.print(iown, all.rank = TRUE)

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

pbdBASE documentation built on March 26, 2020, 9:37 p.m.