lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Eb::MebContributor Class Reference

Sends L1Accepts to one chosen MEB buffer and transitions to every MEB, over libfabric client links. More...

#include <MebContributor.hh>

Public Types

using listU32_t = std::list< uint32_t >
 List of free transition buffer indices (one list per MEB link).
 

Public Member Functions

 MebContributor (const MebCtrbParams &)
 Keep a reference to the parameters; the event buffer size is prms.maxEvSize rounded up to whole pages.
 
int resetCounters ()
 Reset the event and transition counters; returns 0.
 
int connect (const std::shared_ptr< MetricExporter >)
 Register metrics with the exporter (if non-null), size the per-link vectors from prms.addrs and connect to all MEBs with linksConnect().
 
int configure ()
 For each link, (re)allocate the local region if its size changed (maxEvents of that MEB times the event buffer size, plus the transition buffers), exchange region information with EbLfCltLink::prepare() and refill the list of MEB_TR_BUFFERS transition buffer indices.
 
void unconfigure ()
 Set enabled() to false.
 
void disconnect ()
 Call unconfigure(), disconnect and drop all links, and set the ID to -1.
 
void shutdown ()
 Call disconnect() (harmless if already done).
 
bool enabled () const
 Return true between a successful configure() and unconfigure().
 
int post (const Pds::EbDgram *dataDatagram)
 Send a transition to every MEB: for each link take a free transition buffer index (polling the link, waiting up to 5 s if none is cached), copy the datagram into that local buffer and RDMA-write it.
 
int post (const Pds::EbDgram *dataDatagram, uint32_t destination)
 Send an L1Accept to the MEB and buffer index encoded (ImmData src and idx) in destination: copy it into the matching local buffer and RDMA-write it.
 

Detailed Description

Sends L1Accepts to one chosen MEB buffer and transitions to every MEB, over libfabric client links.

Each link gets a local region of event buffers followed by MEB_TR_BUFFERS transition buffers.

Member Typedef Documentation

◆ listU32_t

using Pds::Eb::MebContributor::listU32_t = std::list<uint32_t>

List of free transition buffer indices (one list per MEB link).

Constructor & Destructor Documentation

◆ MebContributor()

Pds::Eb::MebContributor::MebContributor ( const MebCtrbParams &  )

Keep a reference to the parameters; the event buffer size is prms.maxEvSize rounded up to whole pages.

Member Function Documentation

◆ configure()

int Pds::Eb::MebContributor::configure ( )

For each link, (re)allocate the local region if its size changed (maxEvents of that MEB times the event buffer size, plus the transition buffers), exchange region information with EbLfCltLink::prepare() and refill the list of MEB_TR_BUFFERS transition buffer indices.

Sets enabled() true and returns 0, or returns the first error (ENOMEM if allocation fails).

◆ connect()

int Pds::Eb::MebContributor::connect ( const std::shared_ptr< MetricExporter >  )

Register metrics with the exporter (if non-null), size the per-link vectors from prms.addrs and connect to all MEBs with linksConnect().

Returns 0 or the first error.

◆ disconnect()

void Pds::Eb::MebContributor::disconnect ( )

Call unconfigure(), disconnect and drop all links, and set the ID to -1.

◆ enabled()

bool Pds::Eb::MebContributor::enabled ( ) const
inline

Return true between a successful configure() and unconfigure().

◆ post() [1/2]

int Pds::Eb::MebContributor::post ( const Pds::EbDgram *  dataDatagram)

Send a transition to every MEB: for each link take a free transition buffer index (polling the link, waiting up to 5 s if none is cached), copy the datagram into that local buffer and RDMA-write it.

Aborts if the datagram is larger than maxTrSize, its source is not this contributor's ID, or no buffer index arrives; a failed write is only logged. Returns 0.

◆ post() [2/2]

int Pds::Eb::MebContributor::post ( const Pds::EbDgram *  dataDatagram,
uint32_t  destination 
)

Send an L1Accept to the MEB and buffer index encoded (ImmData src and idx) in destination: copy it into the matching local buffer and RDMA-write it.

Aborts on an invalid MEB or index, an oversize datagram (checked after the copy), a source ID mismatch, an out-of-range buffer, a non-advancing pulse ID, or a failed write. Returns 0.

◆ resetCounters()

int Pds::Eb::MebContributor::resetCounters ( )

Reset the event and transition counters; returns 0.

◆ shutdown()

void Pds::Eb::MebContributor::shutdown ( )

Call disconnect() (harmless if already done).

◆ unconfigure()

void Pds::Eb::MebContributor::unconfigure ( )

Set enabled() to false.


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