FairMQ/examples/multiple-transports
2020-05-11 17:38:16 +02:00
..
CMakeLists.txt Rename some test names for consistency 2019-03-06 14:23:08 +01:00
fairmq-start-ex-multiple-transports.sh.in Remove nanomsg transport 2020-05-11 17:38:16 +02:00
README.md Remove nanomsg transport 2020-05-11 17:38:16 +02:00
runSampler1.cxx Add config plugin class. 2019-07-10 19:35:18 +02:00
runSampler2.cxx Add config plugin class. 2019-07-10 19:35:18 +02:00
runSink.cxx Add config plugin class. 2019-07-10 19:35:18 +02:00
Sampler1.cxx Add config plugin class. 2019-07-10 19:35:18 +02:00
Sampler1.h Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
Sampler2.cxx Add config plugin class. 2019-07-10 19:35:18 +02:00
Sampler2.h Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
Sink.cxx Add config plugin class. 2019-07-10 19:35:18 +02:00
Sink.h Fix various warnings 2018-05-24 13:03:06 +02:00
test-ex-multiple-transports.sh.in Remove nanomsg transport 2020-05-11 17:38:16 +02:00

Multiple Transports example

This example demonstrates use of multiple transports (zeromq/shmem) within the same topology and/or device. It is a simple topology consisting of two samplers and a sink. The devices are connected via 3 channels:

Multiple Transports example

Each device has main transport that it uses. By default it is ZeroMQ, and can be overriden via the --transport cmd option. The device will initialize additional transports if any of the channels have them configured (e.g. as an option to --channel-config).

In this example sampler1 and sink are started with --transport shmem, making shared memory their main transport, sampler2 with --transport zeromq. Additionally, the ack channel is configured to use zeromq as its transport.

The main two things that a transport does is transfer of data and allocation of memory for the messages. By default, new messages are created via the main device transport. If a message has been created with one transport and is to be transferred with another, it has to be copied into a new message of the target transport. This happens automatically behind the scenes. To avoid this copy the device can create messages via NewMessageFor(const string& channelName, int subChannelIndex, ...) method, that creates the messages via the transport of the given channel (check sampler1 and sink for an example) or as the channel directly to create a message.