# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r
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)
print(fit)
finalize()
Run the code above in your browser using DataLab