DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Inter-Process Messaging
The IPM library provides the low-level library for for sending messages between DUNE DAQ processes. IPM deals with messages consisting of arrays of bytes: higher-level concepts such as object serialization/deserialization will be handled by other libraries and processes building on IPM.
IPM provides two communication patterns:
Sender
/Receiver
, a pattern in which one sender talks to one receiverPublisher
/Subscriber
, a pattern in which one sender talks to zero or more receivers. Each message goes to all subscribersUsers should interact with IPM via the interfaces dunedaq::ipm::Sender
, dunedaq::ipm::Receiver
and dunedaq::ipm::Subscriber
, which are created using the factory functions dunedaq::ipm::makeIPM(Sender|Receiver|Subscriber)
, which each take a string argument giving the implementation type. The currently-available implementation types all use ZeroMQ, and are:
ZmqSender
implementing dunedaq::ipm::Sender
in the sender/receiver patternZmqReceiver
implementing dunedaq::ipm::Receiver
ZmqPublisher
implementing dunedaq::ipm::Sender
in the publisher/subscriber patternZmqSubscriber
implementing dunedaq::ipm::Subscriber
Basic example of the sender/receiver pattern:
Basic example of the publisher/subscriber pattern:
More complete examples can be found in the test/plugins
directory.
Currently, ZmqContext.hpp
has two environment variables used to configure ZeroMQ within each application:
IPM_ZMQ_IO_THREADS
: Sets the number of threads in the ZeroMQ context. ipm does not specify a default, the ZeroMQ default is 1.IPM_ZMQ_MAX_SOCKETS
: Set the maximum number of sockets allowed on the context. ipm uses a minimum value of 16636.