Skip to content

A more robust StdDataLoop

Alex Toldaiev requested to merge otoldaie/YARR:devel_robustStdDataLoop into devel

3 minor improvements:

  1. A new option maxConsecutivePushes. If set to >0, it limits the number of pushes to the data processors before looking at their feedback. I.e. the maxConsecutiveRxReads roughly limits the size of RawDataContainers and maxConsecutivePushes limits the number of containers that are pushed before StdDataLoop checks the processing counts.

The goal is to handle large streams of data or autogenerated data, like HPRs in Strips. HPRs are not currently separated from data in FELIX FW. We turn them ON for debugging, but then they clog StdDataLoop if you debug many HCCs and ABCs. Admittedly, the debugging could also be done with DataGatherer. But StdDataLoop is handy, because it specifies the number of triggers you expect.

Filtering HPRs in FW will take some thinking time, because Strips have many RX elinks and duplicating them just for HPRs and register reads seems like a waste. It would be nice to aggregate HPRs in few FW elinks in some meaningful way. E.g. to timestamp them etc. All of that needs thinking. Meanwhile, let's just try to handle them in software to some reasonable extend.

Also notice, the parameter value 0 means setting no limit in both maxConsecutivePushes and maxConsecutiveRxReads. So, if they are both set to 0 and maxIterationTime is set to 0, StdDataLoop::execPart2 behaves exactly like before the processing feedback was added: it reads the RxCore until there is no more data, pushes everything it got to processing, and returns.

  1. Then, StdDataLoop logs on DEBUG level when it notices that the trigger thread is done. It is a nice metric to log. And it is needed to measure how fast felixclient can send triggers. Currently, Strips StarTriggerLoop code sends triggers one at a time to each TX elink, and felixclient cannot reach above 1-2KHz rate.

  2. Finally, it logs the empty cycle statistics only to TRACE level instead of DEBUG, to keep the log cleaner. It may also be reasonable to just skip logging empty cycles altogether.

    modified:   src/libYarr/StdDataLoop.cpp
    modified:   src/libYarr/include/StdDataLoop.h

Merge request reports