demo/randmat_local.r

### SHELL> mpiexec -np 4 Rscript --vanilla [...].r

# Initial MPI.
suppressMessages(library(pbdDEMO, quietly = TRUE))
init.grid()

# Number of rows/columns
n <- 250
p <- 50


# Generate locally only what is needed.
# This will produce a different matrix because of the block cyclic 
# distribution.
comm.set.seed(1234, diff = TRUE)
dx <- ddmatrix.local("rnorm", nrow=n, ncol=p, bldim=4)

print(dx)

finalize()

Try the pbdDEMO package in your browser

Any scripts or data that you put into this service are public.

pbdDEMO documentation built on May 2, 2019, 3:33 p.m.