as.matrix: Distributed object to Matrix Converters

Description Usage Arguments Details Value Examples

Description

Converts a distributed matrix into a non-distributed matrix.

Usage

1
2
## S4 method for signature 'ddmatrix'
as.matrix(x, proc.dest = "all", attributes = TRUE)

Arguments

x

numeric distributed matrix

proc.dest

destination process for storing the matrix

attributes

logical, specifies whether or not the current attributes should be preserved.

...

Additional arguments.

Details

The proc.dest= argument accepts either the BLACS grid position or the MPI rank if the user desires a single process to own the matrix. Alternatively, passing the default value of 'all' will result in all processes owning the matrix. If only a single process owns the undistributed matrix, then all other processes store NULL for that object.

Value

Returns an ordinary R matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
spmd.code = "
  library(pbdDMAT, quiet = TRUE)
  init.grid()
  
  dx <- ddmatrix(1:16, ncol=4, bldim=2)
  y <- as.matrix(dx, proc.dest=0)
  
  comm.print(y)
  
  finalize()
"

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

pbdDMAT documentation built on May 1, 2019, 6:34 p.m.