Channel

template<typename CommSpace = DefaultCommunicationSpace>
class Channel

A persistent communication channel for repeated point-to-point exchanges.

Channel binds a fixed source rank, destination rank, and message tag. After registering send and receive buffers with sendinit() and recvinit(), the user calls start() to launch all queued operations and wait() to block until they complete.

The communication pattern is established once at construction time. Subsequent start / wait cycles reuse the same endpoints and message descriptors, which lets the communication backend optimize repeated exchanges. This is particularly useful for iterative algorithms where the same point-to-point pattern is repeated every iteration.

Template Parameters:

CommSpace – The communication backend to use. Defaults to DefaultCommunicationSpace.

explicit Channel(int dest_rank, int src_rank, int tag, typename CommSpace::communicator_type comm)

Constructs a Channel with fixed endpoints.

Parameters:
  • dest_rank – The destination rank for send operations.

  • src_rank – The source rank for receive operations.

  • tag – The message tag.

  • comm – A communicator handle for the target communication backend.

template<class SendView>
void sendinit(SendView view)

Registers a send buffer with the channel.

The view’s data type determines the element type communicated. The view must remain valid until the corresponding start() has been matched by a wait().

Multiple calls accumulate into the send queue.

Template Parameters:

SendView – A Kokkos View type.

Parameters:

view – The view to register as a send buffer.

template<class RecvView>
void recvinit(RecvView view)

Registers a receive buffer with the channel.

The view’s data type determines the element type communicated. The view must remain valid until the corresponding start() has been matched by a wait().

Multiple calls accumulate into the receive queue.

Template Parameters:

RecvView – A Kokkos View type.

Parameters:

view – The view to register as a receive buffer.

void start()

Launches all queued send and receive operations.

All pending Kokkos kernel work is fenced before the communication operations are initiated, ensuring that send buffers are fully populated and receive buffers are not in use.

void wait()

Blocks until all previously started send and receive operations have completed.

Upon return, the internal request queues are consumed. To perform another exchange with the same or different buffers, register new buffers with sendinit() / recvinit() and call start() again.