MPIX_Enqueue_recv
Enqueue an MPI Stream Triggered receive operations into an MPIX_Queue object.
Definitions
C/C++ Synopsis
int MPIX_Enqueue_recv(void *buf,
int count,
MPI_Datatype datatype,
int source,
int tag,
MPI_Comm comm,
MPIX_Queue queue,
MPI_Request *request)
Arguments
buf IN Buffer to receive
count IN Number of elements to send
datatype IN Type of one buffer element
dest IN Rank of the target MPI process
tag IN Tag assigned to the message
comm IN Communicator handle
queue IN MPIX_Queue associated with the enqueued message
request OUT Request handle on the send operation taking place
Description
MPIX_Enqueue_recv operation enqueues an MPI Stream Triggered receive operation into the MPIX_Queue object. MPIX_Enqueue_recv is non-blocking with respect to the application process. Internally, the MPI implementation creates a communication descriptor that encapsulates the details of the communication operation defined by the user in the MPIX_Enqueue_recv operation.
Completion status of a stream triggered receive operation can be queried by using the MPI_Test and MPI_Wait operation using the valid request handle that is returned as part of the MPIX_Enqueue_receive operation. Note that the MPIX_Enqueue_recv operation does not support the use of MPI_ANY_SOURCE and MPI_ANY_TAG flags for the source and tag arguments, respectively.
Return Values
None.
Examples
C/C++ Example
Example code snippet showing the usage of basic stream triggered communication operations.
MPIX_Queue queue;
hipStream_t stream;
hipStreamCreateWithFlags(&stream, hipStreamNonBlocking);
MPIX_Create_queue(MPI_COMM_WORLD_DUP, (void *)stream, &queue);
if (my_rank == 0) {
launch_device_kernel(src_buf, stream);
MPIX_Enqueue_send(src_buf, SIZE, MPI_INT, 0, 123, queue, &sreq);
MPIX_Enqueue_start(queue); /* Enqueue_start enables the triggering of
* prior send operations */
MPIX_Enqueue_wait(queue);
} else if (my_rank == 1) {
MPIX_Enqueue_recv(dst_buf, SIZE, MPI_INT, 1, 123, queue, &rreq);
MPIX_Enqueue_start(queue);
MPIX_Enqueue_wait(queue); /* wait blocks only the current GPU stream
*/
launch_device_kernel(dst_buf, stream);
}
hipStreamSynchronize(stream); /* wait for all operations on Stream to