mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +00:00
Use boost::program_options for managing command line options of the executables.
Existing scripts in example/Tutorial3/macro have been updated to use the new format. Your own executables are not affected, but your scripts which use FairMQ executables have to be updated to the new format. Use the `--help` option with any FairMQ executable to find out the available options.
This commit is contained in:
parent
101bc4c9e7
commit
0cef5692b1
|
@ -32,7 +32,6 @@ FairMQDevice::FairMQDevice()
|
||||||
void FairMQDevice::Init()
|
void FairMQDevice::Init()
|
||||||
{
|
{
|
||||||
LOG(INFO) << ">>>>>>> Init <<<<<<<";
|
LOG(INFO) << ">>>>>>> Init <<<<<<<";
|
||||||
LOG(INFO) << "numIoThreads: " << fNumIoThreads;
|
|
||||||
|
|
||||||
for (int i = 0; i < fNumInputs; ++i)
|
for (int i = 0; i < fNumInputs; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace FairMQFSM
|
||||||
template <class EVT, class FSM, class SourceState, class TargetState>
|
template <class EVT, class FSM, class SourceState, class TargetState>
|
||||||
void operator()(EVT const&, FSM&, SourceState&, TargetState&)
|
void operator()(EVT const&, FSM&, SourceState&, TargetState&)
|
||||||
{
|
{
|
||||||
LOG(STATE) << "Transition from " << typeid(SourceState).name() << " to " << typeid(TargetState).name() << " with event:" << typeid(EVT).name();
|
// LOG(STATE) << "Transition from " << typeid(SourceState).name() << " to " << typeid(TargetState).name() << " with event:" << typeid(EVT).name();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct InitFct
|
struct InitFct
|
||||||
|
|
|
@ -39,7 +39,6 @@ void FairMQBenchmarkSampler::Init()
|
||||||
void FairMQBenchmarkSampler::Run()
|
void FairMQBenchmarkSampler::Run()
|
||||||
{
|
{
|
||||||
LOG(INFO) << ">>>>>>> Run <<<<<<<";
|
LOG(INFO) << ">>>>>>> Run <<<<<<<";
|
||||||
// boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
|
|
||||||
|
|
||||||
boost::thread rateLogger(boost::bind(&FairMQDevice::LogSocketRates, this));
|
boost::thread rateLogger(boost::bind(&FairMQDevice::LogSocketRates, this));
|
||||||
boost::thread resetEventCounter(boost::bind(&FairMQBenchmarkSampler::ResetEventCounter, this));
|
boost::thread resetEventCounter(boost::bind(&FairMQBenchmarkSampler::ResetEventCounter, this));
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQBenchmarkSampler.h"
|
#include "FairMQBenchmarkSampler.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQBenchmarkSampler sampler;
|
FairMQBenchmarkSampler sampler;
|
||||||
|
|
||||||
|
@ -52,18 +51,93 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct DeviceOptions
|
||||||
|
{
|
||||||
|
string id;
|
||||||
|
int eventSize;
|
||||||
|
int eventRate;
|
||||||
|
int ioThreads;
|
||||||
|
string outputSocketType;
|
||||||
|
int outputBufSize;
|
||||||
|
string outputMethod;
|
||||||
|
string outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("event-size", bpo::value<int>()->default_value(1000), "Event size in bytes")
|
||||||
|
("event-rate", bpo::value<int>()->default_value(0), "Event rate limit in maximum number of events per second")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("output-socket-type", bpo::value<string>()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value<int>()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value<string>()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value<string>()->required(), "Output address, e.g.: \"tcp://*:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
|
{
|
||||||
|
LOG(INFO) << "FairMQ Benchmark Sampler" << endl << desc;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("event-size") )
|
||||||
|
_options->eventSize = vm["event-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("event-rate") )
|
||||||
|
_options->eventRate = vm["event-rate"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc != 9)
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
cout << "Usage: bsampler ID eventSize eventRate numIoTreads\n"
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n" << endl;
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_catch_signals();
|
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
LOG(INFO) << "CONFIG: " << "id: " << options.id << ", event size: " << options.eventSize << ", event rate: " << options.eventRate << ", I/O threads: " << options.ioThreads;
|
||||||
|
LOG(INFO) << "OUTPUT: " << options.outputSocketType << " " << options.outputBufSize << " " << options.outputMethod << " " << options.outputAddress;
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||||
|
@ -73,41 +147,20 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
sampler.SetTransport(transportFactory);
|
sampler.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
sampler.SetProperty(FairMQBenchmarkSampler::Id, options.id);
|
||||||
|
sampler.SetProperty(FairMQBenchmarkSampler::EventSize, options.eventSize);
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::Id, argv[i]);
|
sampler.SetProperty(FairMQBenchmarkSampler::EventRate, options.eventRate);
|
||||||
++i;
|
sampler.SetProperty(FairMQBenchmarkSampler::NumIoThreads, options.ioThreads);
|
||||||
|
|
||||||
int eventSize;
|
|
||||||
stringstream(argv[i]) >> eventSize;
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::EventSize, eventSize);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int eventRate;
|
|
||||||
stringstream(argv[i]) >> eventRate;
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::EventRate, eventRate);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::NumInputs, 0);
|
sampler.SetProperty(FairMQBenchmarkSampler::NumInputs, 0);
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::NumOutputs, 1);
|
sampler.SetProperty(FairMQBenchmarkSampler::NumOutputs, 1);
|
||||||
|
|
||||||
sampler.ChangeState(FairMQBenchmarkSampler::INIT);
|
sampler.ChangeState(FairMQBenchmarkSampler::INIT);
|
||||||
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::OutputSocketType, argv[i], 0);
|
sampler.SetProperty(FairMQBenchmarkSampler::OutputSocketType, options.outputSocketType);
|
||||||
++i;
|
sampler.SetProperty(FairMQBenchmarkSampler::OutputSndBufSize, options.outputBufSize);
|
||||||
int outputSndBufSize;
|
sampler.SetProperty(FairMQBenchmarkSampler::OutputMethod, options.outputMethod);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
sampler.SetProperty(FairMQBenchmarkSampler::OutputAddress, options.outputAddress);
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::OutputSndBufSize, outputSndBufSize, 0);
|
|
||||||
++i;
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::OutputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
sampler.SetProperty(FairMQBenchmarkSampler::OutputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sampler.ChangeState(FairMQBenchmarkSampler::SETOUTPUT);
|
sampler.ChangeState(FairMQBenchmarkSampler::SETOUTPUT);
|
||||||
sampler.ChangeState(FairMQBenchmarkSampler::SETINPUT);
|
sampler.ChangeState(FairMQBenchmarkSampler::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQBinSampler.h"
|
#include "FairMQBinSampler.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQBinSampler sampler;
|
FairMQBinSampler sampler;
|
||||||
|
|
||||||
|
@ -52,18 +51,93 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct DeviceOptions
|
||||||
|
{
|
||||||
|
string id;
|
||||||
|
int eventSize;
|
||||||
|
int eventRate;
|
||||||
|
int ioThreads;
|
||||||
|
string outputSocketType;
|
||||||
|
int outputBufSize;
|
||||||
|
string outputMethod;
|
||||||
|
string outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("event-size", bpo::value<int>()->default_value(1000), "Event size in bytes")
|
||||||
|
("event-rate", bpo::value<int>()->default_value(0), "Event rate limit in maximum number of events per second")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("output-socket-type", bpo::value<string>()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value<int>()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value<string>()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value<string>()->required(), "Output address, e.g.: \"tcp://*:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
|
{
|
||||||
|
LOG(INFO) << "FairMQ Bin Sampler" << endl << desc;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("event-size") )
|
||||||
|
_options->eventSize = vm["event-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("event-rate") )
|
||||||
|
_options->eventRate = vm["event-rate"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc != 9)
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
cout << "Usage: bsampler ID eventSize eventRate numIoTreads\n"
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n" << endl;
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_catch_signals();
|
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
LOG(INFO) << "CONFIG: " << "id: " << options.id << ", event size: " << options.eventSize << ", event rate: " << options.eventRate << ", I/O threads: " << options.ioThreads;
|
||||||
|
LOG(INFO) << "OUTPUT: " << options.outputSocketType << " " << options.outputBufSize << " " << options.outputMethod << " " << options.outputAddress;
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||||
|
@ -73,41 +147,20 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
sampler.SetTransport(transportFactory);
|
sampler.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
sampler.SetProperty(FairMQBinSampler::Id, options.id);
|
||||||
|
sampler.SetProperty(FairMQBinSampler::EventSize, options.eventSize);
|
||||||
sampler.SetProperty(FairMQBinSampler::Id, argv[i]);
|
sampler.SetProperty(FairMQBinSampler::EventRate, options.eventRate);
|
||||||
++i;
|
sampler.SetProperty(FairMQBinSampler::NumIoThreads, options.ioThreads);
|
||||||
|
|
||||||
int eventSize;
|
|
||||||
stringstream(argv[i]) >> eventSize;
|
|
||||||
sampler.SetProperty(FairMQBinSampler::EventSize, eventSize);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int eventRate;
|
|
||||||
stringstream(argv[i]) >> eventRate;
|
|
||||||
sampler.SetProperty(FairMQBinSampler::EventRate, eventRate);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
sampler.SetProperty(FairMQBinSampler::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sampler.SetProperty(FairMQBinSampler::NumInputs, 0);
|
sampler.SetProperty(FairMQBinSampler::NumInputs, 0);
|
||||||
sampler.SetProperty(FairMQBinSampler::NumOutputs, 1);
|
sampler.SetProperty(FairMQBinSampler::NumOutputs, 1);
|
||||||
|
|
||||||
sampler.ChangeState(FairMQBinSampler::INIT);
|
sampler.ChangeState(FairMQBinSampler::INIT);
|
||||||
|
|
||||||
sampler.SetProperty(FairMQBinSampler::OutputSocketType, argv[i], 0);
|
sampler.SetProperty(FairMQBinSampler::OutputSocketType, options.outputSocketType);
|
||||||
++i;
|
sampler.SetProperty(FairMQBinSampler::OutputSndBufSize, options.outputBufSize);
|
||||||
int outputSndBufSize;
|
sampler.SetProperty(FairMQBinSampler::OutputMethod, options.outputMethod);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
sampler.SetProperty(FairMQBinSampler::OutputAddress, options.outputAddress);
|
||||||
sampler.SetProperty(FairMQBinSampler::OutputSndBufSize, outputSndBufSize, 0);
|
|
||||||
++i;
|
|
||||||
sampler.SetProperty(FairMQBinSampler::OutputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
sampler.SetProperty(FairMQBinSampler::OutputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sampler.ChangeState(FairMQBinSampler::SETOUTPUT);
|
sampler.ChangeState(FairMQBinSampler::SETOUTPUT);
|
||||||
sampler.ChangeState(FairMQBinSampler::SETINPUT);
|
sampler.ChangeState(FairMQBinSampler::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQBinSink.h"
|
#include "FairMQBinSink.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQBinSink sink;
|
FairMQBinSink sink;
|
||||||
|
|
||||||
|
@ -52,17 +51,80 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc != 7)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
string inputSocketType;
|
||||||
|
int inputBufSize;
|
||||||
|
string inputMethod;
|
||||||
|
string inputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("input-socket-type", bpo::value<string>()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value<int>()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value<string>()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value<string>()->required(), "Input address, e.g.: \"tcp://*:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: sink \tID numIoTreads\n"
|
LOG(INFO) << "FairMQ Bin Sink" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n" << endl;
|
return false;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -73,31 +135,18 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
sink.SetTransport(transportFactory);
|
sink.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
sink.SetProperty(FairMQBinSink::Id, options.id);
|
||||||
|
sink.SetProperty(FairMQBinSink::NumIoThreads, options.ioThreads);
|
||||||
sink.SetProperty(FairMQBinSink::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
sink.SetProperty(FairMQBinSink::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sink.SetProperty(FairMQBinSink::NumInputs, 1);
|
sink.SetProperty(FairMQBinSink::NumInputs, 1);
|
||||||
sink.SetProperty(FairMQBinSink::NumOutputs, 0);
|
sink.SetProperty(FairMQBinSink::NumOutputs, 0);
|
||||||
|
|
||||||
sink.ChangeState(FairMQBinSink::INIT);
|
sink.ChangeState(FairMQBinSink::INIT);
|
||||||
|
|
||||||
sink.SetProperty(FairMQBinSink::InputSocketType, argv[i], 0);
|
sink.SetProperty(FairMQBinSink::InputSocketType, options.inputSocketType);
|
||||||
++i;
|
sink.SetProperty(FairMQBinSink::InputSndBufSize, options.inputBufSize);
|
||||||
int inputRcvBufSize;
|
sink.SetProperty(FairMQBinSink::InputMethod, options.inputMethod);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
sink.SetProperty(FairMQBinSink::InputAddress, options.inputAddress);
|
||||||
sink.SetProperty(FairMQBinSink::InputRcvBufSize, inputRcvBufSize, 0);
|
|
||||||
++i;
|
|
||||||
sink.SetProperty(FairMQBinSink::InputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
sink.SetProperty(FairMQBinSink::InputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sink.ChangeState(FairMQBinSink::SETOUTPUT);
|
sink.ChangeState(FairMQBinSink::SETOUTPUT);
|
||||||
sink.ChangeState(FairMQBinSink::SETINPUT);
|
sink.ChangeState(FairMQBinSink::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQBuffer.h"
|
#include "FairMQBuffer.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQBuffer buffer;
|
FairMQBuffer buffer;
|
||||||
|
|
||||||
|
@ -52,18 +51,100 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc != 11)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
string inputSocketType;
|
||||||
|
int inputBufSize;
|
||||||
|
string inputMethod;
|
||||||
|
string inputAddress;
|
||||||
|
string outputSocketType;
|
||||||
|
int outputBufSize;
|
||||||
|
string outputMethod;
|
||||||
|
string outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("input-socket-type", bpo::value<string>()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value<int>()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value<string>()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value<string>()->required(), "Input address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("output-socket-type", bpo::value<string>()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value<int>()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value<string>()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value<string>()->required(), "Output address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: buffer \tID numIoTreads\n"
|
LOG(INFO) << "FairMQ Buffer" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n"
|
return false;
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -74,41 +155,23 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
buffer.SetTransport(transportFactory);
|
buffer.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
buffer.SetProperty(FairMQBuffer::Id, options.id);
|
||||||
|
buffer.SetProperty(FairMQBuffer::NumIoThreads, options.ioThreads);
|
||||||
|
|
||||||
buffer.SetProperty(FairMQBuffer::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
buffer.SetProperty(FairMQBuffer::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
buffer.SetProperty(FairMQBuffer::NumInputs, 1);
|
buffer.SetProperty(FairMQBuffer::NumInputs, 1);
|
||||||
buffer.SetProperty(FairMQBuffer::NumOutputs, 1);
|
buffer.SetProperty(FairMQBuffer::NumOutputs, 1);
|
||||||
|
|
||||||
buffer.ChangeState(FairMQBuffer::INIT);
|
buffer.ChangeState(FairMQBuffer::INIT);
|
||||||
|
|
||||||
buffer.SetProperty(FairMQBuffer::InputSocketType, argv[i], 0);
|
buffer.SetProperty(FairMQBuffer::InputSocketType, options.inputSocketType);
|
||||||
++i;
|
buffer.SetProperty(FairMQBuffer::InputSndBufSize, options.inputBufSize);
|
||||||
int inputRcvBufSize;
|
buffer.SetProperty(FairMQBuffer::InputMethod, options.inputMethod);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
buffer.SetProperty(FairMQBuffer::InputAddress, options.inputAddress);
|
||||||
buffer.SetProperty(FairMQBuffer::InputRcvBufSize, inputRcvBufSize, 0);
|
|
||||||
++i;
|
|
||||||
buffer.SetProperty(FairMQBuffer::InputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
buffer.SetProperty(FairMQBuffer::InputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
buffer.SetProperty(FairMQBuffer::OutputSocketType, argv[i], 0);
|
buffer.SetProperty(FairMQBuffer::OutputSocketType, options.outputSocketType);
|
||||||
++i;
|
buffer.SetProperty(FairMQBuffer::OutputSndBufSize, options.outputBufSize);
|
||||||
int outputSndBufSize;
|
buffer.SetProperty(FairMQBuffer::OutputMethod, options.outputMethod);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
buffer.SetProperty(FairMQBuffer::OutputAddress, options.outputAddress);
|
||||||
buffer.SetProperty(FairMQBuffer::OutputSndBufSize, outputSndBufSize, 0);
|
|
||||||
++i;
|
|
||||||
buffer.SetProperty(FairMQBuffer::OutputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
buffer.SetProperty(FairMQBuffer::OutputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
buffer.ChangeState(FairMQBuffer::SETOUTPUT);
|
buffer.ChangeState(FairMQBuffer::SETOUTPUT);
|
||||||
buffer.ChangeState(FairMQBuffer::SETINPUT);
|
buffer.ChangeState(FairMQBuffer::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQMerger.h"
|
#include "FairMQMerger.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQMerger merger;
|
FairMQMerger merger;
|
||||||
|
|
||||||
|
@ -52,20 +51,105 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc < 16 || (argc - 8) % 4 != 0)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
int numInputs;
|
||||||
|
vector<string> inputSocketType;
|
||||||
|
vector<int> inputBufSize;
|
||||||
|
vector<string> inputMethod;
|
||||||
|
vector<string> inputAddress;
|
||||||
|
string outputSocketType;
|
||||||
|
int outputBufSize;
|
||||||
|
string outputMethod;
|
||||||
|
string outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("num-inputs", bpo::value<int>()->required(), "Number of Merger input sockets")
|
||||||
|
("input-socket-type", bpo::value< vector<string> >()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value< vector<int> >()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value< vector<string> >()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value< vector<string> >()->required(), "Input address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("output-socket-type", bpo::value<string>()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value<int>()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value<string>()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value<string>()->required(), "Output address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: merger \tID numIoTreads numInputs\n"
|
LOG(INFO) << "FairMQ Merger" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n"
|
return false;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n"
|
|
||||||
<< "\t\t...\n"
|
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n" << argc << " arguments provided" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("num-inputs") )
|
||||||
|
_options->numInputs = vm["num-inputs"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as< vector<string> >();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as< vector<int> >();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as< vector<string> >();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as< vector<string> >();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -76,49 +160,26 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
merger.SetTransport(transportFactory);
|
merger.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
merger.SetProperty(FairMQMerger::Id, options.id);
|
||||||
|
merger.SetProperty(FairMQMerger::NumIoThreads, options.ioThreads);
|
||||||
merger.SetProperty(FairMQMerger::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
merger.SetProperty(FairMQMerger::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numInputs;
|
|
||||||
stringstream(argv[i]) >> numInputs;
|
|
||||||
merger.SetProperty(FairMQMerger::NumInputs, numInputs);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
|
merger.SetProperty(FairMQMerger::NumInputs, options.numInputs);
|
||||||
merger.SetProperty(FairMQMerger::NumOutputs, 1);
|
merger.SetProperty(FairMQMerger::NumOutputs, 1);
|
||||||
|
|
||||||
merger.ChangeState(FairMQMerger::INIT);
|
merger.ChangeState(FairMQMerger::INIT);
|
||||||
|
|
||||||
for (int iInput = 0; iInput < numInputs; iInput++)
|
for (int i = 0; i < options.numInputs; ++i)
|
||||||
{
|
{
|
||||||
merger.SetProperty(FairMQMerger::InputSocketType, argv[i], iInput);
|
merger.SetProperty(FairMQMerger::InputSocketType, options.inputSocketType.at(i), i);
|
||||||
++i;
|
merger.SetProperty(FairMQMerger::InputRcvBufSize, options.inputBufSize.at(i), i);
|
||||||
int inputRcvBufSize;
|
merger.SetProperty(FairMQMerger::InputMethod, options.inputMethod.at(i), i);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
merger.SetProperty(FairMQMerger::InputAddress, options.inputAddress.at(i), i);
|
||||||
merger.SetProperty(FairMQMerger::InputRcvBufSize, inputRcvBufSize, iInput);
|
|
||||||
++i;
|
|
||||||
merger.SetProperty(FairMQMerger::InputMethod, argv[i], iInput);
|
|
||||||
++i;
|
|
||||||
merger.SetProperty(FairMQMerger::InputAddress, argv[i], iInput);
|
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
merger.SetProperty(FairMQMerger::OutputSocketType, argv[i], 0);
|
merger.SetProperty(FairMQMerger::OutputSocketType, options.outputSocketType);
|
||||||
++i;
|
merger.SetProperty(FairMQMerger::OutputSndBufSize, options.outputBufSize);
|
||||||
int outputSndBufSize;
|
merger.SetProperty(FairMQMerger::OutputMethod, options.outputMethod);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
merger.SetProperty(FairMQMerger::OutputAddress, options.outputAddress);
|
||||||
merger.SetProperty(FairMQMerger::OutputSndBufSize, outputSndBufSize, 0);
|
|
||||||
++i;
|
|
||||||
merger.SetProperty(FairMQMerger::OutputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
merger.SetProperty(FairMQMerger::OutputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
merger.ChangeState(FairMQMerger::SETOUTPUT);
|
merger.ChangeState(FairMQMerger::SETOUTPUT);
|
||||||
merger.ChangeState(FairMQMerger::SETINPUT);
|
merger.ChangeState(FairMQMerger::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQProtoSampler.h"
|
#include "FairMQProtoSampler.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQProtoSampler sampler;
|
FairMQProtoSampler sampler;
|
||||||
|
|
||||||
|
@ -52,18 +51,93 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct DeviceOptions
|
||||||
|
{
|
||||||
|
string id;
|
||||||
|
int eventSize;
|
||||||
|
int eventRate;
|
||||||
|
int ioThreads;
|
||||||
|
string outputSocketType;
|
||||||
|
int outputBufSize;
|
||||||
|
string outputMethod;
|
||||||
|
string outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("event-size", bpo::value<int>()->default_value(1000), "Event size in bytes")
|
||||||
|
("event-rate", bpo::value<int>()->default_value(0), "Event rate limit in maximum number of events per second")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("output-socket-type", bpo::value<string>()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value<int>()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value<string>()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value<string>()->required(), "Output address, e.g.: \"tcp://*:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
|
{
|
||||||
|
LOG(INFO) << "FairMQ Proto Sampler" << endl << desc;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("event-size") )
|
||||||
|
_options->eventSize = vm["event-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("event-rate") )
|
||||||
|
_options->eventRate = vm["event-rate"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc != 9)
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
cout << "Usage: bsampler ID eventSize eventRate numIoTreads\n"
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n" << endl;
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_catch_signals();
|
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
LOG(INFO) << "CONFIG: " << "id: " << options.id << ", event size: " << options.eventSize << ", event rate: " << options.eventRate << ", I/O threads: " << options.ioThreads;
|
||||||
|
LOG(INFO) << "OUTPUT: " << options.outputSocketType << " " << options.outputBufSize << " " << options.outputMethod << " " << options.outputAddress;
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||||
|
@ -73,41 +147,20 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
sampler.SetTransport(transportFactory);
|
sampler.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
sampler.SetProperty(FairMQProtoSampler::Id, options.id);
|
||||||
|
sampler.SetProperty(FairMQProtoSampler::EventSize, options.eventSize);
|
||||||
sampler.SetProperty(FairMQProtoSampler::Id, argv[i]);
|
sampler.SetProperty(FairMQProtoSampler::EventRate, options.eventRate);
|
||||||
++i;
|
sampler.SetProperty(FairMQProtoSampler::NumIoThreads, options.ioThreads);
|
||||||
|
|
||||||
int eventSize;
|
|
||||||
stringstream(argv[i]) >> eventSize;
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::EventSize, eventSize);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int eventRate;
|
|
||||||
stringstream(argv[i]) >> eventRate;
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::EventRate, eventRate);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::NumInputs, 0);
|
sampler.SetProperty(FairMQProtoSampler::NumInputs, 0);
|
||||||
sampler.SetProperty(FairMQProtoSampler::NumOutputs, 1);
|
sampler.SetProperty(FairMQProtoSampler::NumOutputs, 1);
|
||||||
|
|
||||||
sampler.ChangeState(FairMQProtoSampler::INIT);
|
sampler.ChangeState(FairMQProtoSampler::INIT);
|
||||||
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::OutputSocketType, argv[i], 0);
|
sampler.SetProperty(FairMQProtoSampler::OutputSocketType, options.outputSocketType);
|
||||||
++i;
|
sampler.SetProperty(FairMQProtoSampler::OutputSndBufSize, options.outputBufSize);
|
||||||
int outputSndBufSize;
|
sampler.SetProperty(FairMQProtoSampler::OutputMethod, options.outputMethod);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
sampler.SetProperty(FairMQProtoSampler::OutputAddress, options.outputAddress);
|
||||||
sampler.SetProperty(FairMQProtoSampler::OutputSndBufSize, outputSndBufSize, 0);
|
|
||||||
++i;
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::OutputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
sampler.SetProperty(FairMQProtoSampler::OutputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sampler.ChangeState(FairMQProtoSampler::SETOUTPUT);
|
sampler.ChangeState(FairMQProtoSampler::SETOUTPUT);
|
||||||
sampler.ChangeState(FairMQProtoSampler::SETINPUT);
|
sampler.ChangeState(FairMQProtoSampler::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQProtoSink.h"
|
#include "FairMQProtoSink.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQProtoSink sink;
|
FairMQProtoSink sink;
|
||||||
|
|
||||||
|
@ -52,17 +51,80 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc != 7)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
string inputSocketType;
|
||||||
|
int inputBufSize;
|
||||||
|
string inputMethod;
|
||||||
|
string inputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("input-socket-type", bpo::value<string>()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value<int>()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value<string>()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value<string>()->required(), "Input address, e.g.: \"tcp://*:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: sink \tID numIoTreads\n"
|
LOG(INFO) << "FairMQ Proto Sink" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n" << endl;
|
return false;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -73,31 +135,18 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
sink.SetTransport(transportFactory);
|
sink.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
sink.SetProperty(FairMQProtoSink::Id, options.id);
|
||||||
|
sink.SetProperty(FairMQProtoSink::NumIoThreads, options.ioThreads);
|
||||||
sink.SetProperty(FairMQProtoSink::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
sink.SetProperty(FairMQProtoSink::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sink.SetProperty(FairMQProtoSink::NumInputs, 1);
|
sink.SetProperty(FairMQProtoSink::NumInputs, 1);
|
||||||
sink.SetProperty(FairMQProtoSink::NumOutputs, 0);
|
sink.SetProperty(FairMQProtoSink::NumOutputs, 0);
|
||||||
|
|
||||||
sink.ChangeState(FairMQProtoSink::INIT);
|
sink.ChangeState(FairMQProtoSink::INIT);
|
||||||
|
|
||||||
sink.SetProperty(FairMQProtoSink::InputSocketType, argv[i], 0);
|
sink.SetProperty(FairMQProtoSink::InputSocketType, options.inputSocketType);
|
||||||
++i;
|
sink.SetProperty(FairMQProtoSink::InputSndBufSize, options.inputBufSize);
|
||||||
int inputRcvBufSize;
|
sink.SetProperty(FairMQProtoSink::InputMethod, options.inputMethod);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
sink.SetProperty(FairMQProtoSink::InputAddress, options.inputAddress);
|
||||||
sink.SetProperty(FairMQProtoSink::InputRcvBufSize, inputRcvBufSize, 0);
|
|
||||||
++i;
|
|
||||||
sink.SetProperty(FairMQProtoSink::InputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
sink.SetProperty(FairMQProtoSink::InputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sink.ChangeState(FairMQProtoSink::SETOUTPUT);
|
sink.ChangeState(FairMQProtoSink::SETOUTPUT);
|
||||||
sink.ChangeState(FairMQProtoSink::SETINPUT);
|
sink.ChangeState(FairMQProtoSink::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQProxy.h"
|
#include "FairMQProxy.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQProxy proxy;
|
FairMQProxy proxy;
|
||||||
|
|
||||||
|
@ -52,18 +51,100 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc != 11)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
string inputSocketType;
|
||||||
|
int inputBufSize;
|
||||||
|
string inputMethod;
|
||||||
|
string inputAddress;
|
||||||
|
string outputSocketType;
|
||||||
|
int outputBufSize;
|
||||||
|
string outputMethod;
|
||||||
|
string outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("input-socket-type", bpo::value<string>()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value<int>()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value<string>()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value<string>()->required(), "Input address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("output-socket-type", bpo::value<string>()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value<int>()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value<string>()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value<string>()->required(), "Output address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: proxy \tID numIoTreads\n"
|
LOG(INFO) << "FairMQ Proxy" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n"
|
return false;
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -74,42 +155,23 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
proxy.SetTransport(transportFactory);
|
proxy.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
proxy.SetProperty(FairMQProxy::Id, options.id);
|
||||||
|
proxy.SetProperty(FairMQProxy::NumIoThreads, options.ioThreads);
|
||||||
proxy.SetProperty(FairMQProxy::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
proxy.SetProperty(FairMQProxy::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
proxy.SetProperty(FairMQProxy::NumInputs, 1);
|
proxy.SetProperty(FairMQProxy::NumInputs, 1);
|
||||||
proxy.SetProperty(FairMQProxy::NumOutputs, 1);
|
proxy.SetProperty(FairMQProxy::NumOutputs, 1);
|
||||||
|
|
||||||
proxy.ChangeState(FairMQProxy::INIT);
|
proxy.ChangeState(FairMQProxy::INIT);
|
||||||
|
|
||||||
proxy.SetProperty(FairMQProxy::InputSocketType, argv[i], 0);
|
proxy.SetProperty(FairMQProxy::InputSocketType, options.inputSocketType);
|
||||||
++i;
|
proxy.SetProperty(FairMQProxy::InputSndBufSize, options.inputBufSize);
|
||||||
int inputRcvBufSize;
|
proxy.SetProperty(FairMQProxy::InputMethod, options.inputMethod);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
proxy.SetProperty(FairMQProxy::InputAddress, options.inputAddress);
|
||||||
proxy.SetProperty(FairMQProxy::InputRcvBufSize, inputRcvBufSize, 0);
|
|
||||||
++i;
|
|
||||||
proxy.SetProperty(FairMQProxy::InputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
proxy.SetProperty(FairMQProxy::InputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
proxy.SetProperty(FairMQProxy::OutputSocketType, argv[i], 0);
|
proxy.SetProperty(FairMQProxy::OutputSocketType, options.outputSocketType);
|
||||||
++i;
|
proxy.SetProperty(FairMQProxy::OutputSndBufSize, options.outputBufSize);
|
||||||
int outputSndBufSize;
|
proxy.SetProperty(FairMQProxy::OutputMethod, options.outputMethod);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
proxy.SetProperty(FairMQProxy::OutputAddress, options.outputAddress);
|
||||||
proxy.SetProperty(FairMQProxy::OutputSndBufSize, outputSndBufSize, 0);
|
|
||||||
++i;
|
|
||||||
proxy.SetProperty(FairMQProxy::OutputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
proxy.SetProperty(FairMQProxy::OutputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
proxy.ChangeState(FairMQProxy::SETOUTPUT);
|
proxy.ChangeState(FairMQProxy::SETOUTPUT);
|
||||||
proxy.ChangeState(FairMQProxy::SETINPUT);
|
proxy.ChangeState(FairMQProxy::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQSink.h"
|
#include "FairMQSink.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQSink sink;
|
FairMQSink sink;
|
||||||
|
|
||||||
|
@ -52,17 +51,80 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc != 7)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
string inputSocketType;
|
||||||
|
int inputBufSize;
|
||||||
|
string inputMethod;
|
||||||
|
string inputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("input-socket-type", bpo::value<string>()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value<int>()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value<string>()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value<string>()->required(), "Input address, e.g.: \"tcp://*:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: sink \tID numIoTreads\n"
|
LOG(INFO) << "FairMQ Sink" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n" << endl;
|
return false;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as<string>();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -73,31 +135,18 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
sink.SetTransport(transportFactory);
|
sink.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
sink.SetProperty(FairMQSink::Id, options.id);
|
||||||
|
sink.SetProperty(FairMQSink::NumIoThreads, options.ioThreads);
|
||||||
sink.SetProperty(FairMQSink::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
sink.SetProperty(FairMQSink::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sink.SetProperty(FairMQSink::NumInputs, 1);
|
sink.SetProperty(FairMQSink::NumInputs, 1);
|
||||||
sink.SetProperty(FairMQSink::NumOutputs, 0);
|
sink.SetProperty(FairMQSink::NumOutputs, 0);
|
||||||
|
|
||||||
sink.ChangeState(FairMQSink::INIT);
|
sink.ChangeState(FairMQSink::INIT);
|
||||||
|
|
||||||
sink.SetProperty(FairMQSink::InputSocketType, argv[i], 0);
|
sink.SetProperty(FairMQSink::InputSocketType, options.inputSocketType);
|
||||||
++i;
|
sink.SetProperty(FairMQSink::InputRcvBufSize, options.inputBufSize);
|
||||||
int inputRcvBufSize;
|
sink.SetProperty(FairMQSink::InputMethod, options.inputMethod);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
sink.SetProperty(FairMQSink::InputAddress, options.inputAddress);
|
||||||
sink.SetProperty(FairMQSink::InputRcvBufSize, inputRcvBufSize, 0);
|
|
||||||
++i;
|
|
||||||
sink.SetProperty(FairMQSink::InputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
sink.SetProperty(FairMQSink::InputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
sink.ChangeState(FairMQSink::SETOUTPUT);
|
sink.ChangeState(FairMQSink::SETOUTPUT);
|
||||||
sink.ChangeState(FairMQSink::SETINPUT);
|
sink.ChangeState(FairMQSink::SETINPUT);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
|
#include "boost/program_options.hpp"
|
||||||
|
|
||||||
#include "FairMQLogger.h"
|
#include "FairMQLogger.h"
|
||||||
#include "FairMQSplitter.h"
|
#include "FairMQSplitter.h"
|
||||||
|
|
||||||
|
@ -24,10 +26,7 @@
|
||||||
#include "FairMQTransportFactoryZMQ.h"
|
#include "FairMQTransportFactoryZMQ.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::cout;
|
using namespace std;
|
||||||
using std::cin;
|
|
||||||
using std::endl;
|
|
||||||
using std::stringstream;
|
|
||||||
|
|
||||||
FairMQSplitter splitter;
|
FairMQSplitter splitter;
|
||||||
|
|
||||||
|
@ -52,20 +51,105 @@ static void s_catch_signals(void)
|
||||||
sigaction(SIGTERM, &action, NULL);
|
sigaction(SIGTERM, &action, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
typedef struct DeviceOptions
|
||||||
{
|
{
|
||||||
if (argc < 16 || (argc - 8) % 4 != 0)
|
string id;
|
||||||
|
int ioThreads;
|
||||||
|
int numOutputs;
|
||||||
|
string inputSocketType;
|
||||||
|
int inputBufSize;
|
||||||
|
string inputMethod;
|
||||||
|
string inputAddress;
|
||||||
|
vector<string> outputSocketType;
|
||||||
|
vector<int> outputBufSize;
|
||||||
|
vector<string> outputMethod;
|
||||||
|
vector<string> outputAddress;
|
||||||
|
} DeviceOptions_t;
|
||||||
|
|
||||||
|
inline bool parse_cmd_line(int _argc, char* _argv[], DeviceOptions* _options)
|
||||||
|
{
|
||||||
|
if (_options == NULL)
|
||||||
|
throw std::runtime_error("Internal error: options' container is empty.");
|
||||||
|
|
||||||
|
namespace bpo = boost::program_options;
|
||||||
|
bpo::options_description desc("Options");
|
||||||
|
desc.add_options()
|
||||||
|
("id", bpo::value<string>()->required(), "Device ID")
|
||||||
|
("io-threads", bpo::value<int>()->default_value(1), "Number of I/O threads")
|
||||||
|
("num-outputs", bpo::value<int>()->required(), "Number of Splitter output sockets")
|
||||||
|
("input-socket-type", bpo::value<string>()->required(), "Input socket type: sub/pull")
|
||||||
|
("input-buff-size", bpo::value<int>()->required(), "Input buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("input-method", bpo::value<string>()->required(), "Input method: bind/connect")
|
||||||
|
("input-address", bpo::value<string>()->required(), "Input address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("output-socket-type", bpo::value< vector<string> >()->required(), "Output socket type: pub/push")
|
||||||
|
("output-buff-size", bpo::value< vector<int> >()->required(), "Output buffer size in number of messages (ZeroMQ)/bytes(nanomsg)")
|
||||||
|
("output-method", bpo::value< vector<string> >()->required(), "Output method: bind/connect")
|
||||||
|
("output-address", bpo::value< vector<string> >()->required(), "Output address, e.g.: \"tcp://localhost:5555\"")
|
||||||
|
("help", "Print help messages");
|
||||||
|
|
||||||
|
bpo::variables_map vm;
|
||||||
|
bpo::store(bpo::parse_command_line(_argc, _argv, desc), vm);
|
||||||
|
|
||||||
|
if ( vm.count("help") )
|
||||||
{
|
{
|
||||||
cout << "Usage: splitter \tID numIoTreads numOutputs\n"
|
LOG(INFO) << "FairMQ Splitter" << endl << desc;
|
||||||
<< "\t\tinputSocketType inputRcvBufSize inputMethod inputAddress\n"
|
return false;
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n"
|
|
||||||
<< "\t\toutputSocketType outputSndBufSize outputMethod outputAddress\n"
|
|
||||||
<< "\t\t..." << argc << " arguments provided" << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bpo::notify(vm);
|
||||||
|
|
||||||
|
if ( vm.count("id") )
|
||||||
|
_options->id = vm["id"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("io-threads") )
|
||||||
|
_options->ioThreads = vm["io-threads"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("num-outputs") )
|
||||||
|
_options->numOutputs = vm["num-outputs"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-socket-type") )
|
||||||
|
_options->inputSocketType = vm["input-socket-type"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-buff-size") )
|
||||||
|
_options->inputBufSize = vm["input-buff-size"].as<int>();
|
||||||
|
|
||||||
|
if ( vm.count("input-method") )
|
||||||
|
_options->inputMethod = vm["input-method"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("input-address") )
|
||||||
|
_options->inputAddress = vm["input-address"].as<string>();
|
||||||
|
|
||||||
|
if ( vm.count("output-socket-type") )
|
||||||
|
_options->outputSocketType = vm["output-socket-type"].as< vector<string> >();
|
||||||
|
|
||||||
|
if ( vm.count("output-buff-size") )
|
||||||
|
_options->outputBufSize = vm["output-buff-size"].as< vector<int> >();
|
||||||
|
|
||||||
|
if ( vm.count("output-method") )
|
||||||
|
_options->outputMethod = vm["output-method"].as< vector<string> >();
|
||||||
|
|
||||||
|
if ( vm.count("output-address") )
|
||||||
|
_options->outputAddress = vm["output-address"].as< vector<string> >();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
s_catch_signals();
|
s_catch_signals();
|
||||||
|
|
||||||
|
DeviceOptions_t options;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!parse_cmd_line(argc, argv, &options))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (exception& e)
|
||||||
|
{
|
||||||
|
LOG(ERROR) << e.what();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LOG(INFO) << "PID: " << getpid();
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
#ifdef NANOMSG
|
#ifdef NANOMSG
|
||||||
|
@ -76,48 +160,25 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
splitter.SetTransport(transportFactory);
|
splitter.SetTransport(transportFactory);
|
||||||
|
|
||||||
int i = 1;
|
splitter.SetProperty(FairMQSplitter::Id, options.id);
|
||||||
|
splitter.SetProperty(FairMQSplitter::NumIoThreads, options.ioThreads);
|
||||||
splitter.SetProperty(FairMQSplitter::Id, argv[i]);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int numIoThreads;
|
|
||||||
stringstream(argv[i]) >> numIoThreads;
|
|
||||||
splitter.SetProperty(FairMQSplitter::NumIoThreads, numIoThreads);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
splitter.SetProperty(FairMQSplitter::NumInputs, 1);
|
splitter.SetProperty(FairMQSplitter::NumInputs, 1);
|
||||||
|
splitter.SetProperty(FairMQSplitter::NumOutputs, options.numOutputs);
|
||||||
int numOutputs;
|
|
||||||
stringstream(argv[i]) >> numOutputs;
|
|
||||||
splitter.SetProperty(FairMQSplitter::NumOutputs, numOutputs);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
splitter.ChangeState(FairMQSplitter::INIT);
|
splitter.ChangeState(FairMQSplitter::INIT);
|
||||||
|
|
||||||
splitter.SetProperty(FairMQSplitter::InputSocketType, argv[i], 0);
|
splitter.SetProperty(FairMQSplitter::InputSocketType, options.inputSocketType);
|
||||||
++i;
|
splitter.SetProperty(FairMQSplitter::InputSndBufSize, options.inputBufSize);
|
||||||
int inputRcvBufSize;
|
splitter.SetProperty(FairMQSplitter::InputMethod, options.inputMethod);
|
||||||
stringstream(argv[i]) >> inputRcvBufSize;
|
splitter.SetProperty(FairMQSplitter::InputAddress, options.inputAddress);
|
||||||
splitter.SetProperty(FairMQSplitter::InputRcvBufSize, inputRcvBufSize, 0);
|
|
||||||
++i;
|
|
||||||
splitter.SetProperty(FairMQSplitter::InputMethod, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
splitter.SetProperty(FairMQSplitter::InputAddress, argv[i], 0);
|
|
||||||
++i;
|
|
||||||
|
|
||||||
int outputSndBufSize;
|
for (int i = 0; i < options.numOutputs; ++i)
|
||||||
for (int iOutput = 0; iOutput < numOutputs; iOutput++)
|
|
||||||
{
|
{
|
||||||
splitter.SetProperty(FairMQSplitter::OutputSocketType, argv[i], iOutput);
|
splitter.SetProperty(FairMQSplitter::OutputSocketType, options.outputSocketType.at(i), i);
|
||||||
++i;
|
splitter.SetProperty(FairMQSplitter::OutputRcvBufSize, options.outputBufSize.at(i), i);
|
||||||
stringstream(argv[i]) >> outputSndBufSize;
|
splitter.SetProperty(FairMQSplitter::OutputMethod, options.outputMethod.at(i), i);
|
||||||
splitter.SetProperty(FairMQSplitter::OutputSndBufSize, outputSndBufSize, iOutput);
|
splitter.SetProperty(FairMQSplitter::OutputAddress, options.outputAddress.at(i), i);
|
||||||
++i;
|
|
||||||
splitter.SetProperty(FairMQSplitter::OutputMethod, argv[i], iOutput);
|
|
||||||
++i;
|
|
||||||
splitter.SetProperty(FairMQSplitter::OutputAddress, argv[i], iOutput);
|
|
||||||
++i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
splitter.ChangeState(FairMQSplitter::SETOUTPUT);
|
splitter.ChangeState(FairMQSplitter::SETOUTPUT);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user