|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Runs the trigger primitive for each received buffer in a self-relaunching CUDA graph, taking buffers from the reader queues in turn and passing them to the host through a ring queue. More...
#include <TrgInpGen.hh>
Public Member Functions | |
| TrgInpGen (const Parameters &, MemPoolGpu &, const std::shared_ptr< Reader > &, Pds::Trg::TriggerPrimitive *, cudaExecutionContext_t, const std::atomic< bool > &terminate, const cuda::std::atomic< unsigned > &terminate_d) | |
| Copy the reader queue pointers to the device and create the device-to-host queue, a stream in green_ctx, the device state, index and return-code words and the pinned metric counters. | |
| ~TrgInpGen () | |
| Destroy the graph and free what the constructor allocated. | |
| int | setupMetrics (const std::shared_ptr< Pds::MetricExporter >, std::map< std::string, std::string > &labels) |
| Reset the counters and add the DRP_tigState, DRP_tigRcv, DRP_tigFwd, DRP_colRcv, DRP_pidWtCtr, DRP_colQueOcc, DRP_evtCtr and drp_* metrics to exporter; returns 0. | |
| bool | setup () |
| Record, instantiate and upload the graph. | |
| bool | startup () |
| Reset the event counter check and launch the graph. | |
| void | start (SPSCQueue< unsigned > &collectorQueue) |
| Start the receiver thread, which pushes the number of ready buffers to collectorQueue after each pass and shuts the queue down when it exits. | |
| void | shutdown () |
| Join the receiver thread, which exits once the terminate flag is set. | |
| void | handleBrokenEvent (const PGPEvent &) |
| Does nothing; empty body. | |
| void | resetEventCounter () |
| Reset the last event counter used by the jump check to 0 (per the code comment, an EvtCounter reset); called by startup() and on BeginRun. | |
Runs the trigger primitive for each received buffer in a self-relaunching CUDA graph, taking buffers from the reader queues in turn and passing them to the host through a ring queue.
A receiver thread then checks each buffer's DMA descriptor and TimingHeader, fills in its PGPEvent and tells the collector how many buffers are ready.
| Drp::Gpu::TrgInpGen::TrgInpGen | ( | const Parameters & | , |
| MemPoolGpu & | , | ||
| const std::shared_ptr< Reader > & | , | ||
| Pds::Trg::TriggerPrimitive * | , | ||
| cudaExecutionContext_t | , | ||
| const std::atomic< bool > & | terminate, | ||
| const cuda::std::atomic< unsigned > & | terminate_d | ||
| ) |
Copy the reader queue pointers to the device and create the device-to-host queue, a stream in green_ctx, the device state, index and return-code words and the pinned metric counters.
| Drp::Gpu::TrgInpGen::~TrgInpGen | ( | ) |
Destroy the graph and free what the constructor allocated.
|
inline |
Does nothing; empty body.
|
inline |
Reset the last event counter used by the jump check to 0 (per the code comment, an EvtCounter reset); called by startup() and on BeginRun.
| bool Drp::Gpu::TrgInpGen::setup | ( | ) |
Record, instantiate and upload the graph.
Returns true on failure, else false.
| int Drp::Gpu::TrgInpGen::setupMetrics | ( | const std::shared_ptr< Pds::MetricExporter > | , |
| std::map< std::string, std::string > & | labels | ||
| ) |
Reset the counters and add the DRP_tigState, DRP_tigRcv, DRP_tigFwd, DRP_colRcv, DRP_pidWtCtr, DRP_colQueOcc, DRP_evtCtr and drp_* metrics to exporter; returns 0.
| void Drp::Gpu::TrgInpGen::shutdown | ( | ) |
Join the receiver thread, which exits once the terminate flag is set.
| void Drp::Gpu::TrgInpGen::start | ( | SPSCQueue< unsigned > & | collectorQueue | ) |
Start the receiver thread, which pushes the number of ready buffers to collectorQueue after each pass and shuts the queue down when it exits.
| bool Drp::Gpu::TrgInpGen::startup | ( | ) |
Reset the event counter check and launch the graph.
Returns false.