This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
| bdrp | |
|---|---|
| Paradigm | SPMD andMPMD |
| Designed by | Wei-Chen Chen, George Ostrouchov, Pragneshkumar Patel, and Drew Schmidt |
| Developer | pbdR Core Team |
| First appeared | September 2012; 13 years ago (2012-09) |
| Preview release | |
| Typing discipline | Dynamic |
| OS | Cross-platform |
| License | General Public License andMozilla Public License |
| Website | www |
| Influenced by | |
| R,C,Fortran,MPI, andØMQ | |
Programming with Big Data in R (pbdR)[1] is a series ofR packages and an environment forstatistical computing withbig data by using high-performance statistical computation.[2][3] The pbdR uses the same programming language as R withS3/S4 classes and methods which is used amongstatisticians anddata miners for developingstatistical software. The significant difference between pbdR and R code is that pbdR mainly focuses ondistributed memory systems, where data are distributed across several processors and analyzed in abatch mode, while communications between processors are based onMPI that is easily used in largehigh-performance computing (HPC) systems. R system mainly focuses[citation needed] on singlemulti-core machines for data analysis via an interactive mode such asGUI interface.
Two main implementations inR usingMPI are Rmpi[4] and pbdMPI of pbdR.
The idea ofSPMD parallelism is to let every processor do the same amount of work, but on different parts of a large data set. For example, a modernGPU is a large collection of slower co-processors that can simply apply the same computation on different parts of relatively smaller data, but the SPMD parallelism ends up with an efficient way to obtain final solutions (i.e. time to solution is shorter).[5]
Programming with pbdR requires usage of various packages developed by pbdR core team. Packages developed are the following.
| General | I/O | Computation | Application | Profiling | Client/Server |
|---|---|---|---|---|---|
| pbdDEMO | pbdNCDF4 | pbdDMAT | pmclust | pbdPROF | pbdZMQ |
| pbdMPI | pbdADIOS | pbdBASE | pbdML | pbdPAPI | remoter |
| pbdSLAP | hpcvis | pbdCS | |||
| kazaam | pbdRPC |

Among these packages, pbdMPI provides wrapper functions toMPI library, and it also produces ashared library and a configuration file for MPI environments. All other packages rely on this configuration for installation and library loading that avoids difficulty of library linking and compiling. All other packages can directly use MPI functions easily.
Among those packages, the pbdDEMO package is a collection of 20+ package demos which offer example uses of the various pbdR packages, and contains a vignette that offers detailed explanations for the demos and provides some mathematical or statistical insight.
Hello World! Save the following code in a file called "demo.r"
### Initial MPIlibrary(pbdMPI,quiet=TRUE)init()comm.cat("Hello World!\n")### Finishfinalize()
and use the command
mpiexec-np2Rscriptdemo.rto execute the code whereRscript is one of command line executable program.
The following example modified from pbdMPI illustrates the basicsyntax of the language of pbdR.Since pbdR is designed inSPMD, all the R scripts are stored in files and executed from the command line via mpiexec, mpirun, etc. Save the following code in a file called "demo.r"
### Initial MPIlibrary(pbdMPI,quiet=TRUE)init().comm.size<-comm.size().comm.rank<-comm.rank()### Set a vector x on all processors with different valuesN<-5x<-(1:N)+N*.comm.rank### All reduce x using summation operationy<-allreduce(as.integer(x),op="sum")comm.print(y)y<-allreduce(as.double(x),op="sum")comm.print(y)### Finishfinalize()
and use the command
mpiexec-np4Rscriptdemo.rto execute the code whereRscript is one of command line executable program.
The following example modified from pbdDEMO illustrates the basic ddmatrix computation of pbdR which performssingular value decomposition on a given matrix.Save the following code in a file called "demo.r"
# Initialize process gridlibrary(pbdDMAT,quiet=T)if(comm.size()!=2)comm.stop("Exactly 2 processors are required for this demo.")init.grid()# Setup for the remaindercomm.set.seed(diff=TRUE)M<-N<-16BL<-2# blocking --- passing single value BL assumes BLxBL blockingdA<-ddmatrix("rnorm",nrow=M,ncol=N,mean=100,sd=10)# LA SVDsvd1<-La.svd(dA)comm.print(svd1$d)# Finishfinalize()
and use the command
mpiexec-np2Rscriptdemo.rto execute the code whereRscript is one of command line executable program.
{{cite tech report}}: CS1 maint: multiple names: authors list (link){{cite tech report}}: CS1 maint: multiple names: authors list (link){{cite web}}:|author= has generic name (help)CS1 maint: numeric names: authors list (link){{cite web}}: CS1 maint: numeric names: authors list (link){{cite web}}: CS1 maint: numeric names: authors list (link){{cite web}}: CS1 maint: multiple names: authors list (link)