XTC1Traits
XTC1Traits
Section titled “XTC1Traits”#include <sbio/formats/xtc1/xtc1_traits.hh>struct XTC1TraitsDefined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:41
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 |
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 |
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/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)
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 { 40 }Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:45
MaxRank
Section titled “MaxRank”static constexpr
constexpr std::uint16_t MaxRank { 10 }Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:46
MaxNameSize
Section titled “MaxNameSize”static constexpr
constexpr std::uint16_t MaxNameSize { 256 }Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:47
PartitioningStrategy
Section titled “PartitioningStrategy”static constexpr
constexpr StreamPartitioningStrategy PartitioningStrategy {
}Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:52
RoleCount
Section titled “RoleCount”static constexpr
constexpr std::size_t RoleCount { 2 }Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:58
DataAccessPtnCount
Section titled “DataAccessPtnCount”static constexpr
constexpr std::size_t DataAccessPtnCount { 3 }Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:66
ExhaustedSentinel
Section titled “ExhaustedSentinel”static constexpr
constexpr StepIdxType ExhaustedSentinel { static_cast<>(-1) }Defined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:70
Public Static Methods
Section titled “Public Static Methods”| 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. |
initialize_streams
Section titled “initialize_streams”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
find_detector_segments
Section titled “find_detector_segments”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
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/xtc1/xtc1_traits.hh:197
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/xtc1/xtc1_traits.hh:201
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/xtc1/xtc1_traits.hh:205
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/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.
Parameters
Section titled “Parameters”| 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 |
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: |
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 RolesDefined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:57
| Value | Description |
|---|---|
SMD |
|
BD |
DataAccessPtn
Section titled “DataAccessPtn”enum DataAccessPtnDefined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:61
| Value | Description |
|---|---|
L1Accept |
|
SlowUpdate |
|
BeginStep |
DataUnit
Section titled “DataUnit”using DataUnit = XTC1::DgramDefined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:68
StepIdxType
Section titled “StepIdxType”using StepIdxType = std::size_tDefined in src/lib/sbio/formats/xtc1/xtc1_traits.hh:69
BrokerBufferRequirements
Section titled “BrokerBufferRequirements”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:
-
Transition datagrams
-
Event datagrams
-
Event offsets
-
Transition offsets
The execution policy will determine how to fulfill allocation and synchronization of these requested buffers.
GroupBufferRequirements
Section titled “GroupBufferRequirements”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
DataResult
Section titled “DataResult”using DataResult = typename XTC1::DataResultDefined 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 };