# NOT RUN {
spmd.code = "
library(pbdDMAT, quiet = TRUE)
init.grid()
# don't do this in production code
x <- matrix(rnorm(9), 3)
y <- matrix(rnorm(3))
dx <- as.ddmatrix(x)
dy <- as.ddmatrix(y)
fit <- lm.fit(x=dx, y=dy)
fit
finalize()
"
pbdMPI::execmpi(spmd.code = spmd.code, nranks=2L)
# }
Run the code above in your browser using DataCamp Workspace