Event Buffer: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
(Created page with "By default the event buffer (used to contain the data from the event) is named SYSTEM. Its default size is 8MB. == Increase size of event buffer == In some experiments, this...")
 
No edit summary
Line 5: Line 5:


To increase the size, one must increase:
To increase the size, one must increase:
* the value of ODB /Experiment/MAX_EVENT_SIZE
* the value of ODB [[/Experiment ODB tree #/Experiment/MAX_EVENT_SIZE |/Experiment/MAX_EVENT_SIZE]]
* the size of the SYSTEM shared memory event buffer (and any buffers used by the event builder,  
* the size of the SYSTEM shared memory event buffer (and any buffers used by the event builder,  
etc)
etc)
Line 20: Line 20:


Limitations in order:
Limitations in order:




# bank32 size is limited to a 32 bit integer size (about 4000 Gbytes)
# bank32 size is limited to a 32 bit integer size (about 4000 Gbytes)
# bank size is limited by event size
# bank size is limited by event size
# event size in a midas mfe.c based frontend is limited to the value of max_event_size set by the user
# event size in a frontend based on MIDAS [[mfe.c]] is limited to the value of max_event_size set by the user
# maximum event size that can go through the MIDAS event buffer system is limited to ODB value /Experiment/MAX_EVENT_SIZE (MAX_EVENT_SIZE in midas.h does not do anything now)
# maximum event size that can go through the MIDAS event buffer system is limited to ODB value [[/Experiment/MAX_EVENT_SIZE (MAX_EVENT_SIZE in midas.h does not do anything now)
# maximum event size is limited to *half* the size of the SYSTEM shared memory event buffer (or any other buffers that the event has to go through)
# maximum event size is limited to '''half''' the size of the SYSTEM shared memory event buffer (or any other buffers that the event has to go through)
# default size of the SYSTEM buffer is 8 Mbytes set by ODB /Experiment/Buffer sizes/SYSTEM. This limits maximum event size to about 4 Mbytes.
# default size of the SYSTEM buffer is 8 Mbytes set by ODB /Experiment/Buffer sizes/SYSTEM. This limits maximum event size to about 4 Mbytes.
# size of SYSTEM buffer can be increased to arbitrary size, but in practice no bigger than the amount of computer physical memory minus space needed for running the frontend program and the mlogger, which also allocate buffer space to hold 1 event of maximum size.
# size of SYSTEM buffer can be increased to arbitrary size, but in practice no bigger than the amount of computer physical memory minus space needed for running the [[frontend]] program and [[mlogger]], which also allocate buffer space to hold 1 event of maximum size.
 




Line 37: Line 35:
write 1 Gbyte events from your frontend to disk.
write 1 Gbyte events from your frontend to disk.


In practice, I think the biggest events I have seen go through a MIDAS system are
In practice, some of the biggest events to go through a MIDAS system are
non-compressed waveforms in the T2K/ND280 FGD and TPC detectors, about 4 Mbytes of
non-compressed waveforms in the T2K/ND280 FGD and TPC detectors, about 4 Mbytes of
data per event.
data per event.
Line 45: Line 43:
# the SYSTEM event buffer should be big enough to hold 10-100 events.
# the SYSTEM event buffer should be big enough to hold 10-100 events.
# the SYSTEM event buffer should be big enough to hold about 5-10 seconds of data
# the SYSTEM event buffer should be big enough to hold about 5-10 seconds of data
:: i.e. if your event size is 1 Mbyte and data rate is 1 Hz, 10 seconds of data will be 1Mbyte*1Hz*10sec = 10 Mbytes.
:: i.e. if the event size is 1 Mbyte and data rate is 1 Hz, 10 seconds of data will be 1Mbyte*1Hz*10sec = 10 Mbytes.


This is because the SYSTEM buffer decouples the real-time activity of the frontend
This is because the SYSTEM buffer decouples the real-time activity of the [[frontend]]
program from non-real-time activity of writing data to storage devices.
program from non-real-time activity of writing data to storage devices.

Revision as of 11:59, 21 August 2013

By default the event buffer (used to contain the data from the event) is named SYSTEM. Its default size is 8MB.

Increase size of event buffer

In some experiments, this may not be large enough.

To increase the size, one must increase:

  • the value of ODB /Experiment/MAX_EVENT_SIZE
  • the size of the SYSTEM shared memory event buffer (and any buffers used by the event builder,

etc)

Actual limits on the bank size and event size are described below.


Ultimately, the maximum event size is limited by the size of the SYSTEM buffer which is limited by the physical memory of your computer. No recompilation of MIDAS necessary.


Limits on the bank and event sizes

Limitations in order:


  1. bank32 size is limited to a 32 bit integer size (about 4000 Gbytes)
  2. bank size is limited by event size
  3. event size in a frontend based on MIDAS mfe.c is limited to the value of max_event_size set by the user
  4. maximum event size that can go through the MIDAS event buffer system is limited to ODB value [[/Experiment/MAX_EVENT_SIZE (MAX_EVENT_SIZE in midas.h does not do anything now)
  5. maximum event size is limited to half the size of the SYSTEM shared memory event buffer (or any other buffers that the event has to go through)
  6. default size of the SYSTEM buffer is 8 Mbytes set by ODB /Experiment/Buffer sizes/SYSTEM. This limits maximum event size to about 4 Mbytes.
  7. size of SYSTEM buffer can be increased to arbitrary size, but in practice no bigger than the amount of computer physical memory minus space needed for running the frontend program and mlogger, which also allocate buffer space to hold 1 event of maximum size.


So for a computer with 8 Gbytes of RAM, you can make the SYSTEM buffer size 4 GBytes, set ODB MAX_EVENT_SIZE to 1 Gbyte, and in theory, you should be able to write 1 Gbyte events from your frontend to disk.

In practice, some of the biggest events to go through a MIDAS system are non-compressed waveforms in the T2K/ND280 FGD and TPC detectors, about 4 Mbytes of data per event.

Other considerations (rules of thumb):

  1. the SYSTEM event buffer should be big enough to hold 10-100 events.
  2. the SYSTEM event buffer should be big enough to hold about 5-10 seconds of data
i.e. if the event size is 1 Mbyte and data rate is 1 Hz, 10 seconds of data will be 1Mbyte*1Hz*10sec = 10 Mbytes.

This is because the SYSTEM buffer decouples the real-time activity of the frontend program from non-real-time activity of writing data to storage devices.