-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpbd-linalg.R
More file actions
40 lines (29 loc) · 750 Bytes
/
pbd-linalg.R
File metadata and controls
40 lines (29 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## @knitr pbd-linalg
library(pbdDMAT, quiet = TRUE )
n <- 4096*2
# if you are putting multiple processes on node
# you may want to prevent threading of the linear algebra:
# library(RhpcBLASctl)
# blas_set_num_threads(1)
# (or do by passing OMP_NUM_THREADS to mpirun)
init.grid()
if(comm.rank()==0) print(date())
# pbd allows for parallel I/O, but here
# we keep things simple and distribute
# an object from one process
if(comm.rank() == 0) {
x <- rnorm(n^2)
dim(x) <- c(n, n)
} else x <- NULL
dx <- as.ddmatrix(x)
timing <- comm.timer(sigma <- crossprod(dx))
if(comm.rank()==0) {
print(date())
print(timing)
}
timing <- comm.timer(out <- chol(sigma))
if(comm.rank()==0) {
print(date())
print(timing)
}
finalize()