Learn R Programming

pbdMPI (version 0.2-3)

global writing: Global Writing Functions

Description

These functions are global writing applying on distributed data for all ranks.

Usage

comm.write(x, file = "data", ncolumns = if(is.character(x)) 1 else 5,
             append = FALSE, sep = " ", comm = .SPMD.CT$comm)
  comm.write.table(x, file = "", append = FALSE, quote = TRUE, sep = " ",
                   eol = "", na = "NA", dec = ".", row.names = TRUE,
                   col.names = TRUE, qmethod = c("escape", "double"),
                   fileEncoding = "", comm = .SPMD.CT$comm)

comm.write.csv(..., comm = .SPMD.CT$comm) comm.write.csv2(..., comm = .SPMD.CT$comm)

x{as in write() or write.table().} file{as in write() or write.table().} ncolumns{as in write*().} append{as in write*().} sep{as in write*().} quote{as in write*().} eol{as in write*().} na{as in write*().} dec{as in write*().} row.names{as in write*().} col.names{as in write*().} qmethod{as in write*().} fileEncoding{as in write*().} ...{as in write*().} 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. Programming with Big Data in R Website: http://r-pbd.org/ [object Object],[object Object],[object Object],[object Object],[object Object] comm.load.balance() and comm.read.table() ### Save code in a file "demo.r" and run with 2 processors by ### SHELL> mpiexec -np 2 Rscript demo.r

### Initial. library(pbdMPI, quietly = TRUE) init() 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()

utility

Arguments