Shared memory interface - art-daq/artdaq GitHub Wiki

Shared memory interface

art Process Management

In artdaq v3, art is started as a separate process by the SharedMemoryEventManager.
SMEM::RunArt starts a new instance of art, and restarts it when it closes
SMEM::StartArt starts the configured number of art processes using the configured art ParameterSet
SMEM::StartArtProcess starts an art process using the given configuration file (used so that each connected Online Monitor has its own Dispatcher art process)
SMEM::ShutdownArtProcesses kills all running art processes and reports their return codes
SMEM::ReconfigureArt starts the configured number of art processes using a new ParameterSet

The default is that the art ParameterSet is the same as the application’s ParameterSet with the daq: {} key removed (this is the same behavior as previous versions of artdaq.
The Dispatcher, however, will start art processes using ParameterSet data it received through the register_monitor command. This allows some prefiltering to be done on the Dispatcher before transferring data to the monitors, or implementing partial transfer in an art::EDAnalyzer module.

Data Flow

The shared memory interface is similar between the EventBuilder, DataLogger and Dispatcher.

  1. A Fragment Header is received by a Transfer plugin running in the runReceiver_ loop of DataReceiverManager
  2. DataReceiverManager passes the Fragment Header to SharedMemoryEventManager
  3. SharedMemoryEventManager determines whether it has a buffer allocated for the Fragment’s sequence ID
    #* If not, one is allocated if buffer space is available
    #* If no buffer space is available, a nullptr is returned
  4. SMEM returns the pointer to the buffer where the Fragment should be saved
  5. DataReceiverManager calls the TransferInterface::receiveFragmentData function targeting the pointer received from SMEM
  6. Once the transfer completes, DataReceiverManager informs SMEM
  7. If the Fragment completes an event (fragment count for that sequence ID is equal to the expected fragment count), the buffer is marked “Full”
  8. The art SharedMemoryEventReceiver loops over the shared memory buffers looking for “Full” buffers
  9. SMER copies event into art for analysis