Learn R Programming

pbdBASE (version 0.5-3)

base.mksubmat: (Un)Distribute

Description

(Un)Distribute matrix.

Usage

base.mksubmat(x, descx)

base.mkgblmat(x, descx, rsrc, csrc)

Arguments

x

Matrix.

descx

ScaLAPACK descriptor array.

rsrc, csrc

Row/column source.

Details

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

Examples

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

  ### Set data matrix and desc.
  x <- matrix(as.double(1:30), nrow = 6, ncol = 5)
  dim <- dim(x)
  bldim <- c(3L, 3L)
  ldim <- base.numroc(dim = dim, bldim = bldim)
  descx <- base.descinit(dim = dim, bldim = bldim, ldim = ldim)

  ### Redistribute from rank 0.
  dx <- base.mksubmat(x, descx)
  comm.print(dx, all.rank = TRUE)

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

# }

Run the code above in your browser using DataLab