Skip to content

XTC1Traits

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

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

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
initialize_streams function Declared here
find_detector_segments function Declared here
get_payload_size function Declared here
discover_metadata function Declared here
resolve_data function Declared here
populate_offsets function Declared here
Roles enum Declared here
DataAccessPtn enum Declared here
DataUnit typedef Declared here
StepIdxType typedef Declared here
BrokerBufferRequirements typedef Declared here
GroupBufferRequirements typedef Declared here
DataResult 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/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:45


static constexpr

constexpr std::uint16_t MaxRank { 10 }

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


static constexpr

constexpr std::uint16_t MaxNameSize { 256 }

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


static constexpr

constexpr StreamPartitioningStrategy PartitioningStrategy {
}

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


static constexpr

constexpr std::size_t RoleCount { 2 }

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


static constexpr

constexpr std::size_t DataAccessPtnCount { 3 }

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


static constexpr

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

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

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](#dataunit-1) * The datagram to traverse
state [DiscoveryState](api-sbio-XTC1Traits-DiscoveryState.md#discoverystate-1) & A reference to a state tracking variable to maintain a history of offsets and indices seen.
l1_offsets_buf [EventOffset](api-sbio-XTC1Traits-EventOffset.md#eventoffset-1) * 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-XTC1Traits-TransitionOffset.md#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:57

Value Description
SMD
BD

enum DataAccessPtn

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

Value Description
L1Accept
SlowUpdate
BeginStep

using DataUnit = XTC1::Dgram

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


using StepIdxType = std::size_t

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


using BrokerBufferRequirements = TypeList< BufferDescriptor< MetadataRole, 0, sizeof(XTC1::Dgram)>, BufferDescriptor< MetadataRole, 1, sizeof(XTC1::Dgram)>, BufferDescriptor< DataRole, 0, sizeof(XTC1::Dgram)>, BufferDescriptor< IndexRole, 0, sizeof(EventOffset)>, BufferDescriptor< IndexRole, 1, sizeof(TransitionOffset)>, BufferDescriptor< MetadataRole, 2, sizeof(XTC1::Dgram)> >

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

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< TableRole, 0, sizeof(void *), Shareable >, BufferDescriptor< GroupRole, 0, sizeof(XTC1::Dgram), Shareable > >

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


using DataResult = 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 };