Class TransportSession

Inheritance Relationships

Derived Types

Class Documentation

class TransportSession

Stateful transport session shared by the controller and coprocessor roles.

Methods must be called in this order:

  1. connect - bring up QPs + the out-of-band channel

  2. alloc_memory - register the region (needs the connected context)

  3. exchange_keys - swap region handles over the out-of-band channel

  4. establish_channel - program the channel from the local + peer regions

  5. (coprocessor) set_coprocessor_fn before start()

  6. start / collect / stop

Subclassed by catalyst::transport::ControllerSession, catalyst::transport::CoprocessorSession

Public Functions

virtual ~TransportSession() = default
virtual int connect(const ConnectInfo &info) = 0

Bring up the connection (out-of-band handshake and QP transition to RTS).

Parameters:

info – Peer address and out-of-band port.

Returns:

int

virtual MemRegion alloc_memory(std::size_t size, MemKind kind) = 0

Allocate and register a memory region on the device.

Parameters:
  • size – Size of the region in bytes.

  • kind – Memory kind selecting the allocation and registration path.

Returns:

MemRegion The allocated and registered region.

virtual PeerRef exchange_keys(const MemRegion &local) = 0

Advertise a local region and receive the peer’s region over the out-of-band channel.

Parameters:

local – The local region to advertise.

Returns:

PeerRef The peer’s advertised region.

virtual void establish_channel(const ChannelDesc &desc, const MemRegion &local, const PeerRef &peer) = 0

Program the data movement this session will run (single channel per session).

Parameters:
  • desc – Channel configuration.

  • local – The local memory region.

  • peer – The peer’s memory region.

virtual void start() = 0

Launch the engine (non-blocking; runs until stop()).

virtual int collect(void *const *replies, const std::uint64_t *replies_bytes, std::size_t n) = 0

Wait for a result and scatter it into the reply buffers.

Parameters:
  • replies – Array of n buffers to write the results into.

  • replies_bytes – Array of n capacities (bytes), one per reply buffer.

  • n – Number of reply buffers.

Returns:

int

virtual void stop() = 0

Stop the engine and join. Idempotent.

inline virtual std::uint64_t last_rtt_ns() const

Last round-trip time, in nanoseconds (for testing purposes).

Returns:

std::uint64_t