Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using BinarySearchQueueModel with HSI data sometimes results in data not being found #62

Open
strilov opened this issue Oct 3, 2022 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@strilov
Copy link

strilov commented Oct 3, 2022

When using BinarySearchQueueModel with HSI data, there is a pathology where the data is not found successfully if the occupancy of the queue is 1. The debug output of such a case is pasted below.

Data request for trig/seq_num=1.0 with
Trigger TS=104034153929408170
Oldest stored TS=104034153929408170
Newest stored TS=104034153929408170
Start of window TS=104034153929407170
End of window TS=104034153929409170 Latency buffer occupancy=1
2022-Sep-30 15:01:03,862 LOG [dunedaq::readoutlibs::DefaultRequestHandlerModel<ReadoutType, LatencyBufferType>::RequestResult dunedaq::readoutlibs::DefaultRequestHandlerModel<ReadoutType, LatencyBufferType>::data_request(dunedaq::dfmessages::DataRequest, bool) [with ReadoutType = dunedaq::hsilibs::TIMING_HSI_FRAME_STRUCT; LatencyBufferType = dunedaq::readoutlibs::BinarySearchQueueModel<dunedaq::hsilibs::TIMING_HSI_FRAME_STRUCT>; RequestResult = dunedaq::readoutlibs::RequestHandlerConcept<dunedaq::hsilibs::TIMING_HSI_FRAME_STRUCT, dunedaq::readoutlibs::BinarySearchQueueModel<dunedaq::hsilibs::TIMING_HSI_FRAME_STRUCT> >::RequestResult] at /cvmfs/dunedaq-development.opensciencegrid.org/candidates/rc-v3.2.0-1/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/readoutlibs-rc-v3.2.0-1-k2fzlhldjutrnr5d4vjsnkz5i5bwtnjc/include/readoutlibs/models/detail/DefaultRequestHandlerModel.hxx:511] Returning partial fragment for trig/seq number 1.0 with TS 104034153929408170. Component subsystem: HW_Signals_Interface id: 0 with type Hardware_Signal
2022-Sep-30 15:01:03,862 LOG [typename dunedaq::readoutlibs::IterableQueueModel<T>::Iterator dunedaq::readoutlibs::BinarySearchQueueModel<T>::lower_bound(T&, bool) [with T = dunedaq::hsilibs::TIMING_HSI_FRAME_STRUCT; typename dunedaq::readoutlibs::IterableQueueModel<T>::Iterator = dunedaq::readoutlibs::IterableQueueModel<dunedaq::hsilibs::TIMING_HSI_FRAME_STRUCT>::Iterator] at /cvmfs/dunedaq-development.opensciencegrid.org/candidates/rc-v3.2.0-1/spack-0.18.1-gcc-12.1.0/spack-0.18.1/opt/spack/gcc-12.1.0/readoutlibs-rc-v3.2.0-1-k2fzlhldjutrnr5d4vjsnkz5i5bwtnjc/include/readoutlibs/models/detail/BinarySearchQueueModel.hxx:24] Could not find element
@roland-sipos
Copy link
Member

Hi @strilov .
There was a window extraction logic change from @ShyamB97 and @alessandrothea .
Can you please check if thie patch fixes this issue?
0333e70

@roland-sipos roland-sipos added question Further information is requested bug Something isn't working labels Oct 20, 2022
@strilov
Copy link
Author

strilov commented Oct 21, 2022

Hi @roland-sipos. I don't think the patch above will fix the issue. As far as I can see, the issue is in the lower_bound method of BinarySearchQueueModel, which gets called before the code modifications above.

This if statement, https://github.com/DUNE-DAQ/readoutlibs/blob/develop/include/readoutlibs/models/detail/BinarySearchQueueModel.hxx#L23, will always fail with the buffer parameters above, since by construction the start window ts is always lower than the trigger ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants