global writing | R Documentation |
These functions are global writing applying on distributed data for all ranks.
comm.write(x, file = "data", ncolumns = if(is.character(x)) 1 else 5,
append = FALSE, sep = " ", comm = .pbd_env$SPMD.CT$comm)
comm.write.table(x, file = "", append = FALSE, quote = TRUE, sep = " ",
eol = "\n", na = "NA", dec = ".", row.names = TRUE,
col.names = TRUE, qmethod = c("escape", "double"),
fileEncoding = "", comm = .pbd_env$SPMD.CT$comm)
comm.write.csv(..., comm = .pbd_env$SPMD.CT$comm)
comm.write.csv2(..., comm = .pbd_env$SPMD.CT$comm)
x |
as in |
file |
as in |
ncolumns |
as in |
append |
as in |
sep |
as in |
quote |
as in |
eol |
as in |
na |
as in |
dec |
as in |
row.names |
as in |
col.names |
as in |
qmethod |
as in |
fileEncoding |
as in |
... |
as in |
comm |
a communicator number. |
These functions will apply write*()
locally and sequentially
from rank 0, 1, 2, ...
By default, rank 0 makes the file, and rest of ranks append the data.
A file will be returned.
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/
comm.load.balance()
and
comm.read.table()
## Not run:
### Save code in a file "demo.r" and run with 2 processors by
### SHELL> mpiexec -np 2 Rscript demo.r
spmd.code <- "
### Initialize
suppressMessages(library(pbdMPI, quietly = TRUE))
if(comm.size() != 2){
comm.cat(\"2 processors are requried.\n\", quiet = TRUE)
finalize()
}
### Examples.
comm.write((1:5) + comm.rank(), file = \"test.txt\")
### 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.