Learn R Programming

pbdMPI (version 0.2-3)

wait: Wait Functions

Description

The functions call MPI wait functions.

Usage

wait(request = .SPMD.CT$request, status = .SPMD.CT$status)
  waitany(count, status = .SPMD.CT$status)
  waitsome(count)
  waitall(count)

Arguments

request
a request number.
status
a status number.
count
a count number.

Value

  • An invisible state of MPI call is returned.

Details

These functions are for internal uses. Potentially, they wait after some nonblocking MPI calls.

References

Programming with Big Data in R Website: http://r-pbd.org/

Examples

Run this code
### 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()
.comm.size <- comm.size()
.comm.rank <- comm.rank()

### Examples.
N <- 5
x <- (1:N) + N * .comm.rank
if(.comm.rank == 0){
  isend(list(x))
}
if(.comm.rank == 1){
  y <- irecv(list(x))
}
wait()
comm.print(y, rank.print = 1L)

### Finish.
finalize()

Run the code above in your browser using DataLab