MPIX_Enqueue_send
Enqueue an MPI Stream Triggered send operations into an MPIX_Queue object.
Definitions
C/C++ Synopsis
int MPIX_Enqueue_send(const void *buf,
int count,
MPI_Datatype datatype,
int dest,
int tag,
MPI_Comm comm,
MPIX_Queue queue,
MPI_Request *request)
Arguments
buf IN Buffer to send
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_send operation enqueues an MPI Stream Triggered send operation into the specified MPIX_Queue object. MPIX_Enqueue_send 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_send operation. Once this communication descriptor is enqueued, the MPIX_Enqueue_send operation returns immediately.
Completion status of an ST operation can be queried by the application process via the MPI_Test or MPI_Wait operations using the valid request handle that was returned from the MPIX_Enqueue_send operation.
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