MPIX_Enqueue_start

Enqueue an MPI Stream Triggered start operations into an MPIX_Queue object.

Definitions

C/C++ Synopsis

int MPIX_Enqueue_start(const MPIX_Queue queue)

Arguments

queue                IN              Already created valid MPIX_Queue object associated with the start operation

Description

MPIX_Enqueue_start enqueues a trigger event into the MPIX_Queue object. The MPIX_Enqueue_start operation will not immediately trigger all previously enqueued message descriptors associated with the MPIX_Queue object. Instead, this operation schedules the previously enqueued message descriptors on MPIX_Queue for execution.

A valid queue object is expected to be part of the MPIX_Enqueue_start operation and anything else would result in undefined behavior. A valid queue object denotes the stream handles associated with the queue object is active.

An MPIX_Enqueue_start operation without any previously enqueued messaging operation will result in an unnecessary trigger event executed by the GPU Control Processor in stream order.

MPIX_Enqueue_start is a non-blocking operation with respect to the application process.

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