17 #ifndef QC_CORE_TASKRUNNER_H 18 #define QC_CORE_TASKRUNNER_H 20 #include <boost/property_tree/ptree.hpp> 23 #include <Common/Timer.h> 24 #include <Framework/Task.h> 25 #include <Framework/DataProcessorSpec.h> 26 #include <Framework/CompletionPolicy.h> 27 #include <Framework/EndOfStreamContext.h> 28 #include <Headers/DataHeader.h> 29 #include <Framework/InitContext.h> 36 class ConfigurationInterface;
76 TaskRunner(
const std::string& taskName,
const std::string& configurationSource,
size_t id = 0);
80 void init(framework::InitContext& iCtx)
override;
82 void run(framework::ProcessingContext& pCtx)
override;
85 static framework::CompletionPolicy::CompletionOp completionPolicyCallback(o2::framework::CompletionPolicy::InputSet inputs);
87 std::string getDeviceName() {
return mDeviceName; };
88 const framework::Inputs& getInputsSpecs() {
return mInputSpecs; };
89 const framework::OutputSpec getOutputSpec() {
return mMonitorObjectsSpec; };
90 const framework::Options getOptions() {
return mOptions; };
92 void setResetAfterPublish(
bool);
95 static std::string createTaskRunnerIdString();
97 static header::DataOrigin createTaskDataOrigin();
99 static header::DataDescription createTaskDataDescription(
const std::string& taskName);
102 void endOfStream(framework::EndOfStreamContext& eosContext)
override;
106 void start(
const framework::ConfigParamRegistry& options);
112 std::tuple<
bool ,
bool > validateInputs(
const framework::InputRecord&);
113 void loadTaskConfig();
114 void loadTopologyConfig();
115 void startOfActivity();
116 void endOfActivity();
118 void finishCycle(framework::DataAllocator& outputs);
119 int publish(framework::DataAllocator& outputs);
120 void publishCycleStats();
124 std::string mDeviceName;
126 std::shared_ptr<configuration::ConfigurationInterface> mConfigFile;
127 std::shared_ptr<monitoring::Monitoring> mCollector;
128 std::shared_ptr<TaskInterface> mTask;
129 bool mResetAfterPublish =
false;
130 std::shared_ptr<ObjectsManager> mObjectsManager;
133 std::string validateDetectorName(std::string name)
const;
134 boost::property_tree::ptree getTaskConfigTree()
const;
135 void updateMonitoringStats(framework::ProcessingContext& pCtx);
138 framework::Inputs mInputSpecs;
139 framework::OutputSpec mMonitorObjectsSpec;
140 framework::Options mOptions;
142 bool mCycleOn =
false;
143 bool mNoMoreCycles =
false;
144 int mCycleNumber = 0;
147 int mNumberMessagesReceivedInCycle = 0;
148 int mNumberObjectsPublishedInCycle = 0;
149 int mTotalNumberObjectsPublished = 0;
150 double mLastPublicationDuration = 0;
151 int mDataReceivedInCycle = 0;
152 AliceO2::Common::Timer mTimerTotalDurationActivity;
153 AliceO2::Common::Timer mTimerDurationCycle;
158 #endif // QC_CORE_TASKRUNNER_H Definition: AggregatorRunner.h:34
Container for the configuration of a Task.
Definition: TaskConfig.h:26
Definition: Aggregator.h:27
A class driving the execution of a QC task inside DPL.
Definition: TaskRunner.h:68
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19