Skip to content

XTC2Traits

#include <sbio/formats/xtc2/xtc2_traits.hh>
struct XTC2Traits

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:57

Inherits: BaseTraits

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
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)

struct SBIO_API MetadataInventory

Defined 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)

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

static constexpr

constexpr std::size_t HeaderSize { 24 }

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:62


static constexpr

constexpr std::uint16_t MaxRank { 10 }

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:63


static constexpr

constexpr std::uint16_t MaxNameSize { 256 }

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:64


static constexpr

constexpr StreamPartitioningStrategy PartitioningStrategy {
}

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:69


static constexpr

constexpr std::size_t RoleCount { 2 }

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:75


static constexpr

constexpr std::size_t DataAccessPtnCount { 3 }

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:83


static constexpr

constexpr StepIdxType ExhaustedSentinel { static_cast<>(-1) }

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:87

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

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


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


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


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


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.

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

static inline

static inline SBIO_HDAllocationRequest< XTC2Traits > get_allocation_request(StreamParameters & cfg)

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:279


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


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


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


static inline

static inline SBIO_HD auto sync_vars(DiscoveryState & state)

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:332


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


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


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


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


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


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


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

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 Roles

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:74

Value Description
SMD
BD

enum DataAccessPtn

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:78

Value Description
L1Accept
SlowUpdate
BeginStep

using DataUnit = XTC2::Dgram

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:85


using StepIdxType = std::size_t

Defined in src/lib/sbio/formats/xtc2/xtc2_traits.hh:86


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:

  1. Transition datagrams

  2. Event datagrams

  3. Event offsets

  4. Transition offsets

The execution policy will determine how to fulfill allocation and synchronization of these requested buffers.