|
MXL : Media eXchange Layer
MXL
|
A wrapper around Initiator implementations. More...
#include <Initiator.hpp>
Public Member Functions | |
| void | addTarget (TargetInfo const &targetInfo) |
| Add a target to the initiator. | |
| Initiator::MakeProgressResult | makeProgress () |
| Attempts to progress execution, including connection management and data operations. | |
| Initiator::MakeProgressResult | makeProgressBlocking (std::chrono::steady_clock::duration) |
| Attempts to progress execution, including connection management and data operations. | |
| void | removeTarget (TargetInfo const &targetInfo) |
| Remove a target from the initiator. | |
| void | setup (mxlFabricsInitiatorConfig const &config, InitiatorSetupOptions const &options={}) |
| Set up the initiator with the specified configuration. | |
| mxlFabricsInitiator | toAPI () noexcept |
| Convert this InitiatorWrapper to its API representation. | |
| void | transferGrain (std::uint64_t grainIndex, std::uint16_t startSlice, std::uint16_t endSlice) |
| Transfer a grain to all targets. | |
| void | transferGrainToTarget (Endpoint::Id targetId, std::uint64_t localIndex, std::uint64_t remoteIndex, std::uint64_t payloadOffset, std::uint16_t startSlice, std::uint16_t endSlice) |
| Transfer a grain to a specific target. | |
| void | transferSamples (std::uint64_t headIndex, std::size_t count) |
| Transfer samples to all targets. | |
| ~InitiatorWrapper () | |
| Shut down the underlying initiator before it is destroyed. | |
Static Public Member Functions | |
| static InitiatorWrapper * | fromAPI (mxlFabricsInitiator api) noexcept |
| Convert an mxlFabricsInitiator API object to its underlying InitiatorWrapper. | |
Private Member Functions | |
| void | destroyInner () noexcept |
| Shut down and destroy the underlying initiator. Errors are logged, because this runs in the destructor. | |
Private Attributes | |
| std::unique_ptr< Initiator > | _inner |
A wrapper around Initiator implementations.
This wrapper creates an unspecified initiator that can be configured for a specific type by calling the setup() method.
Definition at line 120 of file Initiator.hpp.
| mxl::lib::fabrics::ofi::InitiatorWrapper::~InitiatorWrapper | ( | ) |
Shut down the underlying initiator before it is destroyed.
Definition at line 17 of file Initiator.cpp.
| void mxl::lib::fabrics::ofi::InitiatorWrapper::addTarget | ( | TargetInfo const & | targetInfo | ) |
Add a target to the initiator.
The is a non-blocking operation. The local endpoint for this target will only actively start connecting to its remote counterpart when control is passed to makeProgress() or makeProgressBlocking(). The local endpoint for this target will only accept write requests after the progress functions return false.
Definition at line 64 of file Initiator.cpp.
|
privatenoexcept |
Shut down and destroy the underlying initiator. Errors are logged, because this runs in the destructor.
Definition at line 22 of file Initiator.cpp.
|
staticnodiscardnoexcept |
Convert an mxlFabricsInitiator API object to its underlying InitiatorWrapper.
| api | The mxlFabricsInitiator to convert. |
Definition at line 41 of file Initiator.cpp.
| Initiator::MakeProgressResult mxl::lib::fabrics::ofi::InitiatorWrapper::makeProgress | ( | ) |
Attempts to progress execution, including connection management and data operations.
This is the non-blocking version of the progress function.
Definition at line 115 of file Initiator.cpp.
| Initiator::MakeProgressResult mxl::lib::fabrics::ofi::InitiatorWrapper::makeProgressBlocking | ( | std::chrono::steady_clock::duration | timeout | ) |
Attempts to progress execution, including connection management and data operations.
This is the blocking version of the progress function.
Definition at line 125 of file Initiator.cpp.
| void mxl::lib::fabrics::ofi::InitiatorWrapper::removeTarget | ( | TargetInfo const & | targetInfo | ) |
Remove a target from the initiator.
This is a non-blocking operation. The target is only removed after makeProgress() or makeProgressBlocking() returns false.
Definition at line 74 of file Initiator.cpp.
| void mxl::lib::fabrics::ofi::InitiatorWrapper::setup | ( | mxlFabricsInitiatorConfig const & | config, |
| InitiatorSetupOptions const & | options = {} ) |
Set up the initiator with the specified configuration.
This method initializes the underlying initiator implementation based on the provided configuration.
| config | The configuration to use for setting up the initiator. |
| options | Optional tuning parameters (e.g. completion queue depth). |
Definition at line 51 of file Initiator.cpp.
|
nodiscardnoexcept |
Convert this InitiatorWrapper to its API representation.
Definition at line 46 of file Initiator.cpp.
| void mxl::lib::fabrics::ofi::InitiatorWrapper::transferGrain | ( | std::uint64_t | grainIndex, |
| std::uint16_t | startSlice, | ||
| std::uint16_t | endSlice ) |
Transfer a grain to all targets.
This is a non-blocking operation. The transfer is complete only after makeProgress() or makeProgressBlocking() returns false.
| grainIndex | The index of the grain to transfer. |
| startSlice | The start slice in the slice range to transfer. This is inclusive. |
| endSlice | The end slice in the slice range to transfer. This is exclusive. |
Definition at line 84 of file Initiator.cpp.
| void mxl::lib::fabrics::ofi::InitiatorWrapper::transferGrainToTarget | ( | Endpoint::Id | targetId, |
| std::uint64_t | localIndex, | ||
| std::uint64_t | remoteIndex, | ||
| std::uint64_t | payloadOffset, | ||
| std::uint16_t | startSlice, | ||
| std::uint16_t | endSlice ) |
Transfer a grain to a specific target.
This is a non-blocking operation. The transfer is complete only after makeProgress() or makeProgressBlocking() returns false.
| targetId | The ID of the target to transfer the grain to. |
| localIndex | The index of the local grain to transfer from. |
| remoteIndex | The index of the remote grain to transfer to. |
| payloadOffset | The payload offset within the grain. |
| startSlice | The start slice in the slice range to transfer. This is inclusive. |
| endSlice | The end slice in the slice range to transfer. This is exclusive. |
Definition at line 94 of file Initiator.cpp.
| void mxl::lib::fabrics::ofi::InitiatorWrapper::transferSamples | ( | std::uint64_t | headIndex, |
| std::size_t | count ) |
Transfer samples to all targets.
This is a non-blocking operation. The transfer is complete only after makeProgress() or makeProgressBlocking() returns false.
| headIndex | The head index to transfer. |
| count | The number of samples per channel to transfer. |
Definition at line 105 of file Initiator.cpp.
|
private |
The underlying initiator implementation.
Definition at line 186 of file Initiator.hpp.