Skip to content

XTC1Traits

#include <sbio/formats/xtc1/xtc1_traits.hh>
struct XTC1Traits

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:42

Inherits: BaseTraits

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

Type: struct SBIO_API

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:167

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 { 40 }

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:46


static constexpr

constexpr std::uint16_t MaxRank { 10 }

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:47


static constexpr

constexpr std::uint16_t MaxNameSize { 256 }

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:48


static constexpr

constexpr StreamPartitioningStrategy PartitioningStrategy {
StreamPartitioningStrategy::Chronological
}

Type: constexpr StreamPartitioningStrategy

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:53


static constexpr

constexpr std::size_t RoleCount { 2 }

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:59


static constexpr

constexpr std::size_t DataAccessPtnCount { 3 }

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:67


static constexpr

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

Type: constexpr StepIdxType

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:71

Return Name Description
SBIO_HD std::size_t initialize_streams static
SBIO_HD std::size_t find_detector_segments 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.

static

static SBIO_HD std::size_t initialize_streams(StreamParameters & base_cfg, std::string_view exp, unsigned run)

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:183


static inline

template<class DataBrokerType, class SegmentRef> static inline SBIO_HD std::size_t find_detector_segments(const MetadataInventory & inv, const char * name, SegmentRef * ref_out, std::size_t max_out, DataBrokerType * broker, char * dettype = nullptr, DataAccessPtn ptn = DataAccessPtn::L1Accept)

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:189


static inline

static inline SBIO_HD std::size_t get_payload_size(void * buf)

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:197


static

static SBIO_HD void discover_metadata(DataUnit * buffer, MetadataInventory & inv, std::size_t offset)

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:201


static

static SBIO_HDDataResult resolve_data(void * buffer, const MetadataInventory & inv, const DataRequest & req)

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:205


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/xtc1/xtc1_traits.hh:223

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 * The datagram to traverse
state DiscoveryState & A reference to a state tracking variable to maintain a history of offsets and indices seen.
l1_offsets_buf EventOffset * 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 * The transition offsets buffer - the state will tell us where to index into this buffer to record the new offset from dg
Name Description
Roles
DataAccessPtn
DataUnit
StepIdxType
BrokerBufferRequirements Specify all the buffers that are required to implement a reader of XTC2. We need to hold:
GroupBufferRequirements
DataResult The struct to be used to return results when data is requested. This is defined in the XTC2 namespace and aliased here. It has the structure: struct DataResult { const void* data; ///< Pointer to the raw data std::size_t size; ///< Total bytes of payload std::uint16_t rank; ///< Rank of data (num dimensions) const std::uint32_t* shape; ///< Shape of the data XTC1::DType dtype; ///< Data type };

enum Roles

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:58

Value Description
SMD
BD

enum DataAccessPtn

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:62

Value Description
L1Accept
SlowUpdate
BeginStep

using DataUnit = XTC1::Dgram

Type: XTC1::Dgram

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:69


using StepIdxType = std::size_t

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:70


using BrokerBufferRequirements = RequirementsList< BufferDescriptor< roles::Metadata, 0, sizeof(XTC1::Dgram)>, BufferDescriptor< roles::Metadata, 1, sizeof(XTC1::Dgram)>, BufferDescriptor< roles::Data, 0, sizeof(XTC1::Dgram)>, BufferDescriptor< roles::Index, 0, sizeof(EventOffset)>, BufferDescriptor< roles::Index, 1, sizeof(TransitionOffset)>, BufferDescriptor< roles::Metadata, 2, sizeof(XTC1::Dgram)> >

Type: RequirementsList< BufferDescriptor< roles::Metadata, 0, sizeof(XTC1::Dgram)>, BufferDescriptor< roles::Metadata, 1, sizeof(XTC1::Dgram)>, BufferDescriptor< roles::Data, 0, sizeof(XTC1::Dgram)>, BufferDescriptor< roles::Index, 0, sizeof(EventOffset)>, BufferDescriptor< roles::Index, 1, sizeof(TransitionOffset)>, BufferDescriptor< roles::Metadata, 2, sizeof(XTC1::Dgram)> >

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:103

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.


using GroupBufferRequirements = TypeList< BufferDescriptor< roles::Table, 0, sizeof(void *), Shareable >, >

Type: TypeList< BufferDescriptor< roles::Table, 0, sizeof(void *), Shareable >, >

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:112


using DataResult = typename XTC1::DataResult

Type: typename XTC1::DataResult

Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:181

The struct to be used to return results when data is requested. This is defined in the XTC2 namespace and aliased here. It has the structure: struct DataResult { const void* data; ///< Pointer to the raw data std::size_t size; ///< Total bytes of payload std::uint16_t rank; ///< Rank of data (num dimensions) const std::uint32_t* shape; ///< Shape of the data XTC1::DType dtype; ///< Data type };