FairMQ/fairmq
winckler d1bba61939 - FairMQ options:
a) move the XML parser into the FairMQ/options/FairMQParser.h
b) add a routine in FairMQProgOption to check whether the necessary XML or JSON input files are there, and send an error message if not there

- Policy based devices:
a) rename GenericSampler to base_GenericSampler and use an alias template named GenericSampler
b) in base_GenericSampler, rename template parameter to simple variables <T,U,… > and use typedef for clarity
c) introduce an anonymous function container in the base_GenericSampler host class with a register task template member function and an Executetasks()
d) add two new template parameters in base_GenericSampler for the anonymous function container map. parameter is K for the key type (default=int) and L for the value type (default=std::function<void()>)

- Tutorial7:
a) use FairMQProgOption to configure devices in tutorial7
b) introduce several template functions helper in tutorial7 to reduce code redundancy
c) show examples in tutorial7 of task registration with callback and lambda expression for the sampler devices
d) separate the executable build of the tutorial7 data generator to remove the Roofit banner when executing the MQdevices
2015-09-28 12:17:21 +02:00
..
devices - FairMQ options: 2015-09-28 12:17:21 +02:00
examples Fixed a typo in example config 2015-06-30 16:48:36 +02:00
nanomsg Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
options - FairMQ options: 2015-09-28 12:17:21 +02:00
prototest Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
run Add first two simple FairMQ examples 2015-06-22 16:35:00 +02:00
tools - FairMQ options: 2015-09-28 12:17:21 +02:00
zeromq Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
.clang-format use clang-format for FairMQ 2014-06-06 14:30:41 +02:00
apply-clang-format.sh use clang-format for Tutorial3 2014-06-06 14:30:41 +02:00
CMakeLists.txt - FairMQ options: 2015-09-28 12:17:21 +02:00
FairMQChannel.cxx Fix Coverity issues 2015-06-26 18:01:40 +02:00
FairMQChannel.h Fix uncaught exceptions 2015-06-19 12:33:06 +02:00
FairMQConfigurable.cxx Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
FairMQConfigurable.h Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
FairMQDevice.cxx Correct mistake in channel validation 2015-06-19 14:49:32 +02:00
FairMQDevice.h Add WaitForInitialValidation() 2015-06-19 12:33:10 +02:00
FairMQLogger.cxx Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
FairMQLogger.h Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
FairMQMessage.cxx Add license file LICENSE with LPGL license text copied from https://www.gnu.org/licenses/lgpl.html. Add license text to most of files of the project. 2014-06-06 14:57:56 +02:00
FairMQMessage.h Extend the FairMQ transport interface by allowing the user of the FairMQMessage class to define his own deallocation function. 2014-06-12 15:31:43 +02:00
FairMQPoller.cxx Add license file LICENSE with LPGL license text copied from https://www.gnu.org/licenses/lgpl.html. Add license text to most of files of the project. 2014-06-06 14:57:56 +02:00
FairMQPoller.h - Proper process termination: 2014-08-20 13:48:51 +02:00
FairMQSocket.cxx Add license file LICENSE with LPGL license text copied from https://www.gnu.org/licenses/lgpl.html. Add license text to most of files of the project. 2014-06-06 14:57:56 +02:00
FairMQSocket.h Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
FairMQStateMachine.cxx Fix Coverity issues 2015-06-26 18:01:40 +02:00
FairMQStateMachine.h add WaitForEndOfStateForMs(state, duration) 2015-06-17 16:01:11 +02:00
FairMQTransportFactory.cxx Add license file LICENSE with LPGL license text copied from https://www.gnu.org/licenses/lgpl.html. Add license text to most of files of the project. 2014-06-06 14:57:56 +02:00
FairMQTransportFactory.h Update FairMQStateMachine & introduce FairMQChannels 2015-06-16 09:29:53 +02:00
README.md fix ID in startAll script and a broken link in documentation. 2014-08-26 09:29:55 +02:00

FairMQ

The standard FairRoot is running all the different analysis tasks within one process. The FairMQ (Message Queue) allows starting tasks on different processes and provides the communication layer between these processes.

Devices

The components encapsulating the tasks are called devices and derive from the common base class FairMQDevice. FairMQ provides ready to use devices to organize the dataflow between the components (without touching the contents of a message), providing functionality like merging and splitting of the data stream (see subdirectory devices).

A number of devices to handle the data from the Tutorial3 detector of FairRoot are provided as an example and can be found in FairRoot/base/MQ directory. The implementation of the tasks run by these devices can be found FairRoot/example/Tutorial3. The implementation includes sending raw binary data as well as serializing the data with either Boost Serialization, Google Protocol Buffers or Root TMessage. Following the examples you can implement your own devices to transport arbitrary data.

Topology

Devices are arranged into topologies where each device has a defined number of data inputs and outputs.

Example of a simple FairMQ topology:

example of FairMQ topology

Topology configuration is currently happening via setup scripts. This is very rudimentary and a much more flexible system is now in development. For now, example setup scripts can be found in directory FairRoot/example/Tutorial3/ along with some additional documentation.

Messages

Devices transport data between each other in form of FairMQMessages. These can be filled with arbitrary content and transport either raw data or serialized data as described above. Message can be initialized in three different ways:

  • with no parameters: This is usefull for receiving a message, since neither size nor contents are yet known.
  • given message size: Initialize message body with a size and fill the contents later, either with memcpy or by writing directly into message memory.
  • given message size and buffer: initialize the message given an existing buffer. This is a zero-copy operation.

After sending the message, the queueing system takes over control over the message body and will free it with free() after it is no longer used. A callback can be given to the message object, to be called instead of the destruction with free().

Transport Interface

The communication layer is available through an interface. Two interface implementations are currently available. Main implementation uses the ZeroMQ library. Alternative implementation relies on the nanomsg library. Here is an overview to give an idea how interface is implemented:

FairMQ transport interface