global all pairs {pbdMPI} | R Documentation |
This function provide global all pairs.
comm.allpairs(N, diag = FALSE, symmetric = TRUE, comm = .pbd_env$SPMD.CT$comm)
N |
number of elements for matching, |
diag |
if matching the same elements, |
symmetric |
if matching upper triangular elements. TRUE for
|
comm |
a communicator number. |
The function generates all combinations of N
elements.
The function returns a gbd matrix in row blocks with 2 columns
named i
and j
. The number of rows is dependent
on the options diag
and symmetric
. If diag = TRUE
and
symmetric = FALSE
, then this case has the maximum number of rows,
N^2
.
Wei-Chen Chen wccsnow@gmail.com, George Ostrouchov, Drew Schmidt, Pragneshkumar Patel, and Hao Yu.
Programming with Big Data in R Website: http://r-pbd.org/
comm.dist()
.
## Not run: ### Save code in a file "demo.r" and run with 2 processors by ### SHELL> mpiexec -np 2 Rscript demo.r ### Initial. suppressMessages(library(pbdMPI, quietly = TRUE)) init() ### Examples. id.matrix <- comm.allpairs(comm.size() + 1) comm.print(id.matrix, all.rank = TRUE) ### Finish. finalize() ## End(Not run)