From b9b2bd1fe7452307f1cec9927d988d259a82b119 Mon Sep 17 00:00:00 2001 From: Barthelemy Date: Fri, 27 Jun 2025 09:06:10 +0200 Subject: [PATCH 1/2] [QC-1296] Registering the QC tasks in BK must be the default behaviour --- Framework/src/AggregatorRunner.cxx | 2 +- Framework/src/CheckRunner.cxx | 2 +- Framework/src/PostProcessingRunner.cxx | 2 +- Framework/src/TaskRunner.cxx | 15 +-------------- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Framework/src/AggregatorRunner.cxx b/Framework/src/AggregatorRunner.cxx index 4ce15a2aa0..6d7caca924 100644 --- a/Framework/src/AggregatorRunner.cxx +++ b/Framework/src/AggregatorRunner.cxx @@ -378,7 +378,7 @@ void AggregatorRunner::start(ServiceRegistryRef services) } // register ourselves to the BK - if (gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { // until we are sure it works, we have to turn it on + if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration ILOG(Debug, Devel) << "Registering aggregator to BookKeeping" << ENDM; try { Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, AggregatorRunner::getDetectorName(mAggregators), bkp::DplProcessType::QC_AGGREGATOR, ""); diff --git a/Framework/src/CheckRunner.cxx b/Framework/src/CheckRunner.cxx index 416fdbe889..2ea4226640 100644 --- a/Framework/src/CheckRunner.cxx +++ b/Framework/src/CheckRunner.cxx @@ -455,7 +455,7 @@ void CheckRunner::start(ServiceRegistryRef services) } // register ourselves to the BK - if (gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { // until we are sure it works, we have to turn it on + if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration ILOG(Debug, Devel) << "Registering checkRunner to BookKeeping" << ENDM; try { Bookkeeping::getInstance().registerProcess(mActivity->mId, mDeviceName, mDetectorName, bkp::DplProcessType::QC_CHECKER, ""); diff --git a/Framework/src/PostProcessingRunner.cxx b/Framework/src/PostProcessingRunner.cxx index 2d7e10d273..24d596cf49 100644 --- a/Framework/src/PostProcessingRunner.cxx +++ b/Framework/src/PostProcessingRunner.cxx @@ -187,7 +187,7 @@ void PostProcessingRunner::start(framework::ServiceRegistryRef dplServices) QcInfoLogger::setRun(mActivity.mId); // register ourselves to the BK - if (gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { // until we are sure it works, we have to turn it on + if (!gSystem->Getenv("O2_QC_DONT_REGISTER_IN_BK")) { // Set this variable to disable the registration ILOG(Debug, Devel) << "Registering pp task to BookKeeping" << ENDM; try { Bookkeeping::getInstance().registerProcess(mActivity.mId, mRunnerConfig.taskName, mRunnerConfig.detectorName, bkp::DplProcessType::QC_POSTPROCESSING, ""); diff --git a/Framework/src/TaskRunner.cxx b/Framework/src/TaskRunner.cxx index 2820b9c512..bfd4b5f633 100644 --- a/Framework/src/TaskRunner.cxx +++ b/Framework/src/TaskRunner.cxx @@ -306,11 +306,6 @@ void TaskRunner::start(ServiceRegistryRef services) mNoMoreCycles = false; mCycleNumber = 0; - if (gSystem->Getenv("O2_QC_REGISTER_IN_BK_AT_START")) { - // until we are sure it works, we have to turn it on - registerToBookkeeping(); - } - try { startOfActivity(); startCycle(); @@ -442,13 +437,6 @@ void TaskRunner::registerToBookkeeping() ILOG(Debug, Devel) << "Registering taskRunner to BookKeeping" << ENDM; try { Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bkp::DplProcessType::QC_TASK, ""); - if (gSystem->Getenv("O2_QC_REGISTER_IN_BK_X_TIMES")) { - ILOG(Debug, Devel) << "O2_QC_REGISTER_IN_BK_X_TIMES set to " << gSystem->Getenv("O2_QC_REGISTER_IN_BK_X_TIMES") << ENDM; - int iterations = std::stoi(gSystem->Getenv("O2_QC_REGISTER_IN_BK_X_TIMES")); - for (int i = 1; i < iterations; i++) { // start at 1 because we already did it once - Bookkeeping::getInstance().registerProcess(mActivity.mId, mTaskConfig.taskName, mTaskConfig.detectorName, bkp::DplProcessType::QC_TASK, ""); - } - } } catch (std::runtime_error& error) { ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM; } @@ -465,8 +453,7 @@ void TaskRunner::finishCycle(DataAllocator& outputs) << "(" << mTimekeeper->getTimerangeIdRange().getMin() << ", " << mTimekeeper->getTimerangeIdRange().getMax() << ")" << ENDM; mTask->endOfCycle(); - if (mCycleNumber == 0 && gSystem->Getenv("O2_QC_REGISTER_IN_BK")) { - // until we are sure it works, we have to turn it on + if (mCycleNumber == 0) { // register at the end of the first cycle registerToBookkeeping(); } From d9551cd3d8543e32dcfe3857890ee454f1c2e5e4 Mon Sep 17 00:00:00 2001 From: Barthelemy Date: Fri, 27 Jun 2025 09:09:59 +0200 Subject: [PATCH 2/2] doc --- doc/Framework.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/Framework.md b/doc/Framework.md index 94def65556..54ac81a388 100644 --- a/doc/Framework.md +++ b/doc/Framework.md @@ -673,6 +673,11 @@ Null QOs are marked with purple. ![](images/qo_flag_conversion_10.svg) +## Registration of QC devices into the BookKeeping + +By default, the QC tasks, PP tasks, check runners, and aggregators are registered in the BK. +To disable this behaviour, pass the following environment variable : `O2_QC_DONT_REGISTER_IN_BK` (in the ECS). + ## Solving performance issues Problems with performance in message passing systems like QC usually manifest in backpressure seen in input channels of processes which are too slow.