Learn R Programming

pmclust (version 0.1-2)

printmpi: Print Function

Description

This function will print a variable from specified processors, by default messages will be shown on screen.

Usage

printmpi(..., COMM.SHOW = 0)

Arguments

...
a variable to be printed.
COMM.SHOW
specified ranks to display messages.

Value

  • A print will be called for the specified processors and the messages of the input variables will be shown on screen by default.

Details

COMM.SHOW can be a vector containing the ranks of processors which will print messages.

References

High Performance Statistical Computing Website: http://thirteen-01.stat.iastate.edu/snoweye/hpsc/

See Also

catmpi.

Examples

Run this code
# Save code in a file "demo.r" and run in 4 processors by
# > mpirun -np 4 Rscript demo.r

### Setup mpi environment.
library(Rmpi)
library(pmclust)
invisible(mpi.comm.dup(0, 1))

### Generate an example data.
COMM.RANK <- mpi.comm.rank()
printmpi(COMM.RANK, COMM.SHOW = c(1, 2))

### Quit Rmpi.
mpi.quit()

Run the code above in your browser using DataLab