diff --git a/examples/MQ/1-sampler-sink/CMakeLists.txt b/examples/MQ/1-sampler-sink/CMakeLists.txt index a392cddf..6d429726 100644 --- a/examples/MQ/1-sampler-sink/CMakeLists.txt +++ b/examples/MQ/1-sampler-sink/CMakeLists.txt @@ -13,8 +13,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/1-sampler-sink/startMQEx1.sh.in Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/2-sampler-processor-sink/CMakeLists.txt b/examples/MQ/2-sampler-processor-sink/CMakeLists.txt index 348000b5..0222f97a 100644 --- a/examples/MQ/2-sampler-processor-sink/CMakeLists.txt +++ b/examples/MQ/2-sampler-processor-sink/CMakeLists.txt @@ -13,8 +13,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/2-sampler-processor-sink/startMQE Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/3-dds/CMakeLists.txt b/examples/MQ/3-dds/CMakeLists.txt index a0a276ac..71145e20 100644 --- a/examples/MQ/3-dds/CMakeLists.txt +++ b/examples/MQ/3-dds/CMakeLists.txt @@ -15,8 +15,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/3-dds/ex3-dds.json Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/4-copypush/CMakeLists.txt b/examples/MQ/4-copypush/CMakeLists.txt index d4ed9e82..b3f5b60f 100644 --- a/examples/MQ/4-copypush/CMakeLists.txt +++ b/examples/MQ/4-copypush/CMakeLists.txt @@ -13,8 +13,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/4-copypush/startMQEx4.sh.in Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/5-req-rep/CMakeLists.txt b/examples/MQ/5-req-rep/CMakeLists.txt index 705d2138..169f4186 100644 --- a/examples/MQ/5-req-rep/CMakeLists.txt +++ b/examples/MQ/5-req-rep/CMakeLists.txt @@ -13,8 +13,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/5-req-rep/startMQEx5.sh.in Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/6-multiple-channels/CMakeLists.txt b/examples/MQ/6-multiple-channels/CMakeLists.txt index db836985..581d04a4 100644 --- a/examples/MQ/6-multiple-channels/CMakeLists.txt +++ b/examples/MQ/6-multiple-channels/CMakeLists.txt @@ -13,8 +13,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/6-multiple-channels/startMQEx6.sh Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/8-multipart/CMakeLists.txt b/examples/MQ/8-multipart/CMakeLists.txt index d64bd500..8ddd0729 100644 --- a/examples/MQ/8-multipart/CMakeLists.txt +++ b/examples/MQ/8-multipart/CMakeLists.txt @@ -13,8 +13,6 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/8-multipart/startMQEx8.sh.in Set(INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/fairmq - ${CMAKE_SOURCE_DIR}/fairmq/zeromq - ${CMAKE_SOURCE_DIR}/fairmq/nanomsg ${CMAKE_SOURCE_DIR}/fairmq/devices ${CMAKE_SOURCE_DIR}/fairmq/tools ${CMAKE_SOURCE_DIR}/fairmq/options diff --git a/examples/MQ/multiple-transports/CMakeLists.txt b/examples/MQ/multiple-transports/CMakeLists.txt new file mode 100644 index 00000000..aad41351 --- /dev/null +++ b/examples/MQ/multiple-transports/CMakeLists.txt @@ -0,0 +1,82 @@ + ################################################################################ + # Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # + # # + # This software is distributed under the terms of the # + # GNU Lesser General Public Licence version 3 (LGPL) version 3, # + # copied verbatim in the file "LICENSE" # + ################################################################################ + +configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/multiple-transports/ex-multiple-transports.json + ${CMAKE_BINARY_DIR}/bin/config/ex-multiple-transports.json) +configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/multiple-transports/startMTEx.sh.in + ${CMAKE_BINARY_DIR}/bin/examples/MQ/multiple-transports/startMTEx.sh) + +Set(INCLUDE_DIRECTORIES + ${CMAKE_SOURCE_DIR}/fairmq + ${CMAKE_SOURCE_DIR}/fairmq/devices + ${CMAKE_SOURCE_DIR}/fairmq/tools + ${CMAKE_SOURCE_DIR}/fairmq/options + ${CMAKE_SOURCE_DIR}/examples/MQ/multiple-transports + ${CMAKE_CURRENT_BINARY_DIR} +) + +Set(SYSTEM_INCLUDE_DIRECTORIES + ${Boost_INCLUDE_DIR} + ${ZMQ_INCLUDE_DIR} +) + +Include_Directories(${INCLUDE_DIRECTORIES}) +Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) + +Set(LINK_DIRECTORIES + ${Boost_LIBRARY_DIRS} +) + +Link_Directories(${LINK_DIRECTORIES}) + +Set(SRCS + "FairMQExampleMTSampler1.cxx" + "FairMQExampleMTSampler2.cxx" + "FairMQExampleMTSink.cxx" +) + +Set(DEPENDENCIES + ${DEPENDENCIES} + FairMQ +) + +Set(LIBRARY_NAME FairMQExampleMT) + +GENERATE_LIBRARY() + +Set(Exe_Names + ex-mt-sampler1 + ex-mt-sampler2 + ex-mt-sink +) + +Set(Exe_Source + runExampleMTSampler1.cxx + runExampleMTSampler2.cxx + runExampleMTSink.cxx +) + +list(LENGTH Exe_Names _length) +math(EXPR _length ${_length}-1) + +set(BIN_DESTINATION share/fairbase/examples/MQ/multiple-transports/bin) +set(EXECUTABLE_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/examples/MQ/multiple-transports") + +ForEach(_file RANGE 0 ${_length}) + list(GET Exe_Names ${_file} _name) + list(GET Exe_Source ${_file} _src) + Set(EXE_NAME ${_name}) + Set(SRCS ${_src}) + Set(DEPENDENCIES FairMQExampleMT) + GENERATE_EXECUTABLE() +EndForEach(_file RANGE 0 ${_length}) + +Install( + FILES ex-multiple-transports.json + DESTINATION share/fairbase/examples/MQ/multiple-transports/config/ +) diff --git a/examples/MQ/multiple-transports/FairMQExampleMTSampler1.cxx b/examples/MQ/multiple-transports/FairMQExampleMTSampler1.cxx new file mode 100644 index 00000000..67d242cd --- /dev/null +++ b/examples/MQ/multiple-transports/FairMQExampleMTSampler1.cxx @@ -0,0 +1,68 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#include "FairMQExampleMTSampler1.h" +#include "FairMQLogger.h" +#include "FairMQProgOptions.h" + +using namespace std; + +FairMQExampleMTSampler1::FairMQExampleMTSampler1() + : fAckListener() +{ +} + +void FairMQExampleMTSampler1::InitTask() +{ +} + +void FairMQExampleMTSampler1::PreRun() +{ + fAckListener = thread(&FairMQExampleMTSampler1::ListenForAcks, this); +} + +bool FairMQExampleMTSampler1::ConditionalRun() +{ + // Creates a message using the transport of channel data1 + FairMQMessagePtr msg(NewMessageFor("data1", 0, 1000000)); + + // in case of error or transfer interruption, return false to go to IDLE state + // successfull transfer will return number of bytes transfered (can be 0 if sending an empty message). + if (Send(msg, "data1") < 0) + { + return false; + } + + return true; +} + +void FairMQExampleMTSampler1::PostRun() +{ + fAckListener.join(); +} + +void FairMQExampleMTSampler1::ListenForAcks() +{ + uint64_t numAcks = 0; + + while (CheckCurrentState(RUNNING)) + { + FairMQMessagePtr ack(NewMessageFor("ack", 0)); + if (Receive(ack, "ack") < 0) + { + break; + } + ++numAcks; + } + + LOG(INFO) << "Acknowledged " << numAcks << " messages"; +} + +FairMQExampleMTSampler1::~FairMQExampleMTSampler1() +{ +} diff --git a/examples/MQ/multiple-transports/FairMQExampleMTSampler1.h b/examples/MQ/multiple-transports/FairMQExampleMTSampler1.h new file mode 100644 index 00000000..80b4916e --- /dev/null +++ b/examples/MQ/multiple-transports/FairMQExampleMTSampler1.h @@ -0,0 +1,33 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#ifndef FAIRMQEXAMPLEMTSAMPLER1_H_ +#define FAIRMQEXAMPLEMTSAMPLER1_H_ + +#include +#include + +#include "FairMQDevice.h" + +class FairMQExampleMTSampler1 : public FairMQDevice +{ + public: + FairMQExampleMTSampler1(); + virtual ~FairMQExampleMTSampler1(); + + protected: + virtual void InitTask(); + virtual void PreRun(); + virtual bool ConditionalRun(); + virtual void PostRun(); + void ListenForAcks(); + + std::thread fAckListener; +}; + +#endif /* FAIRMQEXAMPLEMTSAMPLER1_H_ */ diff --git a/examples/MQ/multiple-transports/FairMQExampleMTSampler2.cxx b/examples/MQ/multiple-transports/FairMQExampleMTSampler2.cxx new file mode 100644 index 00000000..40a52054 --- /dev/null +++ b/examples/MQ/multiple-transports/FairMQExampleMTSampler2.cxx @@ -0,0 +1,35 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#include "FairMQExampleMTSampler2.h" +#include "FairMQLogger.h" +#include "FairMQProgOptions.h" + +using namespace std; + +FairMQExampleMTSampler2::FairMQExampleMTSampler2() +{ +} + +bool FairMQExampleMTSampler2::ConditionalRun() +{ + FairMQMessagePtr msg(NewMessage(1000)); + + // in case of error or transfer interruption, return false to go to IDLE state + // successfull transfer will return number of bytes transfered (can be 0 if sending an empty message). + if (Send(msg, "data2") < 0) + { + return false; + } + + return true; +} + +FairMQExampleMTSampler2::~FairMQExampleMTSampler2() +{ +} diff --git a/examples/MQ/multiple-transports/FairMQExampleMTSampler2.h b/examples/MQ/multiple-transports/FairMQExampleMTSampler2.h new file mode 100644 index 00000000..cf08a30e --- /dev/null +++ b/examples/MQ/multiple-transports/FairMQExampleMTSampler2.h @@ -0,0 +1,27 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#ifndef FAIRMQEXAMPLEMTSAMPLER2_H_ +#define FAIRMQEXAMPLEMTSAMPLER2_H_ + +#include +#include + +#include "FairMQDevice.h" + +class FairMQExampleMTSampler2 : public FairMQDevice +{ + public: + FairMQExampleMTSampler2(); + virtual ~FairMQExampleMTSampler2(); + + protected: + virtual bool ConditionalRun(); +}; + +#endif /* FAIRMQEXAMPLEMTSAMPLER2_H_ */ diff --git a/examples/MQ/multiple-transports/FairMQExampleMTSink.cxx b/examples/MQ/multiple-transports/FairMQExampleMTSink.cxx new file mode 100644 index 00000000..a557f175 --- /dev/null +++ b/examples/MQ/multiple-transports/FairMQExampleMTSink.cxx @@ -0,0 +1,50 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ +/** + * FairMQExampleMTSink.cxx + * + * @since 2014-10-10 + * @author A. Rybalchenko + */ + +#include "FairMQExampleMTSink.h" +#include "FairMQLogger.h" + +using namespace std; + +FairMQExampleMTSink::FairMQExampleMTSink() +{ + // register a handler for data arriving on "data" channel + OnData("data1", &FairMQExampleMTSink::HandleData1); + OnData("data2", &FairMQExampleMTSink::HandleData2); +} + +// handler is called whenever a message arrives on "data", with a reference to the message and a sub-channel index (here 0) +bool FairMQExampleMTSink::HandleData1(FairMQMessagePtr& /*msg*/, int /*index*/) +{ + // Creates a message using the transport of channel ack + FairMQMessagePtr ack(NewMessageFor("ack", 0)); + if (Send(ack, "ack") < 0) + { + return false; + } + + // return true if want to be called again (otherwise go to IDLE state) + return true; +} + +// handler is called whenever a message arrives on "data", with a reference to the message and a sub-channel index (here 0) +bool FairMQExampleMTSink::HandleData2(FairMQMessagePtr& /*msg*/, int /*index*/) +{ + // return true if want to be called again (otherwise go to IDLE state) + return true; +} + +FairMQExampleMTSink::~FairMQExampleMTSink() +{ +} diff --git a/examples/MQ/multiple-transports/FairMQExampleMTSink.h b/examples/MQ/multiple-transports/FairMQExampleMTSink.h new file mode 100644 index 00000000..1bfbcab6 --- /dev/null +++ b/examples/MQ/multiple-transports/FairMQExampleMTSink.h @@ -0,0 +1,31 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ +/** + * FairMQExampleMTSink.h + * + * @since 2014-10-10 + * @author A. Rybalchenko + */ + +#ifndef FAIRMQEXAMPLEMTSINK_H_ +#define FAIRMQEXAMPLEMTSINK_H_ + +#include "FairMQDevice.h" + +class FairMQExampleMTSink : public FairMQDevice +{ + public: + FairMQExampleMTSink(); + virtual ~FairMQExampleMTSink(); + + protected: + bool HandleData1(FairMQMessagePtr&, int); + bool HandleData2(FairMQMessagePtr&, int); +}; + +#endif /* FAIRMQEXAMPLEMTSINK_H_ */ diff --git a/examples/MQ/multiple-transports/README.md b/examples/MQ/multiple-transports/README.md new file mode 100644 index 00000000..ff33996f --- /dev/null +++ b/examples/MQ/multiple-transports/README.md @@ -0,0 +1,12 @@ +Multiple Transports example +=========================== + +This example demonstrates use of multiple transports (zeromq/nanomsg/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](../../../docs/images/fairmq-ex-multiple-transports.png?raw=true "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. via the JSON file, see `ex-multiple-transports.json`). + +In this example sampler1 and sink are started with `--transport shmem`, making shared memory their main transport, sampler2 with `--transport nanomsg`. Additionally, the ack channel is configured to use zeromq as its transport via the JSON configuration. + +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). diff --git a/examples/MQ/multiple-transports/ex-multiple-transports.json b/examples/MQ/multiple-transports/ex-multiple-transports.json new file mode 100644 index 00000000..b030dec3 --- /dev/null +++ b/examples/MQ/multiple-transports/ex-multiple-transports.json @@ -0,0 +1,84 @@ +{ + "fairMQOptions": { + "devices": [ + { + "id": "sampler1", + "channels": [ + { + "name": "data1", + "sockets": [ + { + "type": "push", + "method": "bind", + "address": "tcp://127.0.0.1:5555" + } + ] + }, + { + "name": "ack", + "transport": "zeromq", + "sockets": [ + { + "type": "sub", + "method": "bind", + "address": "tcp://127.0.0.1:5557" + } + ] + } + ] + }, + { + "id": "sampler2", + "channels": [ + { + "name": "data2", + "sockets": [ + { + "type": "push", + "method": "bind", + "address": "tcp://127.0.0.1:5556" + } + ] + } + ] + }, + { + "id": "sink1", + "channels": [ + { + "name": "data1", + "sockets": [ + { + "type": "pull", + "method": "connect", + "address": "tcp://127.0.0.1:5555" + } + ] + }, + { + "name": "data2", + "transport": "nanomsg", + "sockets": [ + { + "type": "pull", + "method": "connect", + "address": "tcp://127.0.0.1:5556" + } + ] + }, + { + "name": "ack", + "transport": "zeromq", + "sockets": [ + { + "type": "pub", + "method": "connect", + "address": "tcp://127.0.0.1:5557" + } + ] + } + ] + } + ] + } +} diff --git a/examples/MQ/multiple-transports/runExampleMTSampler1.cxx b/examples/MQ/multiple-transports/runExampleMTSampler1.cxx new file mode 100644 index 00000000..0bb35ce7 --- /dev/null +++ b/examples/MQ/multiple-transports/runExampleMTSampler1.cxx @@ -0,0 +1,23 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#include "runFairMQDevice.h" +#include "FairMQExampleMTSampler1.h" + +namespace bpo = boost::program_options; + +void addCustomOptions(bpo::options_description& options) +{ + options.add_options() + ("text", bpo::value()->default_value("Hello"), "Text to send out"); +} + +FairMQDevicePtr getDevice(const FairMQProgOptions& /*config*/) +{ + return new FairMQExampleMTSampler1(); +} diff --git a/examples/MQ/multiple-transports/runExampleMTSampler2.cxx b/examples/MQ/multiple-transports/runExampleMTSampler2.cxx new file mode 100644 index 00000000..3c711822 --- /dev/null +++ b/examples/MQ/multiple-transports/runExampleMTSampler2.cxx @@ -0,0 +1,23 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#include "runFairMQDevice.h" +#include "FairMQExampleMTSampler2.h" + +namespace bpo = boost::program_options; + +void addCustomOptions(bpo::options_description& options) +{ + options.add_options() + ("text", bpo::value()->default_value("Hello"), "Text to send out"); +} + +FairMQDevicePtr getDevice(const FairMQProgOptions& /*config*/) +{ + return new FairMQExampleMTSampler2(); +} diff --git a/examples/MQ/multiple-transports/runExampleMTSink.cxx b/examples/MQ/multiple-transports/runExampleMTSink.cxx new file mode 100644 index 00000000..ab12bc8d --- /dev/null +++ b/examples/MQ/multiple-transports/runExampleMTSink.cxx @@ -0,0 +1,21 @@ +/******************************************************************************** + * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * * + * This software is distributed under the terms of the * + * GNU Lesser General Public Licence version 3 (LGPL) version 3, * + * copied verbatim in the file "LICENSE" * + ********************************************************************************/ + +#include "runFairMQDevice.h" +#include "FairMQExampleMTSink.h" + +namespace bpo = boost::program_options; + +void addCustomOptions(bpo::options_description& /*options*/) +{ +} + +FairMQDevicePtr getDevice(const FairMQProgOptions& /*config*/) +{ + return new FairMQExampleMTSink(); +} diff --git a/examples/MQ/multiple-transports/startMTEx.sh.in b/examples/MQ/multiple-transports/startMTEx.sh.in new file mode 100755 index 00000000..32343563 --- /dev/null +++ b/examples/MQ/multiple-transports/startMTEx.sh.in @@ -0,0 +1,20 @@ +#!/bin/bash +config="@CMAKE_BINARY_DIR@/bin/config/ex-multiple-transports.json" + +SAMPLER1="ex-mt-sampler1" +SAMPLER1+=" --id sampler1" +SAMPLER1+=" --transport shmem" +SAMPLER1+=" --mq-config $config" +xterm -geometry 80x30+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/examples/MQ/multiple-transports/$SAMPLER1 & + +SAMPLER2="ex-mt-sampler2" +SAMPLER2+=" --id sampler2" +SAMPLER2+=" --transport nanomsg" +SAMPLER2+=" --mq-config $config" +xterm -geometry 80x30+0+450 -hold -e @CMAKE_BINARY_DIR@/bin/examples/MQ/multiple-transports/$SAMPLER2 & + +SINK="ex-mt-sink" +SINK+=" --id sink1" +SINK+=" --transport shmem" +SINK+=" --mq-config $config" +xterm -geometry 80x30+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/examples/MQ/multiple-transports/$SINK &