Learn R Programming

pmclust (version 0.1-2)

catmpi: cat function

Description

This function will cat messages from specified processors, by default messages will be shown on screen.

Usage

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

Arguments

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

Value

  • A cat will be called for the specified processors in COMM.SHOW and the messages will be shown on screen by default.

Details

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

References

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

See Also

printmpi.

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()
catmpi("I am ", COMM.RANK, "\n", COMM.SHOW = c(1, 2))

### Quit Rmpi.
mpi.quit()

Run the code above in your browser using DataLab