First version of the shared memory transport.

Use via `--transport shmem` cmd option. No pub/sub.
This commit is contained in:
Alexey Rybalchenko
2016-06-03 11:24:12 +02:00
parent 6c3b01f09c
commit a332d9fc83
39 changed files with 2121 additions and 309 deletions

View File

@@ -15,8 +15,9 @@ void addCustomOptions(bpo::options_description& options)
{
options.add_options()
("out-channel", bpo::value<std::string>()->default_value("data"), "Name of the output channel")
("same-msg", bpo::value<bool>()->default_value(true), "Re-send the same message (default), or recreate for each iteration")
("msg-size", bpo::value<int>()->default_value(1000), "Message size in bytes")
("num-msgs", bpo::value<int>()->default_value(0), "Number of messages to send")
("num-msgs", bpo::value<uint64_t>()->default_value(0), "Number of messages to send")
("msg-rate", bpo::value<int>()->default_value(0), "Msg rate limit in maximum number of messages per second");
}

View File

@@ -26,7 +26,8 @@ int main(int argc, char* argv[])
CIntercomService service;
CCustomCmd ddsCustomCmd(service);
service.subscribeOnError([](const EErrorCode errorCode, const string& errorMsg) {
service.subscribeOnError([](const EErrorCode errorCode, const string& errorMsg)
{
cout << "DDS error received: error code: " << errorCode << ", error message: " << errorMsg << endl;
});
@@ -46,10 +47,14 @@ int main(int argc, char* argv[])
t.c_lflag &= ~ICANON; // disable canonical input
tcsetattr(STDIN_FILENO, TCSANOW, &t); // apply the new settings
if ( argc != 2 )
if (argc != 2)
{
PrintControlsHelp();
}
else
{
cin.putback(argv[1][0]);
}
while (cin >> c)
{

View File

@@ -2,17 +2,28 @@
numMsgs="0"
msgSize="1000000"
transport="zeromq"
sameMsg="true"
if [[ $1 =~ ^[0-9]+$ ]]; then
msgSize=$1
fi
echo "Starting benchmark with message size of $msgSize bytes."
if [[ $2 =~ ^[0-9]+$ ]]; then
numMsgs=$2
fi
if [[ $3 =~ ^[a-z]+$ ]]; then
transport=$3
fi
if [[ $4 =~ ^[a-z]+$ ]]; then
sameMsg=$4
fi
echo "Starting benchmark with message size of $msgSize bytes ($numMsgs messages) and $transport transport."
echo "Using $transport transport."
if [ $numMsgs = 0 ]; then
echo "Unlimited number of messages."
else
@@ -20,14 +31,15 @@ else
fi
echo ""
echo "Usage: startBenchmark [message size=1000000] [number of messages=0]"
echo "Usage: startBenchmark [message size=1000000] [number of messages=0] [transport=zeromq/nanomsg/shmem] [resend same message=true]"
SAMPLER="bsampler"
SAMPLER+=" --id bsampler1"
#SAMPLER+=" --io-threads 2"
#SAMPLER+=" --control static"
#SAMPLER+=" --transport nanomsg"
SAMPLER+=" --transport $transport"
SAMPLER+=" --msg-size $msgSize"
SAMPLER+=" --same-msg $sameMsg"
# SAMPLER+=" --msg-rate 1000"
SAMPLER+=" --num-msgs $numMsgs"
SAMPLER+=" --mq-config @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
@@ -37,7 +49,7 @@ SINK="sink"
SINK+=" --id sink1"
#SINK+=" --io-threads 2"
#SINK+=" --control static"
#SINK+=" --transport nanomsg"
SINK+=" --transport $transport"
SINK+=" --num-msgs $numMsgs"
SINK+=" --mq-config @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK &