DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::fdreadoutlibs::TPGInternalStateHarvester Class Reference

#include <TPGInternalStateHarvester.hpp>

Public Types

using ProcRef = std::pair<std::shared_ptr<tpglibs::AbstractProcessor<__m256i>>, int >

Public Member Functions

 ~TPGInternalStateHarvester ()
void set_processor_references (std::vector< ProcRef > refs)
const std::vector< ProcRef > & get_processor_references () const
void update_channel_plane_numbers (const std::vector< std::pair< trgdataformats::channel_t, int16_t > > &channel_plane_numbers, uint8_t num_channels_per_pipeline, uint8_t num_pipelines)
 Cuts a full list of (channel, plane) into per-pipeline lists of 16 lanes each.
std::unordered_map< trgdataformats::channel_t, std::vector< std::pair< std::string, int16_t > > > harvest_once ()
 Harvest once, outputs channel -> [(metric_name, value)...].
void start_collection_thread ()
 Start the background collection thread Must be called before using async collection features.
void stop_collection_thread ()
 Stop the background collection thread Blocks until thread is fully stopped.
void trigger_harvest ()
 Signal the collection thread to perform one harvest cycle Non-blocking - returns immediately.
std::unordered_map< trgdataformats::channel_t, std::vector< std::pair< std::string, int16_t > > > get_latest_results () const
 Get the latest collected results (thread-safe, non-blocking) Returns a copy of the most recent harvest results.
bool is_collection_thread_running () const
 Check if collection thread is running.

Private Types

using ResultContainer = std::unordered_map<trgdataformats::channel_t, std::vector<std::pair<std::string, int16_t>>>

Private Member Functions

void collection_thread_worker_ ()
void rebuild_prealloc_caches_ ()

Private Attributes

std::vector< ProcRef > m_processor_references
std::vector< std::vector< std::pair< trgdataformats::channel_t, int16_t > > > m_channel_plane_numbers_per_pipeline
uint8_t m_num_channels_per_pipeline
uint8_t m_num_pipelines
std::vector< std::vector< std::string > > m_metric_items_per_proc
std::vector< size_t > m_expected_items_per_pipeline
size_t m_expected_total_channels = 0
std::mutex m_results_mutex
ResultContainer m_latest_results
std::thread m_collection_thread
std::atomic< bool > m_thread_should_stop { false }
std::atomic< bool > m_thread_running { false }
std::atomic< bool > m_harvest_requested { false }
std::mutex m_config_mutex
std::mutex m_collection_mutex
std::condition_variable m_collection_cv

Detailed Description

Definition at line 28 of file TPGInternalStateHarvester.hpp.

Member Typedef Documentation

◆ ProcRef

Definition at line 31 of file TPGInternalStateHarvester.hpp.

◆ ResultContainer

using dunedaq::fdreadoutlibs::TPGInternalStateHarvester::ResultContainer = std::unordered_map<trgdataformats::channel_t, std::vector<std::pair<std::string, int16_t>>>
private

Definition at line 108 of file TPGInternalStateHarvester.hpp.

Constructor & Destructor Documentation

◆ ~TPGInternalStateHarvester()

dunedaq::fdreadoutlibs::TPGInternalStateHarvester::~TPGInternalStateHarvester ( )

Member Function Documentation

◆ collection_thread_worker_()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::collection_thread_worker_ ( )
private

◆ get_latest_results()

std::unordered_map< trgdataformats::channel_t, std::vector< std::pair< std::string, int16_t > > > dunedaq::fdreadoutlibs::TPGInternalStateHarvester::get_latest_results ( ) const

Get the latest collected results (thread-safe, non-blocking) Returns a copy of the most recent harvest results.

Returns
std::unordered_map<trgdataformats::channel_t, std::vector<std::pair<std::string,int16_t>>>

◆ get_processor_references()

const std::vector< ProcRef > & dunedaq::fdreadoutlibs::TPGInternalStateHarvester::get_processor_references ( ) const

◆ harvest_once()

std::unordered_map< trgdataformats::channel_t, std::vector< std::pair< std::string, int16_t > > > dunedaq::fdreadoutlibs::TPGInternalStateHarvester::harvest_once ( )

Harvest once, outputs channel -> [(metric_name, value)...].

Returns
std::unordered_map<trgdataformats::channel_t, std::vector<std::pair<std::string,int16_t>>>

◆ is_collection_thread_running()

bool dunedaq::fdreadoutlibs::TPGInternalStateHarvester::is_collection_thread_running ( ) const

Check if collection thread is running.

Returns
true if thread is active, false otherwise

◆ rebuild_prealloc_caches_()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::rebuild_prealloc_caches_ ( )
private

◆ set_processor_references()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::set_processor_references ( std::vector< ProcRef > refs)

◆ start_collection_thread()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::start_collection_thread ( )

Start the background collection thread Must be called before using async collection features.

◆ stop_collection_thread()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::stop_collection_thread ( )

Stop the background collection thread Blocks until thread is fully stopped.

◆ trigger_harvest()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::trigger_harvest ( )

Signal the collection thread to perform one harvest cycle Non-blocking - returns immediately.

◆ update_channel_plane_numbers()

void dunedaq::fdreadoutlibs::TPGInternalStateHarvester::update_channel_plane_numbers ( const std::vector< std::pair< trgdataformats::channel_t, int16_t > > & channel_plane_numbers,
uint8_t num_channels_per_pipeline,
uint8_t num_pipelines )

Cuts a full list of (channel, plane) into per-pipeline lists of 16 lanes each.

Parameters
channel_plane_numbers
num_channels_per_pipeline
num_pipelines

Member Data Documentation

◆ m_channel_plane_numbers_per_pipeline

std::vector<std::vector<std::pair<trgdataformats::channel_t, int16_t> > > dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_channel_plane_numbers_per_pipeline
private

Definition at line 98 of file TPGInternalStateHarvester.hpp.

◆ m_collection_cv

std::condition_variable dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_collection_cv
private

Definition at line 123 of file TPGInternalStateHarvester.hpp.

◆ m_collection_mutex

std::mutex dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_collection_mutex
private

Definition at line 122 of file TPGInternalStateHarvester.hpp.

◆ m_collection_thread

std::thread dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_collection_thread
private

Definition at line 115 of file TPGInternalStateHarvester.hpp.

◆ m_config_mutex

std::mutex dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_config_mutex
mutableprivate

Definition at line 121 of file TPGInternalStateHarvester.hpp.

◆ m_expected_items_per_pipeline

std::vector<size_t> dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_expected_items_per_pipeline
private

Definition at line 104 of file TPGInternalStateHarvester.hpp.

◆ m_expected_total_channels

size_t dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_expected_total_channels = 0
private

Definition at line 105 of file TPGInternalStateHarvester.hpp.

◆ m_harvest_requested

std::atomic<bool> dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_harvest_requested { false }
private

Definition at line 118 of file TPGInternalStateHarvester.hpp.

◆ m_latest_results

ResultContainer dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_latest_results
private

Definition at line 112 of file TPGInternalStateHarvester.hpp.

◆ m_metric_items_per_proc

std::vector<std::vector<std::string> > dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_metric_items_per_proc
private

Definition at line 103 of file TPGInternalStateHarvester.hpp.

◆ m_num_channels_per_pipeline

uint8_t dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_num_channels_per_pipeline
private

Definition at line 99 of file TPGInternalStateHarvester.hpp.

◆ m_num_pipelines

uint8_t dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_num_pipelines
private

Definition at line 100 of file TPGInternalStateHarvester.hpp.

◆ m_processor_references

std::vector<ProcRef> dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_processor_references
private

Definition at line 96 of file TPGInternalStateHarvester.hpp.

◆ m_results_mutex

std::mutex dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_results_mutex
mutableprivate

Definition at line 111 of file TPGInternalStateHarvester.hpp.

◆ m_thread_running

std::atomic<bool> dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_thread_running { false }
private

Definition at line 117 of file TPGInternalStateHarvester.hpp.

◆ m_thread_should_stop

std::atomic<bool> dunedaq::fdreadoutlibs::TPGInternalStateHarvester::m_thread_should_stop { false }
private

Definition at line 116 of file TPGInternalStateHarvester.hpp.


The documentation for this class was generated from the following file: