Event Buffer: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
By default the event buffer (used to contain the data from the event) is named SYSTEM. Its default size is 8MB.
{{Pagelinks}}


== Increase size of event buffer ==
== Increase size of events  ==
In some experiments, this may not be large enough.   
In some experiments, the default event size (currently 4MiB) may not be large enough.   


To increase the size, one must increase:
To increase the size of events, one must increase:
* the value of ODB [[/Experiment ODB tree #/Experiment/MAX_EVENT_SIZE |/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,
* max_event_size in the [[Frontend Operation#Frontend|Frontend]] and recompile
etc)
* max_event_size in the [[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]].


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


Ultimately, the maximum event size is limited by the size of the SYSTEM buffer which is  
For very large events, it will also be necessary to [[#Increase size of SYSTEM buffer|increase the size]] of the SYSTEM buffer (and any buffers used by the event builder etc).
limited by the physical memory of your computer. No recompilation of MIDAS necessary.
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 ==
== Limits on the bank and event sizes ==


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 frontend based on MIDAS [[mfe.c]] is limited to the value of max_event_size set by the user
# 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/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 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)
# 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 [[mlogger]], which also allocate buffer space to hold 1 event of maximum size.
# size of SYSTEM buffer can be [[#Increase size of SYSTEM buffer|increased]] to arbitrary size, but in practice no bigger than the amount of computer physical memory minus space needed for running the [[Frontend Operation#Frontend|Frontend]] program and [[mlogger]], which also allocate buffer space to hold 1 event of maximum size.




Line 39: Line 36:
data per event.
data per event.


Other considerations (rules of thumb):
<div id="other considerations"></div>
; 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 10-100 events.
Line 45: Line 43:
:: 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 [[frontend]]
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.
== Increase size of SYSTEM buffer ==
For large events it may be necessary to increase the size of the SYSTEM buffer. See [[#other considerations|note above]].
* shutdown all clients
* set ODB key [[/Experiment ODB tree#SYSTEM|/Experiment/Buffer Sizes/SYSTEM]] to the larger value (a power of 2)
* remove  SYSTEM shared memory file .SYSTEM.SHM (located in directory given by [[#Exptab]])
* restart clients
[[Category:Event]] [[Category:Frontend]] [[Category:Buffer]]

Latest revision as of 17:25, 25 August 2016


Increase size of events

In some experiments, the default event size (currently 4MiB) may not be large enough.

To increase the size of events, one must increase:

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

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

For very large events, it will also be necessary to increase the size of the SYSTEM buffer (and any buffers used by the event builder etc). 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 (Note that MAX_EVENT_SIZE in midas.h is no longer used).
  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.

Increase size of SYSTEM buffer

For large events it may be necessary to increase the size of the SYSTEM buffer. See note above.

  • shutdown all clients
  • set ODB key /Experiment/Buffer Sizes/SYSTEM to the larger value (a power of 2)
  • remove SYSTEM shared memory file .SYSTEM.SHM (located in directory given by #Exptab)
  • restart clients