|
MXL : Media eXchange Layer
MXL
|
A single endpoint connected to a target that will be created when the user adds a target to an initiator. More...
#include <RCInitiator.hpp>

Classes | |
| struct | Connected |
| The connected state. More... | |
| struct | Connecting |
| The connecting state. More... | |
| struct | Disconnected |
| The disconnected state. More... | |
| struct | Done |
| The endpoint is done and can be evicted from the initiator. More... | |
| struct | Flushing |
| The flushing state. More... | |
| struct | Idle |
| The idle state. More... | |
Public Member Functions | |
| void | activate (std::shared_ptr< CompletionQueue > const &cq, std::shared_ptr< EventQueue > const &eq) |
| Try to activate the endpoint. | |
| bool | canEvict () const noexcept |
| Returns true if the endpoint was shut down and can be evicted from the initiator. | |
| void | consume (Completion completion) |
| Consume a completion that was posted to the associated completion queue. | |
| void | consume (Event event) |
| Consume an event that was posted to the associated event queue. | |
| void | finishFlush () |
| Move the endpoint out of the flushing state when the flush is complete. | |
| bool | hasPendingWork () const noexcept |
| Returns true if there is any pending events that the endpoint is waiting for, and for which the queues must be polled. | |
| TargetInfo const & | info () const noexcept |
| Get the target info of the remote endpoint. | |
| bool | isIdle () const noexcept |
| Returns true if the endpoint is idle and could be actived. | |
| RCInitiatorEndpoint (Endpoint, std::unique_ptr< EgressProtocol > proto, TargetInfo info) | |
| Construct a new RCInitiatorEndpoint object. | |
| void | shutdown () |
| Initiate a shutdown process. | |
| void | transferGrain (std::uint64_t localIndex, std::uint64_t remoteIndex, std::uint64_t remotePayloadOffset, SliceRange const &sliceRange) |
| Post a data transfer request to this endpoint. | |
| void | transferSamples (std::uint64_t headIndex, std::size_t count) |
| Post a data transfer request to this endpoint. | |
Static Public Attributes | |
| static constexpr auto | FlushTimeout = std::chrono::seconds(2) |
| Upper bound for the flushing state. Some providers do not report a local shutdown event, and a peer that disappears may never complete the outstanding operations. | |
Private Types | |
| enum class | AfterFlush { Reconnect , Disconnect , Done } |
| The state that the endpoint goes to when a flush is complete. More... | |
| using | State = std::variant<Idle, Connecting, Connected, Flushing, Disconnected, Done> |
| The various states that the endpoint can be in are stored inside a variant that we move from and then back into when processing events. | |
Private Member Functions | |
| Idle | restart (Endpoint const &endpoint) |
| Restarts the endpoint. Produces a new Idle state from any previous state. | |
Static Private Member Functions | |
| static Flushing | startFlush (Endpoint ep, std::size_t pending, bool shutdownReceived, AfterFlush next) |
| Create a flushing state that waits for the given number of outstanding operations. | |
Private Attributes | |
| TargetInfo | _info |
| std::unique_ptr< EgressProtocol > | _proto |
| State | _state |
A single endpoint connected to a target that will be created when the user adds a target to an initiator.
Definition at line 23 of file RCInitiator.hpp.
|
private |
The various states that the endpoint can be in are stored inside a variant that we move from and then back into when processing events.
Definition at line 167 of file RCInitiator.hpp.
|
strongprivate |
The state that the endpoint goes to when a flush is complete.
Definition at line 130 of file RCInitiator.hpp.
| mxl::lib::fabrics::ofi::RCInitiatorEndpoint::RCInitiatorEndpoint | ( | Endpoint | ep, |
| std::unique_ptr< EgressProtocol > | proto, | ||
| TargetInfo | info ) |
Construct a new RCInitiatorEndpoint object.
| Endpoint | The underlying endpoint object. |
| FabricAddress | The fabric address of the remote target. |
| RemoteRegions | The remote memory regions on the target where data must be written to. |
Definition at line 27 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::activate | ( | std::shared_ptr< CompletionQueue > const & | cq, |
| std::shared_ptr< EventQueue > const & | eq ) |
Try to activate the endpoint.
The endpoint has an internal timer to slow down repeated failures to activate and/or connect. Until this timer has elapsed, the activation function will do nothing, and RCInitiatorEndpoint::isIdle() will return true. When the endpoint is eventually actived, it will have pending work until it is connected.
Definition at line 149 of file RCInitiator.cpp.
|
nodiscardnoexcept |
Returns true if the endpoint was shut down and can be evicted from the initiator.
Definition at line 43 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::consume | ( | Completion | completion | ) |
Consume a completion that was posted to the associated completion queue.
Definition at line 259 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::consume | ( | Event | event | ) |
Consume an event that was posted to the associated event queue.
Definition at line 184 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::finishFlush | ( | ) |
Move the endpoint out of the flushing state when the flush is complete.
The flush is complete when a shutdown or error event was received and all operations that were outstanding at shutdown have completed, or when FlushTimeout has elapsed since the flush started. The endpoint then goes to the state that Flushing::next selects. In any other state, this is a no-op.
Definition at line 98 of file RCInitiator.cpp.
|
nodiscardnoexcept |
Returns true if there is any pending events that the endpoint is waiting for, and for which the queues must be polled.
Definition at line 48 of file RCInitiator.cpp.
|
nodiscardnoexcept |
Get the target info of the remote endpoint.
Definition at line 33 of file RCInitiator.cpp.
|
nodiscardnoexcept |
Returns true if the endpoint is idle and could be actived.
Definition at line 38 of file RCInitiator.cpp.
|
nodiscardprivate |
Restarts the endpoint. Produces a new Idle state from any previous state.
The new endpoint has the same id as the old one, so completions of the old endpoint must not be in the completion queue anymore.
Definition at line 311 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::shutdown | ( | ) |
Initiate a shutdown process.
The endpoint will have pending work until a shutdown or error event will be received. After which it can be evicted from the initiator.
Definition at line 64 of file RCInitiator.cpp.
|
staticnodiscardprivate |
Create a flushing state that waits for the given number of outstanding operations.
Definition at line 140 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::transferGrain | ( | std::uint64_t | localIndex, |
| std::uint64_t | remoteIndex, | ||
| std::uint64_t | remotePayloadOffset, | ||
| SliceRange const & | sliceRange ) |
Post a data transfer request to this endpoint.
Definition at line 294 of file RCInitiator.cpp.
| void mxl::lib::fabrics::ofi::RCInitiatorEndpoint::transferSamples | ( | std::uint64_t | headIndex, |
| std::size_t | count ) |
Post a data transfer request to this endpoint.
Definition at line 303 of file RCInitiator.cpp.
|
private |
The target info of the remote endpoint
Definition at line 186 of file RCInitiator.hpp.
|
private |
Definition at line 185 of file RCInitiator.hpp.
|
private |
The internal state object.
Definition at line 187 of file RCInitiator.hpp.
|
staticconstexpr |
Upper bound for the flushing state. Some providers do not report a local shutdown event, and a peer that disappears may never complete the outstanding operations.
Definition at line 96 of file RCInitiator.hpp.