XTC2Traits
XTC2Traits
Section titled “XTC2Traits”#include <sbio/formats/xtc2/xtc2_traits.hh>struct XTC2TraitsDefined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:57
Inherits:
BaseTraits
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
MetadataInventory |
variable |
Declared here |
HeaderSize |
variable |
Declared here |
MaxRank |
variable |
Declared here |
MaxNameSize |
variable |
Declared here |
PartitioningStrategy |
variable |
Declared here |
RoleCount |
variable |
Declared here |
DataAccessPtnCount |
variable |
Declared here |
ExhaustedSentinel |
variable |
Declared here |
make_stream_brokers |
function |
Declared here |
get_payload_size |
function |
Declared here |
discover_metadata |
function |
Declared here |
resolve_data |
function |
Declared here |
populate_offsets |
function |
Declared here |
get_allocation_request |
function |
Declared here |
max_batch_count |
function |
Declared here |
open_streams |
function |
Declared here |
discover_metadata |
function |
Declared here |
sync_vars |
function |
Declared here |
index_stream |
function |
Declared here |
fetch_step |
function |
Declared here |
fetch_multi_steps |
function |
Declared here |
fetch_multi_steps_stride |
function |
Declared here |
get_data_in_buffer |
function |
Declared here |
capacity |
function |
Declared here |
current_buffer |
function |
Declared here |
Roles |
enum |
Declared here |
DataAccessPtn |
enum |
Declared here |
DataUnit |
typedef |
Declared here |
StepIdxType |
typedef |
Declared here |
BrokerBufferRequirements |
typedef |
Declared here |
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
struct SBIO_API |
MetadataInventory |
The struct to hold maps for fast data lookup. This should be flat and allow for O(1) retrieval of offsets into a a datagram for a combination of (Detector, Algorithm, Field) |
MetadataInventory
Section titled “MetadataInventory”struct SBIO_API MetadataInventoryDefined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:244
The struct to hold maps for fast data lookup. This should be flat and allow for O(1) retrieval of offsets into a a datagram for a combination of (Detector, Algorithm, Field)
Public Static Attributes
Section titled “Public Static Attributes”| Return | Name | Description |
|---|---|---|
constexpr std::size_t |
HeaderSize static constexpr |
|
constexpr std::uint16_t |
MaxRank static constexpr |
|
constexpr std::uint16_t |
MaxNameSize static constexpr |
|
constexpr StreamPartitioningStrategy |
PartitioningStrategy static constexpr |
|
constexpr std::size_t |
RoleCount static constexpr |
|
constexpr std::size_t |
DataAccessPtnCount static constexpr |
|
constexpr StepIdxType |
ExhaustedSentinel static constexpr |
HeaderSize
Section titled “HeaderSize”static constexpr
constexpr std::size_t HeaderSize { 24 }Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:62
MaxRank
Section titled “MaxRank”static constexpr
constexpr std::uint16_t MaxRank { 10 }Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:63
MaxNameSize
Section titled “MaxNameSize”static constexpr
constexpr std::uint16_t MaxNameSize { 256 }Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:64
PartitioningStrategy
Section titled “PartitioningStrategy”static constexpr
constexpr StreamPartitioningStrategy PartitioningStrategy {
}Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:69
RoleCount
Section titled “RoleCount”static constexpr
constexpr std::size_t RoleCount { 2 }Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:75
DataAccessPtnCount
Section titled “DataAccessPtnCount”static constexpr
constexpr std::size_t DataAccessPtnCount { 3 }Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:83
ExhaustedSentinel
Section titled “ExhaustedSentinel”static constexpr
constexpr StepIdxType ExhaustedSentinel { static_cast<>(-1) }Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:87
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
bool |
make_stream_brokers static inline |
|
SBIO_HD std::size_t |
get_payload_size static inline |
|
SBIO_HD void |
discover_metadata static |
|
SBIO_HDDataResult |
resolve_data static |
|
SBIO_HD std::size_t |
populate_offsets static |
Traverse a datagram to populate transition and event offsets. The datagram should come from a .smd.xtc2 file. This should be called in a loop if you want to load many offsets. |
SBIO_HDAllocationRequest< XTC2Traits > |
get_allocation_request static inline |
|
SBIO_HD std::size_t |
max_batch_count static inline |
|
SBIO_HDIOStatus |
open_streams static inline |
|
SBIO_HDIOStatus |
discover_metadata static inline |
|
SBIO_HD auto |
sync_vars static inline |
|
SBIO_HDIOStatus |
index_stream static inline |
|
SBIO_HDIOStatus |
fetch_step static inline |
|
SBIO_HDIOStatus |
fetch_multi_steps static inline |
|
SBIO_HDIOStatus |
fetch_multi_steps_stride static inline |
|
SBIO_HDDataResult |
get_data_in_buffer static inline |
|
SBIO_HD auto |
capacity static inline |
|
SBIO_HD auto |
current_buffer static inline |
make_stream_brokers
Section titled “make_stream_brokers”static inline
template<typename DS> static inline bool make_stream_brokers(DS & ds, const DataSourceParameters & ds_params, StreamParameters & base_cfg)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:111
get_payload_size
Section titled “get_payload_size”static inline
static inline SBIO_HD std::size_t get_payload_size(void * buf)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:246
discover_metadata
Section titled “discover_metadata”static
static SBIO_HD void discover_metadata(DataUnit * buffer, MetadataInventory & inv, std::size_t offset)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:250
resolve_data
Section titled “resolve_data”static
static SBIO_HDDataResult resolve_data(void * buffer, const MetadataInventory & inv, const DataRequest & req)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:254
populate_offsets
Section titled “populate_offsets”static
static SBIO_HD std::size_t populate_offsets(DataUnit * dg, DiscoveryState & state, std::size_t beginning_offset, EventOffset * l1_offsets_buf, TransitionOffset * transition_offsets_buf, std::size_t access_offset = 0)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:272
Traverse a datagram to populate transition and event offsets. The datagram should come from a .smd.xtc2 file. This should be called in a loop if you want to load many offsets.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
dg |
[DataUnit](#dataunit-2) * |
The datagram to traverse |
state |
[DiscoveryState](api-sbio-XTC2Traits-DiscoveryState.md#discoverystate-2) & |
A reference to a state tracking variable to maintain a history of offsets and indices seen. |
l1_offsets_buf |
[EventOffset](api-sbio-XTC2Traits-EventOffset.md#eventoffset-2) * |
The L1Accept offsets buffer - the state will tell us where to index into this buffer to record the new offset from dg |
transition_offsets_buf |
[TransitionOffset](api-sbio-XTC2Traits-TransitionOffset.md#transitionoffset-1) * |
The transition offsets buffer - the state will tell us where to index into this buffer to record the new offset from dg |
get_allocation_request
Section titled “get_allocation_request”static inline
static inline SBIO_HDAllocationRequest< XTC2Traits > get_allocation_request(StreamParameters & cfg)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:279
max_batch_count
Section titled “max_batch_count”static inline
static inline SBIO_HD std::size_t max_batch_count(StreamParameters & cfg)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:292
open_streams
Section titled “open_streams”static inline
template<IOTraits IO> static inline SBIO_HDIOStatus open_streams(Stream< IO, XTC2Traits > * streams, const StreamParameters & cfg)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:297
discover_metadata
Section titled “discover_metadata”static inline
template<IOTraits IO, class StorageViewT> static inline SBIO_HDIOStatus discover_metadata(Stream< IO, XTC2Traits > * streams, StorageViewT & storage, MetadataInventory & inv)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:311
sync_vars
Section titled “sync_vars”static inline
static inline SBIO_HD auto sync_vars(DiscoveryState & state)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:332
index_stream
Section titled “index_stream”static inline
template<IOTraits IO, class StorageViewT> static inline SBIO_HDIOStatus index_stream(Stream< IO, XTC2Traits > * streams, StorageViewT & storage, DiscoveryState & stream_state, const StreamParameters & cfg)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:337
fetch_step
Section titled “fetch_step”static inline
template<IOTraits IO, class StorageViewT> static inline SBIO_HDIOStatus fetch_step(Stream< IO, XTC2Traits > * streams, StorageViewT & storage, DiscoveryState & stream_state, const StreamParameters & cfg, StepIdxType step_idx, DataAccessPtn ptn)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:414
fetch_multi_steps
Section titled “fetch_multi_steps”static inline
template<IOTraits IO, class StorageViewT> static inline SBIO_HDIOStatus fetch_multi_steps(Stream< IO, XTC2Traits > * streams, StorageViewT & storage, DiscoveryState & stream_state, const StreamParameters & cfg, StepIdxType step_idx, StepIdxType count, DataAccessPtn ptn)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:548
fetch_multi_steps_stride
Section titled “fetch_multi_steps_stride”static inline
template<IOTraits IO, class StorageViewT> static inline SBIO_HDIOStatus fetch_multi_steps_stride(Stream< IO, XTC2Traits > * streams, StorageViewT & storage, DiscoveryState & stream_state, const StreamParameters & cfg, StepIdxType step_idx, StepIdxType count, StepIdxType stride, DataAccessPtn ptn)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:627
get_data_in_buffer
Section titled “get_data_in_buffer”static inline
template<class StorageViewT> static inline SBIO_HDDataResult get_data_in_buffer(StorageViewT & storage, const MetadataInventory & inv, const DataRequest & req, DataAccessPtn ptn, std::size_t batch_idx = 0)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:647
capacity
Section titled “capacity”static inline
template<class StorageViewT> static inline SBIO_HD auto capacity(const StorageViewT & storage, const DiscoveryState & state)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:739
current_buffer
Section titled “current_buffer”static inline
template<class StorageViewT> static inline SBIO_HD auto current_buffer(StorageViewT & storage, const DiscoveryState & state)Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:745
Public Types
Section titled “Public Types”| Name | Description |
|---|---|
Roles |
|
DataAccessPtn |
|
DataUnit |
|
StepIdxType |
|
BrokerBufferRequirements |
Specify all the buffers that are required to implement a reader of XTC2. We need to hold: |
enum RolesDefined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:74
| Value | Description |
|---|---|
SMD |
|
BD |
DataAccessPtn
Section titled “DataAccessPtn”enum DataAccessPtnDefined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:78
| Value | Description |
|---|---|
L1Accept |
|
SlowUpdate |
|
BeginStep |
DataUnit
Section titled “DataUnit”using DataUnit = XTC2::DgramDefined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:85
StepIdxType
Section titled “StepIdxType”using StepIdxType = std::size_tDefined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:86
BrokerBufferRequirements
Section titled “BrokerBufferRequirements”using BrokerBufferRequirements = TypeList< BufferDescriptor< MetadataRole, 0, sizeof(XTC2::Dgram)>, BufferDescriptor< MetadataRole, 1, sizeof(XTC2::Dgram)>, BufferDescriptor< DataRole, 0, sizeof(XTC2::Dgram)>, BufferDescriptor< IndexRole, 0, sizeof(EventOffset)>, BufferDescriptor< IndexRole, 1, sizeof(TransitionOffset)> >Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:181
Specify all the buffers that are required to implement a reader of XTC2. We need to hold:
-
Transition datagrams
-
Event datagrams
-
Event offsets
-
Transition offsets
The execution policy will determine how to fulfill allocation and synchronization of these requested buffers.