QC ex: rename qc devices, granular state control

This commit is contained in:
Alexey Rybalchenko 2020-03-30 11:57:54 +02:00 committed by Dennis Klein
parent adc4688f9b
commit 46014118f0
7 changed files with 31 additions and 29 deletions

View File

@ -40,7 +40,7 @@ A topology consisting of three layers of devices: synchronizer -> n * senders ->
## QC ## QC
A topology consisting of 4 devices - Sampler, QCProducer, QCConsumer and Sink. The data flows from Sampler through QCProducer to Sink. On demand - by setting the corresponding configuration property - the QCProducer device will duplicate the data to the QCConsumer device. The property is set by the topology controller, in this example this is the `fairmq-dds-command-ui` utility. A topology consisting of 4 devices - Sampler, QCDispatcher, QCTask and Sink. The data flows from Sampler through QCDispatcher to Sink. On demand - by setting the corresponding configuration property - the QCDispatcher device will duplicate the data to the QCTask device. The property is set by the topology controller, in this example this is the `fairmq-dds-command-ui` utility.
## Readout ## Readout

View File

@ -9,16 +9,16 @@
add_executable(fairmq-ex-qc-sampler runSampler.cxx) add_executable(fairmq-ex-qc-sampler runSampler.cxx)
target_link_libraries(fairmq-ex-qc-sampler PRIVATE FairMQ) target_link_libraries(fairmq-ex-qc-sampler PRIVATE FairMQ)
add_executable(fairmq-ex-qc-producer runQCProducer.cxx) add_executable(fairmq-ex-qc-dispatcher runQCDispatcher.cxx)
target_link_libraries(fairmq-ex-qc-producer PRIVATE FairMQ) target_link_libraries(fairmq-ex-qc-dispatcher PRIVATE FairMQ)
add_executable(fairmq-ex-qc-consumer runQCConsumer.cxx) add_executable(fairmq-ex-qc-task runQCTask.cxx)
target_link_libraries(fairmq-ex-qc-consumer PRIVATE FairMQ) target_link_libraries(fairmq-ex-qc-task PRIVATE FairMQ)
add_executable(fairmq-ex-qc-sink runSink.cxx) add_executable(fairmq-ex-qc-sink runSink.cxx)
target_link_libraries(fairmq-ex-qc-sink PRIVATE FairMQ) target_link_libraries(fairmq-ex-qc-sink PRIVATE FairMQ)
add_custom_target(ExampleQC DEPENDS fairmq-ex-qc-sampler fairmq-ex-qc-producer fairmq-ex-qc-consumer fairmq-ex-qc-sink) add_custom_target(ExampleQC DEPENDS fairmq-ex-qc-sampler fairmq-ex-qc-dispatcher fairmq-ex-qc-task fairmq-ex-qc-sink)
list(JOIN Boost_LIBRARY_DIRS ":" LIB_DIR) list(JOIN Boost_LIBRARY_DIRS ":" LIB_DIR)
set(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_BINARY_DIR}/fairmq/plugins/DDS) set(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_BINARY_DIR}/fairmq/plugins/DDS)
@ -37,8 +37,8 @@ endif()
install( install(
TARGETS TARGETS
fairmq-ex-qc-sampler fairmq-ex-qc-sampler
fairmq-ex-qc-producer fairmq-ex-qc-dispatcher
fairmq-ex-qc-consumer fairmq-ex-qc-task
fairmq-ex-qc-sink fairmq-ex-qc-sink
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR} LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR}

View File

@ -1,4 +1,4 @@
QC QC
== ==
A topology consisting of 4 devices - Sampler, QCProducer, QCConsumer and Sink. The data flows from Sampler through QCProducer to Sink. On demand - by setting the corresponding configuration property - the QCProducer device will duplicate the data to the QCConsumer device. The property is set by the topology controller, in this example this is the `fairmq-dds-command-ui` utility. A topology consisting of 4 devices - Sampler, QCDispatcher, QCTask and Sink. The data flows from Sampler through QCDispatcher to Sink. On demand - by setting the corresponding configuration property - the QCDispatcher device will duplicate the data to the QCTask device. The property is set by the topology controller, in this example this is the `fairmq-dds-command-ui` utility.

View File

@ -12,8 +12,8 @@
</properties> </properties>
</decltask> </decltask>
<decltask name="QCProducer"> <decltask name="QCDispatcher">
<exe>fairmq-ex-qc-producer --color false --channel-config name=data1,type=pull,method=connect name=data2,type=push,method=connect name=qc,type=push,method=connect -P dds</exe> <exe>fairmq-ex-qc-dispatcher --color false --channel-config name=data1,type=pull,method=connect name=data2,type=push,method=connect name=qc,type=push,method=connect -P dds</exe>
<env reachable="false">fairmq-ex-qc-env.sh</env> <env reachable="false">fairmq-ex-qc-env.sh</env>
<properties> <properties>
<name access="read">fmqchan_data1</name> <name access="read">fmqchan_data1</name>
@ -22,8 +22,8 @@
</properties> </properties>
</decltask> </decltask>
<decltask name="QCConsumer"> <decltask name="QCTask">
<exe>fairmq-ex-qc-consumer --color false --channel-config name=qc,type=pull,method=bind -P dds</exe> <exe>fairmq-ex-qc-task --color false --channel-config name=qc,type=pull,method=bind -P dds</exe>
<env reachable="false">fairmq-ex-qc-env.sh</env> <env reachable="false">fairmq-ex-qc-env.sh</env>
<properties> <properties>
<name access="write">fmqchan_qc</name> <name access="write">fmqchan_qc</name>
@ -40,8 +40,8 @@
<main name="main"> <main name="main">
<task>Sampler</task> <task>Sampler</task>
<task>QCProducer</task> <task>QCDispatcher</task>
<task>QCConsumer</task> <task>QCTask</task>
<task>Sink</task> <task>Sink</task>
</main> </main>

View File

@ -51,12 +51,14 @@ fairmq-dds-command-ui -c k
fairmq-dds-command-ui -c b fairmq-dds-command-ui -c b
fairmq-dds-command-ui -c x fairmq-dds-command-ui -c x
fairmq-dds-command-ui -c j fairmq-dds-command-ui -c j
fairmq-dds-command-ui -c r allexceptqctasks="main/(Sampler|QCDispatcher|Sink)"
qcconsumer="main/QCConsumer.*" fairmq-dds-command-ui -c r -p $allexceptqctasks
qcproducer="main/QCProducer.*" qctask="main/QCTask.*"
fairmq-dds-command-ui -c p --property-key qc --property-value active -p $qcproducer qcdispatcher="main/QCDispatcher.*"
fairmq-dds-command-ui -w "RUNNING->READY" -p $qcconsumer fairmq-dds-command-ui -c p --property-key qc --property-value active -p $qcdispatcher
echo "...$qcconsumer received data and transitioned to READY, sending shutdown..." fairmq-dds-command-ui -c r -p $qctask
fairmq-dds-command-ui -w "RUNNING->READY" -p $qctask
echo "...$qctask received data and transitioned to READY, sending shutdown..."
fairmq-dds-command-ui -c s fairmq-dds-command-ui -c s
fairmq-dds-command-ui -c t fairmq-dds-command-ui -c t
fairmq-dds-command-ui -c d fairmq-dds-command-ui -c d

View File

@ -9,13 +9,13 @@
#include "runFairMQDevice.h" #include "runFairMQDevice.h"
#include "FairMQDevice.h" #include "FairMQDevice.h"
class QCProducer : public FairMQDevice class QCDispatcher : public FairMQDevice
{ {
public: public:
QCProducer() QCDispatcher()
: fDoQC(false) : fDoQC(false)
{ {
OnData("data1", &QCProducer::HandleData); OnData("data1", &QCDispatcher::HandleData);
} }
void InitTask() override void InitTask() override
@ -56,4 +56,4 @@ class QCProducer : public FairMQDevice
}; };
void addCustomOptions(boost::program_options::options_description& /*options*/) {} void addCustomOptions(boost::program_options::options_description& /*options*/) {}
FairMQDevicePtr getDevice(const fair::mq::ProgOptions& /*config*/) { return new QCProducer(); } FairMQDevicePtr getDevice(const fair::mq::ProgOptions& /*config*/) { return new QCDispatcher(); }

View File

@ -9,10 +9,10 @@
#include "runFairMQDevice.h" #include "runFairMQDevice.h"
#include "FairMQDevice.h" #include "FairMQDevice.h"
class QCConsumer : public FairMQDevice class QCTask : public FairMQDevice
{ {
public: public:
QCConsumer() QCTask()
{ {
OnData("qc", [](FairMQMessagePtr& /*msg*/, int) { OnData("qc", [](FairMQMessagePtr& /*msg*/, int) {
LOG(info) << "received data"; LOG(info) << "received data";
@ -23,4 +23,4 @@ class QCConsumer : public FairMQDevice
namespace bpo = boost::program_options; namespace bpo = boost::program_options;
void addCustomOptions(bpo::options_description& /*options*/) {} void addCustomOptions(bpo::options_description& /*options*/) {}
FairMQDevicePtr getDevice(const fair::mq::ProgOptions& /*config*/) { return new QCConsumer(); } FairMQDevicePtr getDevice(const fair::mq::ProgOptions& /*config*/) { return new QCTask(); }