DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType > Class Template Reference

#include <DataHandlingModel.hpp>

Inheritance diagram for dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >:
[legend]
Collaboration diagram for dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >:
[legend]

Classes

class  PostprocessScheduleAlgorithm
 

Public Types

using RDT = ReadoutType
 
using RHT = RequestHandlerType
 
using LBT = LatencyBufferType
 
using RPT = RawDataProcessorType
 
using IDT = InputDataType
 
using timestamp_t = std::uint64_t
 
- Public Types inherited from dunedaq::opmonlib::MonitorableObject
using NodePtr = std::weak_ptr<MonitorableObject>
 
using NewNodePtr = std::shared_ptr<MonitorableObject>
 
using ElementId = std::string
 

Public Member Functions

 DataHandlingModel (std::atomic< bool > &run_marker)
 
virtual ~DataHandlingModel ()=default
 
void init (const appmodel::DataHandlerModule *modconf)
 Forward calls from the appfwk.
 
void conf (const appfwk::DAQModule::CommandData_t &args)
 
void scrap (const appfwk::DAQModule::CommandData_t &args)
 
void start (const appfwk::DAQModule::CommandData_t &args)
 
void stop (const appfwk::DAQModule::CommandData_t &args)
 
void record (const appfwk::DAQModule::CommandData_t &args) override
 
- Public Member Functions inherited from dunedaq::datahandlinglibs::DataHandlingConcept
 DataHandlingConcept ()
 
virtual ~DataHandlingConcept ()
 
 DataHandlingConcept (const DataHandlingConcept &)=delete
 DataHandlingConcept is not copy-constructible.
 
DataHandlingConceptoperator= (const DataHandlingConcept &)=delete
 DataHandlingConcept is not copy-assginable.
 
 DataHandlingConcept (DataHandlingConcept &&)=delete
 DataHandlingConcept is not move-constructible.
 
DataHandlingConceptoperator= (DataHandlingConcept &&)=delete
 DataHandlingConcept is not move-assignable.
 
- Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject (const MonitorableObject &)=delete
 
MonitorableObjectoperator= (const MonitorableObject &)=delete
 
 MonitorableObject (MonitorableObject &&)=delete
 
MonitorableObjectoperator= (MonitorableObject &&)=delete
 
virtual ~MonitorableObject ()=default
 
auto get_opmon_id () const noexcept
 
auto get_opmon_level () const noexcept
 

Public Attributes

std::function< void(IDT &&)> m_consume_callback
 

Static Public Attributes

static constexpr timestamp_t ns = 1
 
static constexpr timestamp_t us = 1000 * ns
 
static constexpr timestamp_t ms = 1000 * us
 
static constexpr timestamp_t s = 1000 * ms
 

Protected Types

using metric_t = dunedaq::datahandlinglibs::opmon::DataHandlerInfo
 
using num_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_payloads),metric_t>::type>::type
 
using sum_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_payloads),metric_t>::type>::type
 
using num_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_requests),metric_t>::type>::type
 
using sum_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_requests),metric_t>::type>::type
 
using rawq_timeout_count_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_data_input_timeouts),metric_t>::type>::type
 
using num_lb_insert_failures_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_lb_insert_failures),metric_t>::type>::type
 
using num_post_processing_delay_max_waits_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_post_processing_delay_max_waits),metric_t>::type>::type
 
using raw_receiver_ct = iomanager::ReceiverConcept<InputDataType>
 
using request_receiver_ct = iomanager::ReceiverConcept<dfmessages::DataRequest>
 
using timesync_sender_ct = iomanager::SenderConcept<dfmessages::TimeSync>
 

Protected Member Functions

void process_item (RDT &&payload)
 
void transform_and_process (IDT &&payload)
 
void consume_callback (IDT &&payload)
 
void run_consume ()
 Function that will be run in its own thread to read the raw packets from the connection and add them to the LB.
 
void run_timesync ()
 Function that will be run in its own thread and sends periodic timesync messages by pushing them to the connection.
 
void run_postprocess_scheduler ()
 
folly::coro::Task< void > postprocess_schedule ()
 
void dispatch_requests (dfmessages::DataRequest &data_request)
 
virtual std::vector< RDTtransform_payload (IDT &original) const
 
virtual void invoke_postprocess_schedule_timeout_policy () const
 
virtual void generate_opmon_data () override
 
- Protected Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject ()=default
 
void register_node (ElementId name, NewNodePtr)
 
void publish (google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
 

Protected Attributes

std::atomic< bool > & m_run_marker
 
bool m_callback_mode
 
bool m_fake_trigger
 
bool m_generate_timesync = false
 
int m_current_fake_trigger_id
 
daqdataformats::SourceID m_sourceid
 
daqdataformats::run_number_t m_run_number
 
uint64_t m_processing_delay_ticks
 
uint64_t m_post_processing_delay_min_wait
 
uint64_t m_post_processing_delay_max_wait
 
std::atomic< num_payload_tm_num_payloads { 0 }
 
std::atomic< sum_payload_tm_sum_payloads { 0 }
 
std::atomic< num_request_tm_num_requests { 0 }
 
std::atomic< sum_request_tm_sum_requests { 0 }
 
std::atomic< rawq_timeout_count_tm_rawq_timeout_count { 0 }
 
std::atomic< num_lb_insert_failures_tm_num_lb_insert_failures { 0 }
 
std::atomic< num_post_processing_delay_max_waits_tm_num_post_processing_delay_max_waits { 0 }
 
std::atomic< int > m_stats_packet_count { 0 }
 
utilities::ReusableThread m_consumer_thread
 
std::chrono::milliseconds m_raw_receiver_timeout_ms
 
std::chrono::microseconds m_raw_receiver_sleep_us
 
std::shared_ptr< raw_receiver_ctm_raw_data_receiver
 
std::string m_raw_data_receiver_connection_name
 
std::shared_ptr< request_receiver_ctm_data_request_receiver
 
std::shared_ptr< timesync_sender_ctm_timesync_sender
 
utilities::ReusableThread m_timesync_thread
 
std::string m_timesync_connection_name
 
utilities::ReusableThread m_postprocess_scheduler_thread
 
folly::coro::Baton m_baton
 
std::unique_ptr< folly::Timekeeper > m_timekeeper
 
std::shared_ptr< LatencyBufferType > m_latency_buffer_impl
 
std::shared_ptr< RawDataProcessorType > m_raw_processor_impl
 
std::shared_ptr< RequestHandlerType > m_request_handler_impl
 
bool m_request_handler_supports_cutoff_timestamp
 
std::unique_ptr< FrameErrorRegistrym_error_registry
 
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
 

Additional Inherited Members

- Static Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
static bool publishable_metric (OpMonLevel entry, OpMonLevel system) noexcept
 

Detailed Description

template<class ReadoutType, class RequestHandlerType, class LatencyBufferType, class RawDataProcessorType, class InputDataType = ReadoutType>
class dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >

Definition at line 68 of file DataHandlingModel.hpp.

Member Typedef Documentation

◆ IDT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::IDT = InputDataType

Definition at line 76 of file DataHandlingModel.hpp.

◆ LBT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::LBT = LatencyBufferType

Definition at line 74 of file DataHandlingModel.hpp.

◆ metric_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::metric_t = dunedaq::datahandlinglibs::opmon::DataHandlerInfo
protected

Definition at line 336 of file DataHandlingModel.hpp.

◆ num_lb_insert_failures_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_lb_insert_failures_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_lb_insert_failures),metric_t>::type>::type
protected

Definition at line 342 of file DataHandlingModel.hpp.

◆ num_payload_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_payloads),metric_t>::type>::type
protected

Definition at line 337 of file DataHandlingModel.hpp.

◆ num_post_processing_delay_max_waits_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_post_processing_delay_max_waits_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_post_processing_delay_max_waits),metric_t>::type>::type
protected

Definition at line 343 of file DataHandlingModel.hpp.

◆ num_request_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_requests),metric_t>::type>::type
protected

Definition at line 339 of file DataHandlingModel.hpp.

◆ raw_receiver_ct

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::raw_receiver_ct = iomanager::ReceiverConcept<InputDataType>
protected

Definition at line 360 of file DataHandlingModel.hpp.

◆ rawq_timeout_count_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::rawq_timeout_count_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_data_input_timeouts),metric_t>::type>::type
protected

Definition at line 341 of file DataHandlingModel.hpp.

◆ RDT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::RDT = ReadoutType

Definition at line 72 of file DataHandlingModel.hpp.

◆ request_receiver_ct

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::request_receiver_ct = iomanager::ReceiverConcept<dfmessages::DataRequest>
protected

Definition at line 365 of file DataHandlingModel.hpp.

◆ RHT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::RHT = RequestHandlerType

Definition at line 73 of file DataHandlingModel.hpp.

◆ RPT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::RPT = RawDataProcessorType

Definition at line 75 of file DataHandlingModel.hpp.

◆ sum_payload_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::sum_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_payloads),metric_t>::type>::type
protected

Definition at line 338 of file DataHandlingModel.hpp.

◆ sum_request_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::sum_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_requests),metric_t>::type>::type
protected

Definition at line 340 of file DataHandlingModel.hpp.

◆ timestamp_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::timestamp_t = std::uint64_t

Definition at line 79 of file DataHandlingModel.hpp.

◆ timesync_sender_ct

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::timesync_sender_ct = iomanager::SenderConcept<dfmessages::TimeSync>
protected

Definition at line 374 of file DataHandlingModel.hpp.

Constructor & Destructor Documentation

◆ DataHandlingModel()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::DataHandlingModel ( std::atomic< bool > & run_marker)
inlineexplicit

Definition at line 86 of file DataHandlingModel.hpp.

88 , m_callback_mode(false)
89 , m_fake_trigger(false)
94 , m_raw_data_receiver(nullptr)
96 , m_latency_buffer_impl(nullptr)
97 , m_raw_processor_impl(nullptr)
98 {
99 }
std::shared_ptr< raw_receiver_ct > m_raw_data_receiver
std::shared_ptr< LatencyBufferType > m_latency_buffer_impl
std::shared_ptr< RawDataProcessorType > m_raw_processor_impl
std::atomic< bool > run_marker
Global atomic for process lifetime.

◆ ~DataHandlingModel()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
virtual dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::~DataHandlingModel ( )
virtualdefault

Member Function Documentation

◆ conf()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::conf ( const appfwk::DAQModule::CommandData_t & args)
virtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 113 of file DataHandlingModel.hxx.

114{
115 // Register callbacks if operating in that mode.
116 if (m_callback_mode) {
117 // Configure and register consume callback
119
120 // Register callback
121 auto dmcbr = DataMoveCallbackRegistry::get();
123 }
124
125 // Configure threads:
129 }
132 m_timekeeper = std::make_unique<folly::ThreadWheelTimekeeper>();
133 }
134}
std::unique_ptr< folly::Timekeeper > m_timekeeper
static std::shared_ptr< DataMoveCallbackRegistry > get()
void set_name(const std::string &name, int tid)
ID_t id
Unique identifier of the source of the data.
Definition SourceID.hpp:74

◆ consume_callback()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::consume_callback ( IDT && payload)
protected

Definition at line 252 of file DataHandlingModel.hxx.

252 {
253 transform_and_process(std::move(payload));
254}

◆ dispatch_requests()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::dispatch_requests ( dfmessages::DataRequest & data_request)
protected

Definition at line 458 of file DataHandlingModel.hxx.

459{
460 if (data_request.request_information.component != m_sourceid) {
461 ers::error(RequestSourceIDMismatch(ERS_HERE, m_sourceid, data_request.request_information.component));
462 return;
463 }
464 TLOG_DEBUG(TLVL_QUEUE_POP) << "Received DataRequest"
465 << " for trig/seq_number " << data_request.trigger_number << "." << data_request.sequence_number
466 << ", runno " << data_request.run_number
467 << ", trig timestamp " << data_request.trigger_timestamp
468 << ", SourceID: " << data_request.request_information.component
469 << ", window begin/end " << data_request.request_information.window_begin
470 << "/" << data_request.request_information.window_end
471 << ", dest: " << data_request.data_destination;
472 m_request_handler_impl->issue_request(data_request);
475}
#define ERS_HERE
std::shared_ptr< RequestHandlerType > m_request_handler_impl
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
void error(const Issue &issue)
Definition ers.hpp:81

◆ generate_opmon_data()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::generate_opmon_data ( )
overrideprotectedvirtual

Hook for customisable pubblication. The function can throw, exception will be caught by the monitoring thread

Reimplemented from dunedaq::opmonlib::MonitorableObject.

Definition at line 206 of file DataHandlingModel.hxx.

207 {
208 opmon::DataHandlerInfo ri;
209 ri.set_sum_payloads(m_sum_payloads.load());
210 ri.set_num_payloads(m_num_payloads.exchange(0));
211
212 ri.set_num_data_input_timeouts(m_rawq_timeout_count.exchange(0));
213
214 auto now = std::chrono::high_resolution_clock::now();
215 int new_packets = m_stats_packet_count.exchange(0);
216 double seconds = std::chrono::duration_cast<std::chrono::microseconds>(now - m_t0).count() / 1000000.;
217 m_t0 = now;
218
219 // 08-May-2025, KAB: added a message to warn users when latency buffer inserts are failing.
220 int local_num_lb_insert_failures = m_num_lb_insert_failures.exchange(0);
221 if (local_num_lb_insert_failures != 0) {
222 ers::warning(NonZeroLatencyBufferInsertFailures(ERS_HERE, m_sourceid, local_num_lb_insert_failures, ri.num_payloads()));
223 }
224
225 ri.set_rate_payloads_consumed(new_packets / seconds / 1000.);
226 ri.set_num_lb_insert_failures(local_num_lb_insert_failures);
227 ri.set_sum_requests(m_sum_requests.load());
228 ri.set_num_requests(m_num_requests.exchange(0));
229 ri.set_num_post_processing_delay_max_waits(m_num_post_processing_delay_max_waits.exchange(0));
230 ri.set_last_daq_timestamp(m_raw_processor_impl->get_last_daq_time());
231 ri.set_newest_timestamp(m_raw_processor_impl->get_last_daq_time());
232 ri.set_oldest_timestamp(m_request_handler_impl->get_oldest_time());
233
234 this->publish(std::move(ri));
235 }
std::atomic< num_lb_insert_failures_t > m_num_lb_insert_failures
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
std::atomic< num_post_processing_delay_max_waits_t > m_num_post_processing_delay_max_waits
std::atomic< rawq_timeout_count_t > m_rawq_timeout_count
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
static int64_t now()
void warning(const Issue &issue)
Definition ers.hpp:115

◆ init()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::init ( const appmodel::DataHandlerModule * mcfg)
virtual

Forward calls from the appfwk.

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 16 of file DataHandlingModel.hxx.

17{
18 // Setup request queues
19 //setup_request_queues(mcfg);
20 try {
21 for (auto input : mcfg->get_inputs()) {
22 if (input->get_data_type() == "DataRequest") {
24 }
25 else {
27 // Parse for prefix
28 std::string conn_name = input->UID();
29 const char delim = '_';
30 std::vector<std::string> words;
31 std::size_t start;
32 std::size_t end = 0;
33 while ((start = conn_name.find_first_not_of(delim, end)) != std::string::npos) {
34 end = conn_name.find(delim, start);
35 words.push_back(conn_name.substr(start, end - start));
36 }
37
38 TLOG_DEBUG(TLVL_WORK_STEPS) << "Initialize connection based on uid: "
39 << m_raw_data_receiver_connection_name << " front word: " << words.front();
40
41 std::string cb_prefix("cb");
42 if (words.front() == cb_prefix) {
43 m_callback_mode = true;
44 }
45
46 if (!m_callback_mode) {
48 m_raw_receiver_timeout_ms = std::chrono::milliseconds(input->get_recv_timeout_ms());
49 }
50 }
51 }
52 for (auto output : mcfg->get_outputs()) {
53 if (output->get_data_type() == "TimeSync") {
56 m_timesync_connection_name = output->UID();
57 break;
58 }
59 }
60 } catch (const ers::Issue& excpt) {
61 throw ResourceQueueError(ERS_HERE, "raw_input or frag_output", "DataHandlingModel", excpt);
62 }
63
64 // Raw input connection sensibility check
65 if (!m_callback_mode && m_raw_data_receiver == nullptr) {
66 ers::error(ConfigurationError(ERS_HERE, m_sourceid, "Non callback mode, and receiver is unset!"));
67 }
68
69 // Instantiate functionalities
70 m_error_registry.reset(new FrameErrorRegistry());
71 m_error_registry->set_ers_metadata("DLH of SourceID[" + std::to_string(mcfg->get_source_id()) + "] ");
72 m_latency_buffer_impl.reset(new LBT());
73 m_raw_processor_impl.reset(new RPT(m_error_registry, mcfg->get_post_processing_enabled()));
75
76 register_node(mcfg->get_module_configuration()->get_latency_buffer()->UID(), m_latency_buffer_impl);
77 register_node(mcfg->get_module_configuration()->get_data_processor()->UID(), m_raw_processor_impl);
78 register_node(mcfg->get_module_configuration()->get_request_handler()->UID(), m_request_handler_impl);
79
80 //m_request_handler_impl->init(args);
81 //m_raw_processor_impl->init(args);
83 m_fake_trigger = false;
84 m_raw_receiver_sleep_us = std::chrono::microseconds::zero();
85 m_sourceid.id = mcfg->get_source_id();
86 m_sourceid.subsystem = RDT::subsystem;
87 m_processing_delay_ticks = mcfg->get_module_configuration()->get_post_processing_delay_ticks();
88 m_post_processing_delay_min_wait = mcfg->get_module_configuration()->get_post_processing_delay_min_wait();
89 m_post_processing_delay_max_wait = mcfg->get_module_configuration()->get_post_processing_delay_max_wait();
90
92 if constexpr (!SupportsDelayedPostprocessing<LBT>) {
93 ers::error(ConfigurationError(ERS_HERE, m_sourceid,
94 "Delayed postprocessing (post_processing_delay_ticks > 0) requires a sorted buffer (SkipList). "
95 "Queue buffers (FixedRateQueue, BinarySearchQueue) expect in-order data and must use post_processing_delay_ticks = 0."));
96 }
97 }
98
99 // Configure implementations:
100 m_raw_processor_impl->conf(mcfg);
101 // Configure the latency buffer before the request handler so the request handler can check for alignment
102 // restrictions
103 try {
104 m_latency_buffer_impl->conf(mcfg->get_module_configuration()->get_latency_buffer());
105 } catch (const std::bad_alloc& be) {
106 ers::error(ConfigurationError(ERS_HERE, m_sourceid, "Latency Buffer can't be allocated with size!"));
107 }
108 m_request_handler_impl->conf(mcfg);
109}
std::unique_ptr< FrameErrorRegistry > m_error_registry
std::shared_ptr< timesync_sender_ct > m_timesync_sender
void start(const appfwk::DAQModule::CommandData_t &args)
std::shared_ptr< request_receiver_ct > m_data_request_receiver
void register_node(ElementId name, NewNodePtr)
Base class for any user define issue.
Definition Issue.hpp:69
static std::shared_ptr< iomanager::SenderConcept< Datatype > > get_iom_sender(iomanager::ConnectionId const &id)
static std::shared_ptr< iomanager::ReceiverConcept< Datatype > > get_iom_receiver(iomanager::ConnectionId const &id)
Subsystem subsystem
The general subsystem of the source of the data.
Definition SourceID.hpp:69

◆ invoke_postprocess_schedule_timeout_policy()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
virtual void dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::invoke_postprocess_schedule_timeout_policy ( ) const
inlineprotectedvirtual

Definition at line 312 of file DataHandlingModel.hpp.

313 {
314 return; // No-op for this class
315 }

◆ postprocess_schedule()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
folly::coro::Task< void > dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::postprocess_schedule ( )
protected

Definition at line 325 of file DataHandlingModel.hxx.

326{
327
328 TLOG_DEBUG(TLVL_WORK_STEPS) << "Postprocess schedule coroutine started...";
329 TLOG() << "***** Starting post-process coroutine with timout " << m_post_processing_delay_max_wait << " *****";
330
331
332 PostprocessScheduleAlgorithm sched_algo{ *m_latency_buffer_impl,
337
338 const auto wait_data = [this]() -> folly::coro::Task<void> {
339 // folly::coro::timeout cancels the task on timeout.
340 // Baton is not cancellable, so we attach a callback to resume the coroutine.
341 auto token = co_await folly::coro::co_current_cancellation_token;
342 folly::CancellationCallback cb(token, [this] { m_baton.post(); });
343 co_await m_baton; // Wait data
344 };
345
346 while (m_run_marker.load()) {
347 bool timeout = false;
348
350 try {
351 co_await folly::coro::timeout(
352 wait_data(),
353 std::chrono::milliseconds{ m_post_processing_delay_max_wait },
354 m_timekeeper.get());
355
356 } catch (const folly::FutureTimeout&) {
357 timeout = true;
359 }
360 } else {
361 co_await m_baton;
362 }
363
364 m_baton.reset();
365
366 if (auto processed = sched_algo.run(timeout); processed > 0) {
367 m_num_payloads += processed;
368 m_sum_payloads += processed;
369 m_stats_packet_count += processed;
370
371 }
372 }
373}
#define TLOG(...)
Definition macro.hpp:22

◆ process_item()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::process_item ( RDT && payload)
protected

Definition at line 258 of file DataHandlingModel.hxx.

259{
260 m_raw_processor_impl->preprocess_item(&payload);
262 int64_t diff1 = payload.get_timestamp() - m_request_handler_impl->get_cutoff_timestamp();
263 if (diff1 <= 0) {
264 //m_request_handler_impl->increment_tardy_tp_count();
265 ers::warning(DataPacketArrivedTooLate(ERS_HERE, m_sourceid, m_run_number, payload.get_timestamp(),
266 m_request_handler_impl->get_cutoff_timestamp(), diff1,
267 (static_cast<double>(diff1)/62500.0)));
268 }
269 }
270 if (!m_latency_buffer_impl->write(std::move(payload))) {
271 // TLOG_DEBUG(TLVL_TAKE_NOTE) << "***ERROR: Latency buffer insert failed! (Payload timestamp=" << payload.get_timestamp() << ")";
273 return;
274 }
275
276 if (m_processing_delay_ticks == 0) {
277 m_raw_processor_impl->postprocess_item(m_latency_buffer_impl->back());
281 } else {
282 m_baton.post();
283 }
284}

◆ record()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
void dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::record ( const appfwk::DAQModule::CommandData_t & args)
inlineoverridevirtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 124 of file DataHandlingModel.hpp.

125 {
126 m_request_handler_impl->record(args);
127 }

◆ run_consume()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::run_consume ( )
protectedvirtual

Function that will be run in its own thread to read the raw packets from the connection and add them to the LB.

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 295 of file DataHandlingModel.hxx.

296{
297
298 TLOG_DEBUG(TLVL_WORK_STEPS) << "Consumer thread started...";
300 m_num_payloads = 0;
301 m_sum_payloads = 0;
304
305 while (m_run_marker.load()) {
306 // Try to acquire data
307
308 auto opt_payload = m_raw_data_receiver->try_receive(m_raw_receiver_timeout_ms);
309
310 if (opt_payload) {
311 IDT& payload = opt_payload.value();
312 transform_and_process(std::move(payload));
313 } else {
315 // Protection against a zero sleep becoming a yield
316 if ( m_raw_receiver_sleep_us != std::chrono::microseconds::zero())
317 std::this_thread::sleep_for(m_raw_receiver_sleep_us);
318 }
319 }
320 TLOG_DEBUG(TLVL_WORK_STEPS) << "Consumer thread joins... ";
321}

◆ run_postprocess_scheduler()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::run_postprocess_scheduler ( )
protected

Definition at line 288 of file DataHandlingModel.hxx.

289{
290 folly::coro::blockingWait(postprocess_schedule());
291}

◆ run_timesync()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::run_timesync ( )
protectedvirtual

Function that will be run in its own thread and sends periodic timesync messages by pushing them to the connection.

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 377 of file DataHandlingModel.hxx.

378{
379 TLOG_DEBUG(TLVL_WORK_STEPS) << "TimeSync thread started...";
380 m_num_requests = 0;
381 m_sum_requests = 0;
382 uint64_t msg_seqno = 0;
383 timestamp_t prev_timestamp = 0;
384 auto once_per_run = true;
385 size_t zero_timestamp_count = 0;
386 size_t duplicate_timestamp_count = 0;
387 size_t total_timestamp_count = 0;
388 while (m_run_marker.load()) {
389 try {
390 auto timesyncmsg = dfmessages::TimeSync(m_raw_processor_impl->get_last_daq_time());
391 ++total_timestamp_count;
392 // daq_time is zero for the first received timesync, and may
393 // be the same as the previous daq_time if the data has
394 // stopped flowing. In both cases we don't send the TimeSync
395 if (timesyncmsg.daq_time != 0 && timesyncmsg.daq_time != prev_timestamp) {
396 prev_timestamp = timesyncmsg.daq_time;
397 timesyncmsg.run_number = m_run_number;
398 timesyncmsg.sequence_number = ++msg_seqno;
399 timesyncmsg.source_id = m_sourceid.id;
400 TLOG_DEBUG(TLVL_TIME_SYNCS) << "New timesync: daq=" << timesyncmsg.daq_time
401 << " wall=" << timesyncmsg.system_time << " run=" << timesyncmsg.run_number
402 << " seqno=" << timesyncmsg.sequence_number << " source_id=" << timesyncmsg.source_id;
403 try {
404 dfmessages::TimeSync timesyncmsg_copy(timesyncmsg);
405 m_timesync_sender->send(std::move(timesyncmsg_copy), std::chrono::milliseconds(500));
406 } catch (ers::Issue& excpt) {
409 }
410
411 if (m_fake_trigger) {
412 dfmessages::DataRequest dr;
414 dr.trigger_number = m_current_fake_trigger_id;
415 dr.trigger_timestamp = timesyncmsg.daq_time > 500 * us ? timesyncmsg.daq_time - 500 * us : 0;
416 auto width = 300000;
417 uint offset = 100;
418 dr.request_information.window_begin = dr.trigger_timestamp > offset ? dr.trigger_timestamp - offset : 0;
419 dr.request_information.window_end = dr.request_information.window_begin + width;
420 dr.request_information.component = m_sourceid;
421 dr.data_destination = "data_fragments_q";
422 TLOG_DEBUG(TLVL_WORK_STEPS) << "Issuing fake trigger based on timesync. "
423 << " ts=" << dr.trigger_timestamp
424 << " window_begin=" << dr.request_information.window_begin
425 << " window_end=" << dr.request_information.window_end;
426 m_request_handler_impl->issue_request(dr);
427
430 }
431 } else {
432 if (timesyncmsg.daq_time == 0) {++zero_timestamp_count;}
433 if (timesyncmsg.daq_time == prev_timestamp) {++duplicate_timestamp_count;}
434 if (once_per_run) {
435 TLOG() << "Timesync with DAQ time 0 won't be sent out as it's an invalid sync.";
436 once_per_run = false;
437 }
438 }
439 } catch (const iomanager::TimeoutExpired& excpt) {
440 // ++m_timesyncqueue_timeout;
441 }
442 // Split up the 100ms sleep into 10 sleeps of 10ms, so we respond to "stop" quicker
443 for (size_t i=0; i<10; ++i) {
444 std::this_thread::sleep_for(std::chrono::milliseconds(10));
445 if (!m_run_marker.load()) {
446 break;
447 }
448 }
449 }
450 once_per_run = true;
451 TLOG_DEBUG(TLVL_WORK_STEPS) << "TimeSync thread joins... (timestamp count, zero/same/total = "
452 << zero_timestamp_count << "/" << duplicate_timestamp_count << "/"
453 << total_timestamp_count << ")";
454}
double offset
SourceID[" << sourceid << "] Command daqdataformats::SourceID Readout Initialization std::string initerror Configuration std::string conferror Configuration std::string conferror TimeSyncTransmissionFailed

◆ scrap()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
void dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::scrap ( const appfwk::DAQModule::CommandData_t & args)
inlinevirtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 110 of file DataHandlingModel.hpp.

111 {
112 m_request_handler_impl->scrap(args);
113 m_latency_buffer_impl->scrap(args);
114 m_raw_processor_impl->scrap(args);
115 }

◆ start()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::start ( const appfwk::DAQModule::CommandData_t & args)
virtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 139 of file DataHandlingModel.hxx.

140{
141 // Reset opmon variables
142 m_sum_payloads = 0;
143 m_num_payloads = 0;
144 m_sum_requests = 0;
145 m_num_requests = 0;
150
151 m_t0 = std::chrono::high_resolution_clock::now();
152
154
155 TLOG_DEBUG(TLVL_WORK_STEPS) << "Starting threads...";
156 m_raw_processor_impl->start(args);
157 m_request_handler_impl->start(args);
158 if (!m_callback_mode) {
160 }
163 }
166 }
167 // Register callback to receive and dispatch data requests
168 m_data_request_receiver->add_callback(
169 std::bind(&DataHandlingModel<RDT, RHT, LBT, RPT, IDT>::dispatch_requests, this, std::placeholders::_1));
170}
void dispatch_requests(dfmessages::DataRequest &data_request)
void run_consume()
Function that will be run in its own thread to read the raw packets from the connection and add them ...
void run_timesync()
Function that will be run in its own thread and sends periodic timesync messages by pushing them to t...
bool set_work(Function &&f, Args &&... args)
uint32_t run_number_t
Type used to represent run number.
Definition Types.hpp:20

◆ stop()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::stop ( const appfwk::DAQModule::CommandData_t & args)
virtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 174 of file DataHandlingModel.hxx.

175{
176 TLOG_DEBUG(TLVL_WORK_STEPS) << "Stoppping threads...";
177
178 // Stop receiving data requests as first thing
179 m_data_request_receiver->remove_callback();
180 // Stop the other threads
181 m_request_handler_impl->stop(args);
184 std::this_thread::sleep_for(std::chrono::milliseconds(10));
185 }
186 }
187 if (!m_callback_mode) {
189 std::this_thread::sleep_for(std::chrono::milliseconds(10));
190 }
191 }
193 m_baton.post(); // In case the coroutine is still waiting when the consumer has stopped
195 std::this_thread::sleep_for(std::chrono::milliseconds(10));
196 }
197 }
198 TLOG_DEBUG(TLVL_WORK_STEPS) << "Flushing latency buffer with occupancy: " << m_latency_buffer_impl->occupancy();
199 m_latency_buffer_impl->flush();
200 m_raw_processor_impl->stop(args);
201 m_raw_processor_impl->reset_last_daq_time();
202}

◆ transform_and_process()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::transform_and_process ( IDT && payload)
protected

Definition at line 239 of file DataHandlingModel.hxx.

239 {
240 if constexpr (std::is_same_v<IDT, RDT>) {
241 process_item(std::move(payload));
242 } else {
243 auto transformed = transform_payload(payload);
244 for (auto& i : transformed) {
245 process_item(std::move(i));
246 }
247 }
248}
virtual std::vector< RDT > transform_payload(IDT &original) const

◆ transform_payload()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
virtual std::vector< RDT > dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::transform_payload ( IDT & original) const
inlineprotectedvirtual

Definition at line 306 of file DataHandlingModel.hpp.

307 {
308 return { reinterpret_cast<RDT&>(original) };
309 }

Member Data Documentation

◆ m_baton

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
folly::coro::Baton dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_baton
protected

Definition at line 381 of file DataHandlingModel.hpp.

◆ m_callback_mode

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_callback_mode
protected

Definition at line 325 of file DataHandlingModel.hpp.

◆ m_consume_callback

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::function<void(IDT&&)> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_consume_callback

Definition at line 133 of file DataHandlingModel.hpp.

◆ m_consumer_thread

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
utilities::ReusableThread dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_consumer_thread
protected

Definition at line 355 of file DataHandlingModel.hpp.

◆ m_current_fake_trigger_id

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
int dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_current_fake_trigger_id
protected

Definition at line 328 of file DataHandlingModel.hpp.

◆ m_data_request_receiver

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<request_receiver_ct> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_data_request_receiver
protected

Definition at line 366 of file DataHandlingModel.hpp.

◆ m_error_registry

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::unique_ptr<FrameErrorRegistry> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_error_registry
protected

Definition at line 395 of file DataHandlingModel.hpp.

◆ m_fake_trigger

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_fake_trigger
protected

Definition at line 326 of file DataHandlingModel.hpp.

◆ m_generate_timesync

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_generate_timesync = false
protected

Definition at line 327 of file DataHandlingModel.hpp.

◆ m_latency_buffer_impl

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<LatencyBufferType> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_latency_buffer_impl
protected

Definition at line 385 of file DataHandlingModel.hpp.

◆ m_num_lb_insert_failures

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_lb_insert_failures_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_lb_insert_failures { 0 }
protected

Definition at line 350 of file DataHandlingModel.hpp.

350{ 0 };

◆ m_num_payloads

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_payload_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_payloads { 0 }
protected

Definition at line 345 of file DataHandlingModel.hpp.

345{ 0 };

◆ m_num_post_processing_delay_max_waits

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_post_processing_delay_max_waits_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_post_processing_delay_max_waits { 0 }
protected

Definition at line 351 of file DataHandlingModel.hpp.

351{ 0 };

◆ m_num_requests

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_request_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_requests { 0 }
protected

Definition at line 347 of file DataHandlingModel.hpp.

347{ 0 };

◆ m_post_processing_delay_max_wait

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
uint64_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_post_processing_delay_max_wait
protected

Definition at line 333 of file DataHandlingModel.hpp.

◆ m_post_processing_delay_min_wait

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
uint64_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_post_processing_delay_min_wait
protected

Definition at line 332 of file DataHandlingModel.hpp.

◆ m_postprocess_scheduler_thread

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
utilities::ReusableThread dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_postprocess_scheduler_thread
protected

Definition at line 380 of file DataHandlingModel.hpp.

◆ m_processing_delay_ticks

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
uint64_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_processing_delay_ticks
protected

Definition at line 331 of file DataHandlingModel.hpp.

◆ m_raw_data_receiver

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<raw_receiver_ct> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_data_receiver
protected

Definition at line 361 of file DataHandlingModel.hpp.

◆ m_raw_data_receiver_connection_name

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::string dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_data_receiver_connection_name
protected

Definition at line 362 of file DataHandlingModel.hpp.

◆ m_raw_processor_impl

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<RawDataProcessorType> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_processor_impl
protected

Definition at line 388 of file DataHandlingModel.hpp.

◆ m_raw_receiver_sleep_us

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::chrono::microseconds dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_receiver_sleep_us
protected

Definition at line 359 of file DataHandlingModel.hpp.

◆ m_raw_receiver_timeout_ms

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::chrono::milliseconds dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_receiver_timeout_ms
protected

Definition at line 358 of file DataHandlingModel.hpp.

◆ m_rawq_timeout_count

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<rawq_timeout_count_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_rawq_timeout_count { 0 }
protected

Definition at line 349 of file DataHandlingModel.hpp.

349{ 0 };

◆ m_request_handler_impl

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<RequestHandlerType> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_request_handler_impl
protected

Definition at line 391 of file DataHandlingModel.hpp.

◆ m_request_handler_supports_cutoff_timestamp

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_request_handler_supports_cutoff_timestamp
protected

Definition at line 392 of file DataHandlingModel.hpp.

◆ m_run_marker

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<bool>& dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_run_marker
protected

Definition at line 321 of file DataHandlingModel.hpp.

◆ m_run_number

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
daqdataformats::run_number_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_run_number
protected

Definition at line 330 of file DataHandlingModel.hpp.

◆ m_sourceid

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
daqdataformats::SourceID dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_sourceid
protected

Definition at line 329 of file DataHandlingModel.hpp.

◆ m_stats_packet_count

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<int> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_stats_packet_count { 0 }
protected

Definition at line 352 of file DataHandlingModel.hpp.

352{ 0 };

◆ m_sum_payloads

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<sum_payload_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_sum_payloads { 0 }
protected

Definition at line 346 of file DataHandlingModel.hpp.

346{ 0 };

◆ m_sum_requests

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<sum_request_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_sum_requests { 0 }
protected

Definition at line 348 of file DataHandlingModel.hpp.

348{ 0 };

◆ m_t0

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::chrono::time_point<std::chrono::high_resolution_clock> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_t0
protected

Definition at line 398 of file DataHandlingModel.hpp.

◆ m_timekeeper

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::unique_ptr<folly::Timekeeper> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timekeeper
protected

Definition at line 382 of file DataHandlingModel.hpp.

◆ m_timesync_connection_name

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::string dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timesync_connection_name
protected

Definition at line 377 of file DataHandlingModel.hpp.

◆ m_timesync_sender

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<timesync_sender_ct> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timesync_sender
protected

Definition at line 375 of file DataHandlingModel.hpp.

◆ m_timesync_thread

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
utilities::ReusableThread dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timesync_thread
protected

Definition at line 376 of file DataHandlingModel.hpp.

◆ ms

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::ms = 1000 * us
inlinestaticconstexpr

Definition at line 82 of file DataHandlingModel.hpp.

◆ ns

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::ns = 1
inlinestaticconstexpr

Definition at line 80 of file DataHandlingModel.hpp.

◆ s

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::s = 1000 * ms
inlinestaticconstexpr

Definition at line 83 of file DataHandlingModel.hpp.

◆ us

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::us = 1000 * ns
inlinestaticconstexpr

Definition at line 81 of file DataHandlingModel.hpp.


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