MPI_RECV


MPI_RECV (buf, count, datatype, source, tag, comm, status) 
[ OUT buf] initial address of receive buffer (choice) 
[ IN count] number of elements in receive buffer (integer) 
[ IN datatype] datatype of each receive buffer element (handle) 
[ IN source] rank of source or MPI_ANY_SOURCE (integer) 
[ IN tag] message tag or MPI_ANY_TAG (integer)
[ IN comm] communicator (handle) 
[ OUT status] status object (Status) 

Code            int MPI_Recv(void* buf, int count, MPI_Datatype datatype, 
                int source, int tag, MPI_Comm comm, MPI_Status *status)

MPI_RECV blocks a process until it receives a message from the process ranked source in the communicator comm with message tag tag. Wild cards MPI_ANY_SOURCE and MPI_ANY_FLAG can be used to receive messages. If a wild card is used, the returned status can be used to determine the actual source and tag. The received message is placed in a receive buffer, which consists of the storage containing count consecutive elements of the type specified by datatype, starting at address buf . The length of the received message must be less than or equal to the length of the available receive buffer.