You are here: GSI Wiki>DABC Web>MbsSupport>MbsImplementation (2010-04-09, HansEssel)Edit Attach

MBS upgrade for DABC

To have minimal changes, we use standard collector and transport. Two different changes must be done:

1. Increased buffer size support

This has been done in a completely compatible way. The only problem was the 16 bit i_used field in the buffer header keeping the number of 16 bit data words (behind buffer header). With a new rule we store this number in 32 bit field l_free[2]. Only if dlen is less equal MAX__DLEN defined as (32K-sizeof(bufhe))/2 this number is also stored in i_used as before. Modifications have to be made in all MBS modules accessing i_used. Modules outside MBS can be modified on demand to support large buffers. Current buffers still can be handled without change.
When MBS writes large buffer files only the used part of the file header is written. Number of 16 bit words behind buffer header structure is written in filhe_used.
Event API f_evt is updated to handle large buffers on input.
Note: By setup the number of buffers per stream can be set to one. This suppresses event spanning.
Large buffers can be used by standard MBS.
Modules affected:
f_col_format, f_col_checkbuf, f_ut_evt_print, f_ut_stream_print, f_tr_write_filhe, remote event server.

2. Variable sized buffers

As a second step variable sized buffers are implemented. They get a new type 100. The allocated buffers are still fixed length as before. However, the transport would write only the used part of the buffers to clients. Processing these buffers a module must first read the header, then get the used size from iUsedWords (free[2]) and read the rest. Modules outside MBS must be modified to process such buffers.
In MBS, after stream buffers are created, buffer types are set to 100 by a new command enable dabc in transport. This command sets the transport synchronous mode. In this mode m_transport processes streams only if a client is connected.
Only m_transport (and m_stream_serv if needed) had to be changed to send only the used buffer parts. All other modules just have to process type 100 as type 10. Question? how to avoid data loss when client disconnects/connects? Works!
Modules affected:
m_transport, f_col_format, f_col_checkbuf, f_ut_evt_print, f_ut_stream_print.
Not supported in this mode:
Event server.

Implementation notes
Stream segment is created by f_ut_get_evt_streams and formatted by f_ut_init_evt_streams. Buffer headers are formatted in f_col_format. Stream segments are created by either collector (and its variants) or transport or stream_serv or event_serv or daq_rate.

-- HansEssel - 25 Oct 2007
Topic revision: r7 - 2010-04-09, HansEssel
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)