mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Add FairMQProgOptions for configuring MQDevices
This commit is contained in:
38
fairmq/options/ProgOptionTest/macro/ConfigFileTest.cfg.in
Normal file
38
fairmq/options/ProgOptionTest/macro/ConfigFileTest.cfg.in
Normal file
@@ -0,0 +1,38 @@
|
||||
#----------------------------------------------------
|
||||
# comments :
|
||||
# brackets [] are used to group options. For example :
|
||||
#
|
||||
# [xml.config]
|
||||
# node.root = fairMQOptions
|
||||
#
|
||||
# is equivalent to
|
||||
# xml.config.node.root = fairMQOptions
|
||||
#----------------------------------------------------
|
||||
|
||||
config-json-filename = @CMAKE_BINARY_DIR@/bin/testJSON.json
|
||||
config-xml-filename = @CMAKE_BINARY_DIR@/bin/testXML.xml
|
||||
|
||||
#
|
||||
device-id = merger
|
||||
|
||||
#-------------------
|
||||
[xml.config]
|
||||
|
||||
#filename = @CMAKE_BINARY_DIR@/bin/testXML.xml
|
||||
node.root = fairMQOptions
|
||||
|
||||
|
||||
#-------------------
|
||||
[input.file]
|
||||
|
||||
name = sampler_file_name.root
|
||||
tree = sampler_tree
|
||||
branch = sampler_branch
|
||||
|
||||
|
||||
#-------------------
|
||||
[output.file]
|
||||
|
||||
name = sink_filename.root
|
||||
tree = sink_tree
|
||||
branch = sink_branch
|
40
fairmq/options/ProgOptionTest/macro/bsampler-sink.json
Normal file
40
fairmq/options/ProgOptionTest/macro/bsampler-sink.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"fairMQOptions":
|
||||
{
|
||||
"device":
|
||||
{
|
||||
"id": "bsampler1",
|
||||
"channel":
|
||||
{
|
||||
"name": "data-out",
|
||||
"socket":
|
||||
{
|
||||
"type": "pub",
|
||||
"method": "bind",
|
||||
"address": "tcp://*:5555",
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"device":
|
||||
{
|
||||
"id": "sink1",
|
||||
"channel":
|
||||
{
|
||||
"name": "data-in",
|
||||
"socket":
|
||||
{
|
||||
"type": "sub",
|
||||
"method": "connect",
|
||||
"address": "tcp://localhost:5555",
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
JSONFILE="@CMAKE_BINARY_DIR@/bin/bsampler-sink.json"
|
||||
|
||||
# Note: device-id value must correspond to the device id given in the json file
|
||||
|
||||
BSAMPLER="runOptTestSampler"
|
||||
BSAMPLER+=" --config-sjson-filename $JSONFILE"
|
||||
BSAMPLER+=" --device-id bsampler1"
|
||||
|
||||
xterm -geometry 150x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$BSAMPLER &
|
||||
|
||||
|
||||
SINK="runOptTestSink"
|
||||
SINK+=" --config-json-filename $JSONFILE"
|
||||
SINK+=" --device-id sink1"
|
||||
|
||||
xterm -geometry 150x23+0+350 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK &
|
60
fairmq/options/ProgOptionTest/macro/testJSON.json
Normal file
60
fairmq/options/ProgOptionTest/macro/testJSON.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"fairMQOptions": {
|
||||
"device":
|
||||
{
|
||||
"id": "merger1",
|
||||
"channel":
|
||||
{
|
||||
"name": "two_inputs_channel",
|
||||
"socket":
|
||||
{
|
||||
"type": "pull",
|
||||
"address": "tcp://*:5569",
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "1"
|
||||
},
|
||||
"socket":
|
||||
{
|
||||
"type": "pull",
|
||||
"method": "bind",
|
||||
"address": "tcp://*:5570",
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "1"
|
||||
}
|
||||
|
||||
},
|
||||
"channel":
|
||||
{
|
||||
"name": "one_output_channel",
|
||||
"socket": {
|
||||
"type": "push",
|
||||
"method": "connect",
|
||||
"address": "tcp://*:5571",
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "1"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"device":
|
||||
{
|
||||
"id": "sink1",
|
||||
"channel": {
|
||||
"name": "one_input",
|
||||
"socket": {
|
||||
"name": "input1",
|
||||
"type": "pull",
|
||||
"method": "bind",
|
||||
"address": "tcp://localhost:5571",
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
11
fairmq/options/ProgOptionTest/macro/testMQOptions1.sh.in
Normal file
11
fairmq/options/ProgOptionTest/macro/testMQOptions1.sh.in
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
RUN_TEST="runtestMQOption1"
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
RUN_TEST+=" $*"
|
||||
fi
|
||||
|
||||
RUN_TEST+=" --config-xml-filename @CMAKE_BINARY_DIR@/bin/testXML.xml"
|
||||
|
||||
@CMAKE_BINARY_DIR@/bin/$RUN_TEST
|
59
fairmq/options/ProgOptionTest/macro/testMQOptions2.sh.in
Normal file
59
fairmq/options/ProgOptionTest/macro/testMQOptions2.sh.in
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
RUN_TEST="runtestMQOption1"
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
RUN_TEST+=" $*"
|
||||
fi
|
||||
|
||||
XML_CMD_LINE="<fairMQOptions>"
|
||||
XML_CMD_LINE+="<device name=\"merger\" id=\"1234\" >"
|
||||
XML_CMD_LINE+=" <channel name=\"two_inputs_channel\" >"
|
||||
XML_CMD_LINE+=" <socket name=\"input1\" >"
|
||||
XML_CMD_LINE+=" <type>pull</type>"
|
||||
XML_CMD_LINE+=" <method>bind</method>"
|
||||
XML_CMD_LINE+=" <address>tcp://*:5569</address>"
|
||||
XML_CMD_LINE+=" <sndBufSize>1000</sndBufSize>"
|
||||
XML_CMD_LINE+=" <rcvBufSize>1000</rcvBufSize>"
|
||||
XML_CMD_LINE+=" <rateLogging>1</rateLogging>"
|
||||
XML_CMD_LINE+=" </socket>"
|
||||
XML_CMD_LINE+=" <socket name=\"input2\" >"
|
||||
XML_CMD_LINE+=" <type>pull</type>"
|
||||
XML_CMD_LINE+=" <method>bind</method>"
|
||||
XML_CMD_LINE+=" <address>tcp://*:5570</address>"
|
||||
XML_CMD_LINE+=" <sndBufSize>1000</sndBufSize>"
|
||||
XML_CMD_LINE+=" <rcvBufSize>1000</rcvBufSize>"
|
||||
XML_CMD_LINE+=" <rateLogging>1</rateLogging>"
|
||||
XML_CMD_LINE+=" </socket>"
|
||||
XML_CMD_LINE+=" </channel>"
|
||||
XML_CMD_LINE+=" <channel name=\"one_output_channel\" >"
|
||||
XML_CMD_LINE+=" <socket name=\"output1\" >"
|
||||
XML_CMD_LINE+=" <type>push</type>"
|
||||
XML_CMD_LINE+=" <method>connect</method>"
|
||||
XML_CMD_LINE+=" <address>tcp://*:5571</address>"
|
||||
XML_CMD_LINE+=" <sndBufSize>1000</sndBufSize>"
|
||||
XML_CMD_LINE+=" <rcvBufSize>1000</rcvBufSize>"
|
||||
XML_CMD_LINE+=" <rateLogging>1</rateLogging>"
|
||||
XML_CMD_LINE+=" </socket>"
|
||||
XML_CMD_LINE+=" </channel>"
|
||||
XML_CMD_LINE+=" </device>"
|
||||
XML_CMD_LINE+=" <device name=\"sink\" id=\"4567\" >"
|
||||
XML_CMD_LINE+=" <channel name=\"one_input\" >"
|
||||
XML_CMD_LINE+=" <socket name=\"input1\" >"
|
||||
XML_CMD_LINE+=" <type>pull</type>"
|
||||
XML_CMD_LINE+=" <method>bind</method>"
|
||||
XML_CMD_LINE+=" <address>tcp://localhost:5571</address>"
|
||||
XML_CMD_LINE+=" <sndBufSize>1000</sndBufSize>"
|
||||
XML_CMD_LINE+=" <rcvBufSize>1000</rcvBufSize>"
|
||||
XML_CMD_LINE+=" <rateLogging>1</rateLogging>"
|
||||
XML_CMD_LINE+=" </socket>"
|
||||
XML_CMD_LINE+=" </channel>"
|
||||
XML_CMD_LINE+=" </device>"
|
||||
XML_CMD_LINE+="</fairmq_option>"
|
||||
|
||||
|
||||
|
||||
RUN_TEST+=" --config-xml-string $XML_CMD_LINE"
|
||||
|
||||
|
||||
@CMAKE_BINARY_DIR@/bin/$RUN_TEST
|
10
fairmq/options/ProgOptionTest/macro/testMQOptions3.sh.in
Normal file
10
fairmq/options/ProgOptionTest/macro/testMQOptions3.sh.in
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
RUN_TEST="runtestMQOption2"
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
RUN_TEST+=" $*"
|
||||
fi
|
||||
RUN_TEST+=" --config @CMAKE_BINARY_DIR@/bin/ConfigFileTest.cfg"
|
||||
|
||||
@CMAKE_BINARY_DIR@/bin/$RUN_TEST
|
11
fairmq/options/ProgOptionTest/macro/testMQOptions4.sh.in
Normal file
11
fairmq/options/ProgOptionTest/macro/testMQOptions4.sh.in
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
RUN_TEST="runtestMQOption1"
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
RUN_TEST+=" $*"
|
||||
fi
|
||||
|
||||
RUN_TEST+=" --config-json-filename @CMAKE_BINARY_DIR@/bin/testJSON.json"
|
||||
|
||||
@CMAKE_BINARY_DIR@/bin/$RUN_TEST
|
77
fairmq/options/ProgOptionTest/macro/testMQOptions5.sh.in
Normal file
77
fairmq/options/ProgOptionTest/macro/testMQOptions5.sh.in
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
RUN_TEST="runtestMQOption1"
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
RUN_TEST+=" $*"
|
||||
fi
|
||||
|
||||
JSON_CMD_LINE="{"
|
||||
JSON_CMD_LINE+=" \"fairMQOptions\": {"
|
||||
JSON_CMD_LINE+=" \"device\": "
|
||||
JSON_CMD_LINE+=" {"
|
||||
JSON_CMD_LINE+=" \"name\": \"merger\","
|
||||
JSON_CMD_LINE+=" \"id\": \"1234\","
|
||||
JSON_CMD_LINE+=" \"channel\": "
|
||||
JSON_CMD_LINE+=" {"
|
||||
JSON_CMD_LINE+=" \"name\": \"two_inputs_channel\","
|
||||
JSON_CMD_LINE+=" \"socket\": "
|
||||
JSON_CMD_LINE+=" {"
|
||||
JSON_CMD_LINE+=" \"name\": \"input1\","
|
||||
JSON_CMD_LINE+=" \"type\": \"pull\","
|
||||
JSON_CMD_LINE+=" \"method\": \"bind\","
|
||||
JSON_CMD_LINE+=" \"address\": \"tcp://*:5569\","
|
||||
JSON_CMD_LINE+=" \"sndBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rcvBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rateLogging\": \"1\" "
|
||||
JSON_CMD_LINE+=" },"
|
||||
JSON_CMD_LINE+=" \"socket\": "
|
||||
JSON_CMD_LINE+=" {"
|
||||
JSON_CMD_LINE+=" \"name\": \"input2\","
|
||||
JSON_CMD_LINE+=" \"type\": \"pull\","
|
||||
JSON_CMD_LINE+=" \"method\": \"bind\","
|
||||
JSON_CMD_LINE+=" \"address\": \"tcp://*:5570\","
|
||||
JSON_CMD_LINE+=" \"sndBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rcvBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rateLogging\": \"1\" "
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+=" },"
|
||||
JSON_CMD_LINE+=" \"channel\":"
|
||||
JSON_CMD_LINE+=" {"
|
||||
JSON_CMD_LINE+=" \"name\": \"one_output_channel\","
|
||||
JSON_CMD_LINE+=" \"socket\": {"
|
||||
JSON_CMD_LINE+=" \"name\": \"output1\","
|
||||
JSON_CMD_LINE+=" \"type\": \"push\","
|
||||
JSON_CMD_LINE+=" \"method\": \"connect\","
|
||||
JSON_CMD_LINE+=" \"address\": \"tcp://*:5571\","
|
||||
JSON_CMD_LINE+=" \"sndBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rcvBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rateLogging\": \"1\" "
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+=" },"
|
||||
JSON_CMD_LINE+=" \"device\":"
|
||||
JSON_CMD_LINE+=" {"
|
||||
JSON_CMD_LINE+=" \"name\": \"sink\","
|
||||
JSON_CMD_LINE+=" \"id\": \"4567\","
|
||||
JSON_CMD_LINE+=" \"channel\": {"
|
||||
JSON_CMD_LINE+=" \"name\": \"one_input\","
|
||||
JSON_CMD_LINE+=" \"socket\": {"
|
||||
JSON_CMD_LINE+=" \"name\": \"input1\","
|
||||
JSON_CMD_LINE+=" \"type\": \"pull\","
|
||||
JSON_CMD_LINE+=" \"method\": \"bind\","
|
||||
JSON_CMD_LINE+=" \"address\": \"tcp://localhost:5571\","
|
||||
JSON_CMD_LINE+=" \"sndBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rcvBufSize\": \"1000\","
|
||||
JSON_CMD_LINE+=" \"rateLogging\": \"1\" "
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+=" }"
|
||||
JSON_CMD_LINE+="}"
|
||||
|
||||
|
||||
RUN_TEST+=" --config-json-string $JSON_CMD_LINE"
|
||||
|
||||
|
||||
@CMAKE_BINARY_DIR@/bin/$RUN_TEST
|
48
fairmq/options/ProgOptionTest/macro/testXML.xml
Normal file
48
fairmq/options/ProgOptionTest/macro/testXML.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
<fairMQOptions>
|
||||
<device name="merger" id="merger" >
|
||||
<channel name="two_inputs_channel" >
|
||||
<socket name="input1" >
|
||||
<type>pull</type>
|
||||
<method>bind</method>
|
||||
<address>tcp://*:5569</address>
|
||||
<sndBufSize>1000</sndBufSize>
|
||||
<rcvBufSize>1000</rcvBufSize>
|
||||
<rateLogging>1</rateLogging>
|
||||
|
||||
</socket>
|
||||
<socket name="input2" >
|
||||
<type>pull</type>
|
||||
<method>bind</method>
|
||||
<address>tcp://*:5570</address>
|
||||
<sndBufSize>1000</sndBufSize>
|
||||
<rcvBufSize>1000</rcvBufSize>
|
||||
<rateLogging>1</rateLogging>
|
||||
|
||||
</socket>
|
||||
</channel>
|
||||
<channel name="one_output_channel" >
|
||||
<socket name="output1" >
|
||||
<type>push</type>
|
||||
<method>connect</method>
|
||||
<address>tcp://*:5571</address>
|
||||
<sndBufSize>1000</sndBufSize>
|
||||
<rcvBufSize>1000</rcvBufSize>
|
||||
<rateLogging>1</rateLogging>
|
||||
</socket>
|
||||
</channel>
|
||||
</device>
|
||||
<device name="sink" id="sink" >
|
||||
<channel name="one_input" >
|
||||
<socket name="input1" >
|
||||
<type>pull</type>
|
||||
<method>bind</method>
|
||||
<address>tcp://localhost:5571</address>
|
||||
<sndBufSize>1000</sndBufSize>
|
||||
<rcvBufSize>1000</rcvBufSize>
|
||||
<rateLogging>1</rateLogging>
|
||||
</socket>
|
||||
</channel>
|
||||
</device>
|
||||
</fairMQOptions>
|
||||
|
Reference in New Issue
Block a user