Event Buffer: Difference between revisions
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
* 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) | ||
* max_event_size in the [[ | * max_event_size in the [[Frontend Operation#Frontend|Frontend]] and recompile | ||
Actual limits on the bank size and event size are [[#Limits on the bank and event sizes|described below]]. | Actual limits on the bank size and event size are [[#Limits on the bank and event sizes|described below]]. | ||
Line 24: | Line 24: | ||
# 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 | # event size in a [[Frontend Operation#Frontend|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 ODB tree #/Experiment/MAX_EVENT_SIZE |/Experiment/MAX_EVENT_SIZE]] (Note that MAX_EVENT_SIZE in midas.h is no longer used). | # maximum event size that can go through the MIDAS event buffer system is limited to ODB value [[/Experiment ODB tree #/Experiment/MAX_EVENT_SIZE |/Experiment/MAX_EVENT_SIZE]] (Note that MAX_EVENT_SIZE in midas.h is no longer used). | ||
# 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) | ||
Line 45: | Line 45: | ||
:: 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. | :: 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 [[ | This is because the SYSTEM buffer decouples the real-time activity of the [[Frontend Operation#Frontend|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 14:03, 24 October 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)
- max_event_size in the Frontend and recompile
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:
- bank32 size is limited to a 32 bit integer size (about 4000 Gbytes)
- bank size is limited by event size
- 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 (Note that MAX_EVENT_SIZE in midas.h is no longer used).
- 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.
- 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):
- 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
- 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.