GroupTopology
GroupTopology
Section titled “GroupTopology”#include <sbio/core/topology.hh>template<IsStreamBroker BrokerType, hd_std::size_t MaxSegments = 128>struct GroupTopologyDefined in src/lib/sbio/core/topology.hh:124
The layout, post any sorting, of all segment references in a BrokerGroup.
The topology organization is established once during the DISCOVERY state transition when metadata is parsed.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
char |
group_name |
|
char |
group_type |
|
hd_std::array< BrokerType *, MaxSegments > |
stream_brokers |
|
hd_std::array< DataAccessPtn, MaxSegments > |
broker_access_ptns |
|
hd_std::size_t |
num_stream_brokers |
|
hd_std::array< SegmentRef< BrokerType >, MaxSegments > |
segments |
|
hd_std::size_t |
num_segments |
|
StepMapping |
step_mapping |
|
DataAccessPtn |
align_ptn |
Pattern whose steps define the group’s steps when AlignTo is used. |
group_name
Section titled “group_name”char group_name[256]Defined in src/lib/sbio/core/topology.hh:147
group_type
Section titled “group_type”char group_type[256]Defined in src/lib/sbio/core/topology.hh:148
stream_brokers
Section titled “stream_brokers”hd_std::array< BrokerType *, MaxSegments > stream_brokers { nullptr }Defined in src/lib/sbio/core/topology.hh:150
broker_access_ptns
Section titled “broker_access_ptns”hd_std::array< DataAccessPtn, MaxSegments > broker_access_ptns {}Type: hd_std::array< DataAccessPtn, MaxSegments >
Defined in src/lib/sbio/core/topology.hh:151
num_stream_brokers
Section titled “num_stream_brokers”hd_std::size_t num_stream_brokers { 0 }Defined in src/lib/sbio/core/topology.hh:152
segments
Section titled “segments”hd_std::array< SegmentRef< BrokerType >, MaxSegments > segments {}Type: hd_std::array< SegmentRef< BrokerType >, MaxSegments >
Defined in src/lib/sbio/core/topology.hh:154
num_segments
Section titled “num_segments”hd_std::size_t num_segments { 0 }Defined in src/lib/sbio/core/topology.hh:155
step_mapping
Section titled “step_mapping”StepMapping step_mapping { StepMapping::PerKind }Type: StepMapping
Defined in src/lib/sbio/core/topology.hh:157
align_ptn
Section titled “align_ptn”DataAccessPtn align_ptn {}Type: DataAccessPtn
Defined in src/lib/sbio/core/topology.hh:158
Pattern whose steps define the group’s steps when AlignTo is used.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
SBIO_HD bool |
empty const inline |
|
SBIO_HD |
GroupTopology |
Defaulted member function. |
SBIO_HD |
GroupTopology inline |
|
SBIO_HDIOStatus |
map_step inline |
Translate the group’s (already remapped) step index into the ordinal to fetch. |
SBIO_HD const SegmentRef< BrokerType > & |
active_segment const inline |
Retrieve the correct, active, StreamBroker for a specified step. |
SBIO_HD BrokerType * |
active_stream_broker inline |
Retrieve the correct, active, StreamBroker for a specified step. |
SBIO_HD const DataAccessPtn & |
active_access_ptn inline |
Retrieve the correct DataAccessPtn for the currently active StreamBroker. |
SBIO_HD const hd_std::size_t |
remap_step_idx inline |
Remap a specific step index to account for StreamBroker inactivity and types. |
SBIO_HD const SegmentRef< BrokerType > & |
segment const inline |
|
SBIO_HD void |
set_segment inline |
|
SBIO_HD void |
set_stream_broker inline |
|
SBIO_HD BrokerType * |
broker_for_segment inline |
|
SBIO_HDDataAccessPtn & |
pattern_for_segment inline |
|
SBIO_HD BrokerType * |
stream_broker inline |
|
SBIO_HD const DataAccessPtn & |
access_ptn const inline |
const inline
inline SBIO_HD bool empty() constDefined in src/lib/sbio/core/topology.hh:160
GroupTopology
Section titled “GroupTopology”SBIO_HD GroupTopology() = defaultDefined in src/lib/sbio/core/topology.hh:164
Defaulted member function.
GroupTopology
Section titled “GroupTopology”inline
inline SBIO_HD GroupTopology(const char * name, const char * type, hd_std::array< SegmentRef< BrokerType >, MaxSegments > segs, hd_std::size_t n_segs)Defined in src/lib/sbio/core/topology.hh:166
map_step
Section titled “map_step”inline
inline SBIO_HDIOStatus map_step(const SegmentRef< BrokerType > & seg, hd_std::size_t step_idx, hd_std::size_t & ordinal)Defined in src/lib/sbio/core/topology.hh:334
Translate the group’s (already remapped) step index into the ordinal to fetch.
Returns
Section titled “Returns”Whether the remap translation was successful.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
seg |
const SegmentRef< BrokerType > & |
The SegmentRef to fetch the orginal for. |
step_idx |
hd_std::size_t |
The already properly remapped step index. |
ordinal |
hd_std::size_t & |
The ordinal to fetch. |
active_segment
Section titled “active_segment”const inline
inline SBIO_HD const SegmentRef< BrokerType > & active_segment(hd_std::size_t step_idx, hd_std::size_t broker_no) constDefined in src/lib/sbio/core/topology.hh:369
Retrieve the correct, active, StreamBroker for a specified step.
Depending on the data format and various traits and strategies, not all StreamBrokers may be active/available for every step. This function translates a request for a specific broker, for a specific step, into the correct active StreamBroker.
Returns
Section titled “Returns”The active StreamBroker - this may more may not correspond to the StreamBroker indicated by broker_no.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
step_idx |
hd_std::size_t |
The step for which the active broker is needed. |
broker_no |
hd_std::size_t |
The uncorrected index for the StreamBroker. |
active_stream_broker
Section titled “active_stream_broker”inline
inline SBIO_HD BrokerType * active_stream_broker(hd_std::size_t step_idx, hd_std::size_t broker_no)Defined in src/lib/sbio/core/topology.hh:407
Retrieve the correct, active, StreamBroker for a specified step.
Depending on the data format and various traits and strategies, not all StreamBrokers may be active/available for every step. This function translates a request for a specific broker, for a specific step, into the correct active StreamBroker.
Returns
Section titled “Returns”The active StreamBroker - this may more may not correspond to the StreamBroker indicated by broker_no.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
step_idx |
hd_std::size_t |
The step for which the active broker is needed. |
broker_no |
hd_std::size_t |
The uncorrected index for the StreamBroker. |
active_access_ptn
Section titled “active_access_ptn”inline
inline SBIO_HD const DataAccessPtn & active_access_ptn(hd_std::size_t step_idx, hd_std::size_t broker_no)Defined in src/lib/sbio/core/topology.hh:432
Retrieve the correct DataAccessPtn for the currently active StreamBroker.
Depending on the data format and various traits and strategies, not all StreamBrokers may be active/available for every step. This function translates a request for a specific broker, for a specific step, into the correct active StreamBroker and returns its associated DataAccessPtn.
Returns
Section titled “Returns”The DataAccessPtn for the active StreamBroker.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
step_idx |
hd_std::size_t |
The step for which the active broker is needed. |
broker_no |
hd_std::size_t |
The uncorrected index for the StreamBroker. |
remap_step_idx
Section titled “remap_step_idx”inline
inline SBIO_HD const hd_std::size_t remap_step_idx(hd_std::size_t step_idx)Defined in src/lib/sbio/core/topology.hh:465
Remap a specific step index to account for StreamBroker inactivity and types.
Depending on the data format and various traits and strategies, not all StreamBrokers may be active/available for every step. As a result, the step indices may increment faster than the logical count of steps (because it is simultaneously counting steps, and cycling between active brokers). This function will appropriately remap an uncorrected step index to account for this.
Furthermore, all data formats are required to use a type (StepIdxType) that can be converted into a simple integral value (size_t). How this conversion is done is not explicitly specified - this function will convert the index to a size_t. Anything downstream of this can use size_t instead of the data format specific types.
Returns
Section titled “Returns”The ‘corrected’ step index, accounting for any StreamBroker activity cycling, and in a size_t integral format.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
step_idx |
hd_std::size_t |
The unadjusted step index. |
segment
Section titled “segment”const inline
inline SBIO_HD const SegmentRef< BrokerType > & segment(hd_std::size_t seg_no) constDefined in src/lib/sbio/core/topology.hh:479
set_segment
Section titled “set_segment”inline
inline SBIO_HD void set_segment(hd_std::size_t seg_no, SegmentRef< BrokerType > & seg)Defined in src/lib/sbio/core/topology.hh:482
set_stream_broker
Section titled “set_stream_broker”inline
inline SBIO_HD void set_stream_broker(hd_std::size_t broker_no, BrokerType * broker, DataAccessPtn ptn)Defined in src/lib/sbio/core/topology.hh:485
broker_for_segment
Section titled “broker_for_segment”inline
inline SBIO_HD BrokerType * broker_for_segment(hd_std::size_t seg_no)Defined in src/lib/sbio/core/topology.hh:493
pattern_for_segment
Section titled “pattern_for_segment”inline
inline SBIO_HDDataAccessPtn & pattern_for_segment(hd_std::size_t seg_no)Defined in src/lib/sbio/core/topology.hh:496
stream_broker
Section titled “stream_broker”inline
inline SBIO_HD BrokerType * stream_broker(hd_std::size_t broker_no)Defined in src/lib/sbio/core/topology.hh:500
access_ptn
Section titled “access_ptn”const inline
inline SBIO_HD const DataAccessPtn & access_ptn(hd_std::size_t broker_no) constDefined in src/lib/sbio/core/topology.hh:503
Public Static Attributes
Section titled “Public Static Attributes”| Return | Name | Description |
|---|---|---|
constexpr StreamPartitioningStrategy |
strategy static constexpr |
strategy
Section titled “strategy”static constexpr
constexpr StreamPartitioningStrategy strategy { DataFormat::PartitioningStrategy }Type: constexpr StreamPartitioningStrategy
Defined in src/lib/sbio/core/topology.hh:143
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
SBIO_HDGroupTopology< BrokerType, MaxSegments > |
build_topology static inline |
Build the GroupTopology for the requested name. |
build_topology
Section titled “build_topology”static inline
static inline SBIO_HDGroupTopology< BrokerType, MaxSegments > build_topology(const char * name, BrokerType * brokers, hd_std::size_t num_brokers)Defined in src/lib/sbio/core/topology.hh:206
Build the GroupTopology for the requested name.
The available StreamBrokers will have their metadata queried to test if they belong to the requested named group. (There is a wildcard placeholder which will incorporate all of the broker/segments into the group, but this is currently fragile as the various segments must actually have the same shape.)
Returns
Section titled “Returns”The constructed GroupTopology which can be used to create a BrokerGroup.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name |
const char * |
The name to build the topology for. |
brokers |
BrokerType * |
The available StreamBrokers to organize into the topology. |
num_brokers |
hd_std::size_t |
The number of available StreamBrokers. |
Public Types
Section titled “Public Types”| Name | Description |
|---|---|
DataFormat |
The type of data being read. |
DataAccessPtn |
The type of the enumerator used to specify access patterns used for the format. |
StepIdxType |
The type used to request a specific step from the Stream. |
DataFormat
Section titled “DataFormat”using DataFormat = typename BrokerType::DataFormatDefined in src/lib/sbio/core/topology.hh:128
The type of data being read.
DataAccessPtn
Section titled “DataAccessPtn”using DataAccessPtn = typename DataFormat::DataAccessPtnDefined in src/lib/sbio/core/topology.hh:133
The type of the enumerator used to specify access patterns used for the format.
StepIdxType
Section titled “StepIdxType”using StepIdxType = typename DataFormat::StepIdxTypeDefined in src/lib/sbio/core/topology.hh:141
The type used to request a specific step from the Stream.
This type is required and guaranteed to be convertible std::size_t; however, different data format’s may use different underlying types.