MPIX_Create_queue

Creates and initializes a MPIX_Queue object with device stream information.

Definitions

C/C++ Synopsis

int MPIX_Create_queue(void *stream, MPIX_Queue *queue)

Arguments

stream       IN              GPU stream handle passed as input
queue        OUT     MPIX_Queue object created as part of MPIX_Create_queue operation

Description

For a given GPU device stream handle, MPIX_Create_queue creates a queue object. Stream Triggered MPI operations are performed with a specific MPIX_Queue object. The stream information passed as part of the queue creation operation cannot be modified until the MPIX_Queue object is freed. It is the user’s responsibility to maintain an active GPU device stream until the queue is freed. The status of the queue object is undefined when the associated GPU device stream is destroyed before the associated queue object is freed.

Return Values

None.

Examples

C/C++ Example

Example code snippet showing the usage of MPIX_Create_queue and MPIX_Free_queue.

MPIX_Queue queue;
hipStream_t stream;
hipStreamCreateWithFlags(&stream, hipStreamNonBlocking);
MPIX_Create_queue(MPI_COMM_WORLD_DUP, (void *)stream, &queue);

/* Use MPI queue object for any stream-based communication */

MPIX_Free_queue(queue);
hipStreamDestroy(stream);