artdaq  v3_04_00
BoardReaderCore.cc
1 
2 #define TRACE_NAME (app_name + "_BoardReaderCore").c_str() // include these 2 first -
3 #include "artdaq/DAQdata/Globals.hh"
4 #include "artdaq/Application/TaskType.hh"
5 #include "artdaq/Application/BoardReaderCore.hh"
6 #include "artdaq-core/Data/Fragment.hh"
7 #include "artdaq-core/Utilities/ExceptionHandler.hh"
8 #include "artdaq/Application/makeCommandableFragmentGenerator.hh"
9 #include "canvas/Utilities/Exception.h"
10 #include "cetlib_except/exception.h"
11 #include <pthread.h>
12 #include <sched.h>
13 #include <algorithm>
14 
15 const std::string artdaq::BoardReaderCore::
16 FRAGMENTS_PROCESSED_STAT_KEY("BoardReaderCoreFragmentsProcessed");
17 const std::string artdaq::BoardReaderCore::
18 INPUT_WAIT_STAT_KEY("BoardReaderCoreInputWaitTime");
19 const std::string artdaq::BoardReaderCore::
20 BRSYNC_WAIT_STAT_KEY("BoardReaderCoreBRSyncWaitTime");
21 const std::string artdaq::BoardReaderCore::
22 OUTPUT_WAIT_STAT_KEY("BoardReaderCoreOutputWaitTime");
23 const std::string artdaq::BoardReaderCore::
24 FRAGMENTS_PER_READ_STAT_KEY("BoardReaderCoreFragmentsPerRead");
25 
26 std::unique_ptr<artdaq::DataSenderManager> artdaq::BoardReaderCore::sender_ptr_ = nullptr;
27 
29  parent_application_(parent_application)
30  /*, local_group_comm_(local_group_comm)*/
31  , generator_ptr_(nullptr)
32  , stop_requested_(false)
33  , pause_requested_(false)
34 {
35  TLOG(TLVL_DEBUG) << "Constructor";
41 }
42 
44 {
45  TLOG(TLVL_DEBUG) << "Destructor";
46 }
47 
48 bool artdaq::BoardReaderCore::initialize(fhicl::ParameterSet const& pset, uint64_t, uint64_t)
49 {
50  TLOG(TLVL_DEBUG) << "initialize method called with " << "ParameterSet = \"" << pset.to_string() << "\".";
51 
52  // pull out the relevant parts of the ParameterSet
53  fhicl::ParameterSet daq_pset;
54  try
55  {
56  daq_pset = pset.get<fhicl::ParameterSet>("daq");
57  }
58  catch (...)
59  {
60  TLOG(TLVL_ERROR)
61  << "Unable to find the DAQ parameters in the initialization "
62  << "ParameterSet: \"" + pset.to_string() + "\".";
63  return false;
64  }
65  fhicl::ParameterSet fr_pset;
66  try
67  {
68  fr_pset = daq_pset.get<fhicl::ParameterSet>("fragment_receiver");
69  data_pset_ = fr_pset;
70  }
71  catch (...)
72  {
73  TLOG(TLVL_ERROR)
74  << "Unable to find the fragment_receiver parameters in the DAQ "
75  << "initialization ParameterSet: \"" + daq_pset.to_string() + "\".";
76  return false;
77  }
78 
79  // pull out the Metric part of the ParameterSet
80  fhicl::ParameterSet metric_pset;
81  try
82  {
83  metric_pset = daq_pset.get<fhicl::ParameterSet>("metrics");
84  }
85  catch (...) {} // OK if there's no metrics table defined in the FHiCL
86 
87  if (metric_pset.is_empty())
88  {
89  TLOG(TLVL_INFO) << "No metric plugins appear to be defined";
90  }
91  try
92  {
93  metricMan->initialize(metric_pset, app_name);
94  }
95  catch (...)
96  {
97  ExceptionHandler(ExceptionHandlerRethrow::no,
98  "Error loading metrics in BoardReaderCore::initialize()");
99  }
100 
101  if (daq_pset.has_key("rank"))
102  {
103  if (my_rank >= 0 && daq_pset.get<int>("rank") != my_rank) {
104  TLOG(TLVL_WARNING) << "BoardReader rank specified at startup is different than rank specified at configure! Using rank received at configure!";
105  }
106  my_rank = daq_pset.get<int>("rank");
107  }
108  if (my_rank == -1)
109  {
110  TLOG(TLVL_ERROR) << "BoardReader rank not specified at startup or in configuration! Aborting";
111  exit(1);
112  }
113 
114 
115  // create the requested CommandableFragmentGenerator
116  std::string frag_gen_name = fr_pset.get<std::string>("generator", "");
117  if (frag_gen_name.length() == 0)
118  {
119  TLOG(TLVL_ERROR)
120  << "No fragment generator (parameter name = \"generator\") was "
121  << "specified in the fragment_receiver ParameterSet. The "
122  << "DAQ initialization PSet was \"" << daq_pset.to_string() << "\".";
123  return false;
124  }
125 
126  try
127  {
128  generator_ptr_ = artdaq::makeCommandableFragmentGenerator(frag_gen_name, fr_pset);
129  }
130  catch (...)
131  {
132  std::stringstream exception_string;
133  exception_string << "Exception thrown during initialization of fragment generator of type \""
134  << frag_gen_name << "\"";
135 
136  ExceptionHandler(ExceptionHandlerRethrow::no, exception_string.str());
137 
138  TLOG(TLVL_DEBUG) << "FHiCL parameter set used to initialize the fragment generator which threw an exception: " << fr_pset.to_string();
139 
140  return false;
141  }
142  metricMan->setPrefix(generator_ptr_->metricsReportingInstanceName());
143 
144  rt_priority_ = fr_pset.get<int>("rt_priority", 0);
145 
146  // fetch the monitoring parameters and create the MonitoredQuantity instances
147  statsHelper_.createCollectors(fr_pset, 100, 30.0, 60.0, FRAGMENTS_PROCESSED_STAT_KEY);
148 
149  // check if we should skip the sequence ID test...
150  skip_seqId_test_ = (generator_ptr_->fragmentIDs().size() > 1 || generator_ptr_->request_mode() != RequestMode::Ignored);
151 
152  verbose_ = fr_pset.get<bool>("verbose", true);
153 
154  return true;
155 }
156 
157 bool artdaq::BoardReaderCore::start(art::RunID id, uint64_t timeout, uint64_t timestamp)
158 {
159  logMessage_("Starting run " + boost::lexical_cast<std::string>(id.run()));
160  stop_requested_.store(false);
161  pause_requested_.store(false);
162 
163  fragment_count_ = 0;
164  prev_seq_id_ = 0;
165  statsHelper_.resetStatistics();
166 
167  metricMan->do_start();
168  generator_ptr_->StartCmd(id.run(), timeout, timestamp);
169  run_id_ = id;
170 
171  logMessage_("Completed the Start transition (Started run) for run " +
172  boost::lexical_cast<std::string>(run_id_.run()) +
173  ", timeout = " + boost::lexical_cast<std::string>(timeout) +
174  ", timestamp = " + boost::lexical_cast<std::string>(timestamp));
175  return true;
176 }
177 
178 bool artdaq::BoardReaderCore::stop(uint64_t timeout, uint64_t timestamp)
179 {
180  logMessage_("Stopping run " + boost::lexical_cast<std::string>(run_id_.run()) +
181  " after " + boost::lexical_cast<std::string>(fragment_count_) + " fragments.");
182  stop_requested_.store(true);
183 
184  TLOG(TLVL_DEBUG) << "Stopping CommandableFragmentGenerator BEGIN";
185  generator_ptr_->StopCmd(timeout, timestamp);
186  TLOG(TLVL_DEBUG) << "Stopping CommandableFragmentGenerator END";
187 
188  TLOG(TLVL_DEBUG) << "Stopping DataSenderManager";
189  if(sender_ptr_) sender_ptr_->StopSender();
190 
191  logMessage_("Completed the Stop transition for run " + boost::lexical_cast<std::string>(run_id_.run()));
192  return true;
193 }
194 
195 bool artdaq::BoardReaderCore::pause(uint64_t timeout, uint64_t timestamp)
196 {
197  logMessage_("Pausing run " + boost::lexical_cast<std::string>(run_id_.run()) +
198  " after " + boost::lexical_cast<std::string>(fragment_count_) + " fragments.");
199  pause_requested_.store(true);
200  generator_ptr_->PauseCmd(timeout, timestamp);
201  logMessage_("Completed the Pause transition for run " + boost::lexical_cast<std::string>(run_id_.run()));
202  return true;
203 }
204 
205 bool artdaq::BoardReaderCore::resume(uint64_t timeout, uint64_t timestamp)
206 {
207  logMessage_("Resuming run " + boost::lexical_cast<std::string>(run_id_.run()));
208  pause_requested_.store(false);
209  metricMan->do_start();
210  generator_ptr_->ResumeCmd(timeout, timestamp);
211  logMessage_("Completed the Resume transition for run " + boost::lexical_cast<std::string>(run_id_.run()));
212  return true;
213 }
214 
216 {
217  logMessage_("Starting Shutdown transition");
218  generator_ptr_->joinThreads(); // Cleanly shut down the CommandableFragmentGenerator
219  generator_ptr_.reset(nullptr);
220  metricMan->shutdown();
221  logMessage_("Completed Shutdown transition");
222  return true;
223 }
224 
225 bool artdaq::BoardReaderCore::soft_initialize(fhicl::ParameterSet const& pset, uint64_t, uint64_t)
226 {
227  TLOG(TLVL_DEBUG) << "soft_initialize method called with "
228  << "ParameterSet = \"" << pset.to_string()
229  << "\".";
230  return true;
231 }
232 
233 bool artdaq::BoardReaderCore::reinitialize(fhicl::ParameterSet const& pset, uint64_t, uint64_t)
234 {
235  TLOG(TLVL_DEBUG) << "reinitialize method called with "
236  << "ParameterSet = \"" << pset.to_string()
237  << "\".";
238  return true;
239 }
240 
242 {
243  if (rt_priority_ > 0)
244  {
245 #pragma GCC diagnostic push
246 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
247  sched_param s_param = {};
248  s_param.sched_priority = rt_priority_;
249  if (pthread_setschedparam(pthread_self(), SCHED_RR, &s_param))
250  TLOG(TLVL_WARNING) << "setting realtime priority failed";
251 #pragma GCC diagnostic pop
252  }
253 
254  // try-catch block here?
255 
256  // how to turn RT PRI off?
257  if (rt_priority_ > 0)
258  {
259 #pragma GCC diagnostic push
260 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
261  sched_param s_param = {};
262  s_param.sched_priority = rt_priority_;
263  int status = pthread_setschedparam(pthread_self(), SCHED_RR, &s_param);
264  if (status != 0)
265  {
266  TLOG(TLVL_ERROR)
267  << "Failed to set realtime priority to " << rt_priority_
268  << ", return code = " << status;
269  }
270 #pragma GCC diagnostic pop
271  }
272 
273  TLOG(TLVL_DEBUG) << "Initializing DataSenderManager. my_rank=" << my_rank;
274  sender_ptr_.reset(new artdaq::DataSenderManager(data_pset_));
275 
276  TLOG(TLVL_DEBUG) << "Waiting for first fragment.";
277  artdaq::MonitoredQuantityStats::TIME_POINT_T startTime;
278  double delta_time;
279  artdaq::FragmentPtrs frags;
280  bool active = true;
281 
282  while (active)
283  {
284  startTime = artdaq::MonitoredQuantity::getCurrentTime();
285 
286  TLOG(18) << "process_fragments getNext start";
287  active = generator_ptr_->getNext(frags);
288  TLOG(18) << "process_fragments getNext done (active=" << active << ")";
289  // 08-May-2015, KAB & JCF: if the generator getNext() method returns false
290  // (which indicates that the data flow has stopped) *and* the reason that
291  // it has stopped is because there was an exception that wasn't handled by
292  // the experiment-specific FragmentGenerator class, we move to the
293  // InRunError state so that external observers (e.g. RunControl or
294  // DAQInterface) can see that there was a problem.
295  if (!active && generator_ptr_ && generator_ptr_->exception())
296  {
297  parent_application_.in_run_failure();
298  }
299 
300  delta_time = artdaq::MonitoredQuantity::getCurrentTime() - startTime;
301  statsHelper_.addSample(INPUT_WAIT_STAT_KEY, delta_time);
302 
303  TLOG(16) << "process_fragments INPUT_WAIT=" << delta_time;
304 
305  if (!active) { break; }
306  statsHelper_.addSample(FRAGMENTS_PER_READ_STAT_KEY, frags.size());
307 
308  for (auto& fragPtr : frags)
309  {
310  if (!fragPtr.get())
311  {
312  TLOG(TLVL_WARNING) << "Encountered a bad fragment pointer in fragment " << fragment_count_ << ". "
313  << "This is most likely caused by a problem with the Fragment Generator!";
314  continue;
315  }
316  artdaq::Fragment::sequence_id_t sequence_id = fragPtr->sequenceID();
317  SetMFIteration("Sequence ID " + std::to_string(sequence_id));
318  statsHelper_.addSample(FRAGMENTS_PROCESSED_STAT_KEY, fragPtr->size());
319 
320  /*if ((fragment_count_ % 250) == 0)
321  {
322  TLOG(TLVL_DEBUG)
323  << "Sending fragment " << fragment_count_
324  << " with sequence id " << sequence_id << ".";
325  }*/
326 
327  // check for continous sequence IDs
328  if (!skip_seqId_test_ && abs(static_cast<int64_t>(sequence_id) - static_cast<int64_t>(prev_seq_id_)) > 1)
329  {
330  TLOG(TLVL_WARNING)
331  << "Missing sequence IDs: current sequence ID = "
332  << sequence_id << ", previous sequence ID = "
333  << prev_seq_id_ << ".";
334  }
335  prev_seq_id_ = sequence_id;
336 
337  startTime = artdaq::MonitoredQuantity::getCurrentTime();
338  TLOG(17) << "process_fragments seq=" << sequence_id << " sendFragment start";
339  auto res = sender_ptr_->sendFragment(std::move(*fragPtr));
340  TLOG(17) << "process_fragments seq=" << sequence_id << " sendFragment done (dest=" << res.first << ", sts=" << TransferInterface::CopyStatusToString(res.second) << ")";
341  ++fragment_count_;
342  statsHelper_.addSample(OUTPUT_WAIT_STAT_KEY,
343  artdaq::MonitoredQuantity::getCurrentTime() - startTime);
344 
345  bool readyToReport = statsHelper_.readyToReport(fragment_count_);
346  if (readyToReport)
347  {
348  std::string statString = buildStatisticsString_();
349  TLOG(TLVL_INFO) << statString;
350  }
351  if (fragment_count_ % 250 == 1 || readyToReport)
352  {
353  TLOG(TLVL_DEBUG)
354  << "Sending fragment " << fragment_count_
355  << " with SeqID " << sequence_id << ".";
356  }
357  }
358  if (statsHelper_.statsRollingWindowHasMoved()) { sendMetrics_(); }
359  frags.clear();
360  }
361 
362  sender_ptr_.reset(nullptr);
363 
364  // 11-May-2015, KAB: call MetricManager::do_stop whenever we exit the
365  // processing fragments loop so that metrics correctly go to zero when
366  // there is no data flowing
367  metricMan->do_stop();
368 
369  TLOG(TLVL_DEBUG) << "process_fragments loop end";
370 }
371 
372 std::string artdaq::BoardReaderCore::report(std::string const& which) const
373 {
374  std::string resultString;
375 
376  // pass the request to the FragmentGenerator instance, if it's available
377  if (generator_ptr_.get() != 0)
378  {
379  resultString = generator_ptr_->ReportCmd(which);
380  if (resultString.length() > 0) { return resultString; }
381  }
382 
383  // handle the request at this level, if we can
384  // --> nothing here yet
385 
386  // if we haven't been able to come up with any report so far, say so
387  std::string tmpString = app_name + " run number = ";
388  tmpString.append(boost::lexical_cast<std::string>(run_id_.run()));
389  tmpString.append(". Command=\"" + which + "\" is not currently supported.");
390  return tmpString;
391 }
392 
393 bool artdaq::BoardReaderCore::metaCommand(std::string const& command, std::string const& arg)
394 {
395  TLOG(TLVL_DEBUG) << "metaCommand method called with "
396  << "command = \"" << command << "\""
397  << ", arg = \"" << arg << "\""
398  << ".";
399 
400  if (generator_ptr_) return generator_ptr_->metaCommand(command, arg);
401 
402  return true;
403 }
404 
405 std::string artdaq::BoardReaderCore::buildStatisticsString_()
406 {
407  std::ostringstream oss;
408  oss << app_name << " statistics:" << std::endl;
409 
410  double fragmentCount = 1.0;
411  artdaq::MonitoredQuantityPtr mqPtr = artdaq::StatisticsCollection::getInstance().
412  getMonitoredQuantity(FRAGMENTS_PROCESSED_STAT_KEY);
413  if (mqPtr.get() != 0)
414  {
415  artdaq::MonitoredQuantityStats stats;
416  mqPtr->getStats(stats);
417  oss << " Fragment statistics: "
418  << stats.recentSampleCount << " fragments received at "
419  << stats.recentSampleRate << " fragments/sec, effective data rate = "
420  << (stats.recentValueRate * sizeof(artdaq::RawDataType)
421  / 1024.0 / 1024.0) << " MB/sec, monitor window = "
422  << stats.recentDuration << " sec, min::max event size = "
423  << (stats.recentValueMin * sizeof(artdaq::RawDataType)
424  / 1024.0 / 1024.0)
425  << "::"
426  << (stats.recentValueMax * sizeof(artdaq::RawDataType)
427  / 1024.0 / 1024.0)
428  << " MB" << std::endl;
429  fragmentCount = std::max(double(stats.recentSampleCount), 1.0);
430  oss << " Average times per fragment: ";
431  if (stats.recentSampleRate > 0.0)
432  {
433  oss << " elapsed time = "
434  << (1.0 / stats.recentSampleRate) << " sec";
435  }
436  }
437 
438  // 31-Dec-2014, KAB - Just a reminder that using "fragmentCount" in the
439  // denominator of the calculations below is important because the way that
440  // the accumulation of these statistics is done is not fragment-by-fragment
441  // but read-by-read (where each read can contain multiple fragments).
442  // 29-Aug-2016, KAB - BRSYNC_WAIT and OUTPUT_WAIT are now done fragment-by-
443  // fragment, but we'll leave the calculation the same. (The alternative
444  // would be to use recentValueAverage().)
445 
446  mqPtr = artdaq::StatisticsCollection::getInstance().
447  getMonitoredQuantity(INPUT_WAIT_STAT_KEY);
448  if (mqPtr.get() != 0)
449  {
450  oss << ", input wait time = "
451  << (mqPtr->getRecentValueSum() / fragmentCount) << " sec";
452  }
453 
454  mqPtr = artdaq::StatisticsCollection::getInstance().
455  getMonitoredQuantity(BRSYNC_WAIT_STAT_KEY);
456  if (mqPtr.get() != 0)
457  {
458  oss << ", BRsync wait time = "
459  << (mqPtr->getRecentValueSum() / fragmentCount) << " sec";
460  }
461 
462  mqPtr = artdaq::StatisticsCollection::getInstance().
463  getMonitoredQuantity(OUTPUT_WAIT_STAT_KEY);
464  if (mqPtr.get() != 0)
465  {
466  oss << ", output wait time = "
467  << (mqPtr->getRecentValueSum() / fragmentCount) << " sec";
468  }
469 
470  oss << std::endl << " Fragments per read: ";
471  mqPtr = artdaq::StatisticsCollection::getInstance().
472  getMonitoredQuantity(FRAGMENTS_PER_READ_STAT_KEY);
473  if (mqPtr.get() != 0)
474  {
475  artdaq::MonitoredQuantityStats stats;
476  mqPtr->getStats(stats);
477  oss << "average = "
478  << stats.recentValueAverage
479  << ", min::max = "
480  << stats.recentValueMin
481  << "::"
482  << stats.recentValueMax;
483  }
484 
485  return oss.str();
486 }
487 
488 void artdaq::BoardReaderCore::sendMetrics_()
489 {
490  //TLOG(TLVL_DEBUG) << "Sending metrics " << __LINE__ ;
491  double fragmentCount = 1.0;
492  artdaq::MonitoredQuantityPtr mqPtr = artdaq::StatisticsCollection::getInstance().
493  getMonitoredQuantity(FRAGMENTS_PROCESSED_STAT_KEY);
494  if (mqPtr.get() != 0)
495  {
496  artdaq::MonitoredQuantityStats stats;
497  mqPtr->getStats(stats);
498  fragmentCount = std::max(double(stats.recentSampleCount), 1.0);
499  metricMan->sendMetric("Fragment Count", static_cast<unsigned long>(stats.fullSampleCount), "fragments", 1, MetricMode::LastPoint);
500  metricMan->sendMetric("Fragment Rate", stats.recentSampleRate, "fragments/sec", 1, MetricMode::Average);
501  metricMan->sendMetric("Average Fragment Size", (stats.recentValueAverage * sizeof(artdaq::RawDataType)), "bytes/fragment", 2, MetricMode::Average);
502  metricMan->sendMetric("Data Rate", (stats.recentValueRate * sizeof(artdaq::RawDataType)), "bytes/sec", 2, MetricMode::Average);
503  }
504 
505  // 31-Dec-2014, KAB - Just a reminder that using "fragmentCount" in the
506  // denominator of the calculations below is important because the way that
507  // the accumulation of these statistics is done is not fragment-by-fragment
508  // but read-by-read (where each read can contain multiple fragments).
509  // 29-Aug-2016, KAB - BRSYNC_WAIT and OUTPUT_WAIT are now done fragment-by-
510  // fragment, but we'll leave the calculation the same. (The alternative
511  // would be to use recentValueAverage().)
512 
513  mqPtr = artdaq::StatisticsCollection::getInstance().
514  getMonitoredQuantity(INPUT_WAIT_STAT_KEY);
515  if (mqPtr.get() != 0)
516  {
517  metricMan->sendMetric("Avg Input Wait Time", (mqPtr->getRecentValueSum() / fragmentCount), "seconds/fragment", 3, MetricMode::Average);
518  }
519 
520  mqPtr = artdaq::StatisticsCollection::getInstance().
521  getMonitoredQuantity(BRSYNC_WAIT_STAT_KEY);
522  if (mqPtr.get() != 0)
523  {
524  metricMan->sendMetric("Avg BoardReader Sync Wait Time", (mqPtr->getRecentValueSum() / fragmentCount), "seconds/fragment", 3, MetricMode::Average);
525  }
526 
527  mqPtr = artdaq::StatisticsCollection::getInstance().
528  getMonitoredQuantity(OUTPUT_WAIT_STAT_KEY);
529  if (mqPtr.get() != 0)
530  {
531  metricMan->sendMetric("Avg Output Wait Time", (mqPtr->getRecentValueSum() / fragmentCount), "seconds/fragment", 3, MetricMode::Average);
532  }
533 
534  mqPtr = artdaq::StatisticsCollection::getInstance().
535  getMonitoredQuantity(FRAGMENTS_PER_READ_STAT_KEY);
536  if (mqPtr.get() != 0)
537  {
538  metricMan->sendMetric("Avg Frags Per Read", mqPtr->getRecentValueAverage(), "fragments/read", 4, MetricMode::Average);
539  }
540 }
541 
542 void artdaq::BoardReaderCore::logMessage_(std::string const& text)
543 {
544  if (verbose_)
545  {
546  TLOG(TLVL_INFO) << text;
547  }
548  else
549  {
550  TLOG(TLVL_DEBUG) << text;
551  }
552 }
void addMonitoredQuantityName(std::string const &statKey)
Add a MonitoredQuantity name to the list.
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Definition: Commandable.hh:20
Sends Fragment objects using TransferInterface plugins. Uses Routing Tables if confgiured, otherwise will Round-Robin Fragments to the destinations.
static const std::string FRAGMENTS_PROCESSED_STAT_KEY
Key for the Fragments Processed MonitoredQuantity.
static const std::string INPUT_WAIT_STAT_KEY
Key for the Input Wait MonitoredQuantity.
bool stop(uint64_t timeout, uint64_t timestamp)
Stop the BoardReader, and the CommandableFragmentGenerator.
virtual ~BoardReaderCore()
BoardReaderCore Destructor.
static std::string CopyStatusToString(CopyStatus in)
Convert a CopyStatus variable to its string represenatation
BoardReaderCore(Commandable &parent_application)
BoardReaderCore Constructor.
std::unique_ptr< CommandableFragmentGenerator > makeCommandableFragmentGenerator(std::string const &generator_plugin_spec, fhicl::ParameterSet const &ps)
Load a CommandableFragmentGenerator plugin.
bool reinitialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t)
Reinitialize the BoardReader. No-Op.
bool soft_initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t)
Soft-Initialize the BoardReader. No-Op.
static const std::string BRSYNC_WAIT_STAT_KEY
Key for the Sync Wait MonitoredQuantity.
static const std::string FRAGMENTS_PER_READ_STAT_KEY
Key for the Fragments Per Read MonitoredQuantity.
static const std::string OUTPUT_WAIT_STAT_KEY
Key for the Output Wait MonitoredQuantity.
bool initialize(fhicl::ParameterSet const &pset, uint64_t, uint64_t)
Initialize the BoardReaderCore.
std::string report(std::string const &which) const
Send a report on a given run-time quantity.
void process_fragments()
Main working loop of the BoardReaderCore.
bool start(art::RunID id, uint64_t timeout, uint64_t timestamp)
Start the BoardReader, and the CommandableFragmentGenerator.
bool resume(uint64_t timeout, uint64_t timestamp)
Resume the BoardReader, and the CommandableFragmentGenerator.
bool pause(uint64_t timeout, uint64_t timestamp)
Pause the BoardReader, and the CommandableFragmentGenerator.
bool shutdown(uint64_t)
Shutdown the BoardReader, and the CommandableFragmentGenerator.
bool metaCommand(std::string const &command, std::string const &arg)
Run a user-defined command on the CommandableFragmentGenerator.