alltoall | R Documentation |
These functions make calls to MPI_Alltoall()
and
MPI_Alltoallv()
.
spmd.alltoall.integer(x.send, x.recv, send.count, recv.count,
comm = .pbd_env$SPMD.CT$comm)
spmd.alltoall.double(x.send, x.recv, send.count, recv.count,
comm = .pbd_env$SPMD.CT$comm)
spmd.alltoall.raw(x.send, x.recv, send.count, recv.count,
comm = .pbd_env$SPMD.CT$comm)
spmd.alltoallv.integer(x.send, x.recv, send.count, recv.count,
sdispls, rdispls, comm = .pbd_env$SPMD.CT$comm)
spmd.alltoallv.double(x.send, x.recv, send.count, recv.count,
sdispls, rdispls, comm = .pbd_env$SPMD.CT$comm)
spmd.alltoallv.raw(x.send, x.recv, send.count, recv.count,
sdispls, rdispls, comm = .pbd_env$SPMD.CT$comm)
x.send |
an object to send. |
x.recv |
an object to receive |
send.count |
send counter |
recv.count |
recv counter |
sdispls |
send dis pls |
rdispls |
recv dis pls |
comm |
a communicator number. |
These are very low level functions. Use with cautions. Neigher S4 method nor long vector is supported.
These are very low level functions. Use with cautions. Neigher S4 method nor long vector is supported.
Wei-Chen Chen wccsnow@gmail.com, George Ostrouchov, Drew Schmidt, Pragneshkumar Patel, and Hao Yu.
Programming with Big Data in R Website: https://pbdr.org/
allgather()
, allgatherv()
.
## Not run:
### Save code in a file "demo.r" and run with 2 processors by
### SHELL> mpiexec -np 2 Rscript --vanilla [...].r
spmd.code <- "
### Initialize
suppressMessages(library(pbdMPI, quietly = TRUE))
.comm.size <- comm.size()
.comm.rank <- comm.rank()
### Examples.
n <- as.integer(2)
x <- 1:(.comm.size * n)
comm.cat(\"Original x:\n\", quiet = TRUE)
comm.print(x, all.rank = TRUE)
x <- as.integer(x)
y <- spmd.alltoall.integer(x, integer(length(x)), n, n)
comm.cat(\"\nAlltoall y:\n\", quiet = TRUE)
comm.print(y, all.rank = TRUE)
### Finish.
finalize()
"
# execmpi(spmd.code, nranks = 2L)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.