MPI_Irecv
Nonblocking reception of data from a node
Syntax
MPI_Irecv(rank, tag) MPI_Irecv(rank, tag, comm=mpi_comm)
Arguments
- rank
The rank. TODO
- tag
The tag. TODO
- comm=mpi_comm
If the optional argument "comm" is given, this function will use the MPI communicator created by MPI_Create_comm. If not, the default MPI_COMM_WORLD is used.
Description
Receive a variable from a specified node in a nonblock (asynchronous) way. The value is usually sent by the function MPI_Isend.
Note that, due to its asynchronous nature, MPI_Irecv does not return any value. The value sent by the source node will be returned by MPI_Wait.
Technical implementation
For more information on the implementation of Scilab/MPI, please see Technical details about the implementation
Examples
MPI_Init(); rnk = MPI_Comm_rank(); sizeNodes = MPI_Comm_size(); SLV = rnk; Master = ~ SLV; assert_checkequal(MPI_Comm_size(), 2); if Master for slaveId = 1:sizeNodes-1 value = slaveId*2 MPI_Isend(value, slaveId, 42); end else rankSource = 0; tag = 0; MPI_Irecv(rankSource, tag, 42); // MPI_Irecv does not return any value value = MPI_Wait(42) // the value will be returned by MPI_Wait assert_checkequal(value,2); end MPI_Finalize(); exit()
See also
Report an issue | ||
<< MPI_Init | Scilab MPI | MPI_Isend >> |