lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::Gpu::TrgInpGen Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TrgInpGen()

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.

◆ ~TrgInpGen()

Drp::Gpu::TrgInpGen::~TrgInpGen ( )

Destroy the graph and free what the constructor allocated.

Member Function Documentation

◆ handleBrokenEvent()

void Drp::Gpu::TrgInpGen::handleBrokenEvent ( const PGPEvent &  )
inline

Does nothing; empty body.

◆ resetEventCounter()

void Drp::Gpu::TrgInpGen::resetEventCounter ( )
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.

◆ setup()

bool Drp::Gpu::TrgInpGen::setup ( )

Record, instantiate and upload the graph.

Returns true on failure, else false.

◆ setupMetrics()

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.

◆ shutdown()

void Drp::Gpu::TrgInpGen::shutdown ( )

Join the receiver thread, which exits once the terminate flag is set.

◆ start()

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.

◆ startup()

bool Drp::Gpu::TrgInpGen::startup ( )

Reset the event counter check and launch the graph.

Returns false.


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