From f9111188307885daf490aaea7d249c215ce799d7 Mon Sep 17 00:00:00 2001 From: Anton Riedel Date: Thu, 12 Jun 2025 13:15:57 +0200 Subject: [PATCH] Feat: add GPUErrorQA task --- Modules/TPC/CMakeLists.txt | 5 +- Modules/TPC/include/TPC/GPUErrorQA.h | 57 ++++++++++++++++ Modules/TPC/include/TPC/LinkDef.h | 1 + Modules/TPC/run/tpcQCGPUErrorQA_direct.json | 38 +++++++++++ Modules/TPC/src/GPUErrorQA.cxx | 72 +++++++++++++++++++++ 5 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 Modules/TPC/include/TPC/GPUErrorQA.h create mode 100644 Modules/TPC/run/tpcQCGPUErrorQA_direct.json create mode 100644 Modules/TPC/src/GPUErrorQA.cxx diff --git a/Modules/TPC/CMakeLists.txt b/Modules/TPC/CMakeLists.txt index c170642066..56a7051d1a 100644 --- a/Modules/TPC/CMakeLists.txt +++ b/Modules/TPC/CMakeLists.txt @@ -40,7 +40,8 @@ target_sources(O2QcTPC PRIVATE src/PID.cxx src/SeparationPowerReductor.cxx src/TimeGainCalibReductor.cxx src/DCSPTempReductor.cxx - src/AtmosPressureReductor.cxx) + src/AtmosPressureReductor.cxx + src/GPUErrorQA.cxx) target_include_directories( O2QcTPC @@ -101,6 +102,7 @@ add_root_dictionary(O2QcTPC include/TPC/TimeGainCalibReductor.h include/TPC/DCSPTempReductor.h include/TPC/AtmosPressureReductor.h + include/TPC/GPUErrorQA.h LINKDEF include/TPC/LinkDef.h) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/TPC @@ -186,4 +188,5 @@ install(FILES run/tpcQCPID_sampled.json run/tpcQCTimeGainCalibTrending.json run/tpcDCSPTempTrending.json run/tpcQCAtmosPressureTrending.json + run/tpcQCGPUErrorQA_direct.json DESTINATION etc) diff --git a/Modules/TPC/include/TPC/GPUErrorQA.h b/Modules/TPC/include/TPC/GPUErrorQA.h new file mode 100644 index 0000000000..1ee46ebcd1 --- /dev/null +++ b/Modules/TPC/include/TPC/GPUErrorQA.h @@ -0,0 +1,57 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// +/// \file GPUErrorQA.h +/// \author Anton Riedel, anton.riedel@cern.ch +/// + +#ifndef QC_MODULE_TPC_GPUERRORQA_H +#define QC_MODULE_TPC_GPUERRORQA_H + +// O2 includes +#include "TPCQC/GPUErrorQA.h" + +// QC includes +#include "QualityControl/TaskInterface.h" + +using namespace o2::quality_control::core; + +namespace o2::quality_control_modules::tpc +{ + +/// \brief Quality Control DPL Task for QC Module TPC GPU errors +/// \author Anton Riedel + +class GPUErrorQA final : public TaskInterface +{ + public: + /// \brief Constructor + GPUErrorQA() = default; + /// Destructor + ~GPUErrorQA() override = default; + + // Definition of the methods for the template method pattern + void initialize(o2::framework::InitContext& ctx) override; + void startOfActivity(const Activity& activity) override; + void startOfCycle() override; + void monitorData(o2::framework::ProcessingContext& ctx) override; + void endOfCycle() override; + void endOfActivity(const Activity& activity) override; + void reset() override; + + private: + o2::tpc::qc::GPUErrorQA mGPUErrorQA; ///< TPC QC class from o2 +}; + +} // namespace o2::quality_control_modules::tpc + +#endif // QC_MODULE_TPC_GPUERRORQA_H diff --git a/Modules/TPC/include/TPC/LinkDef.h b/Modules/TPC/include/TPC/LinkDef.h index ed5a0e9e0d..4c5277a709 100644 --- a/Modules/TPC/include/TPC/LinkDef.h +++ b/Modules/TPC/include/TPC/LinkDef.h @@ -45,6 +45,7 @@ #pragma link C++ class o2::quality_control_modules::tpc::TimeGainCalibReductor + ; #pragma link C++ class o2::quality_control_modules::tpc::DCSPTempReductor + ; #pragma link C++ class o2::quality_control_modules::tpc::AtmosPressureReductor + ; +#pragma link C++ class o2::quality_control_modules::tpc::GPUErrorQA + ; #pragma link C++ function o2::quality_control_modules::tpc::addAndPublish + ; #pragma link C++ function o2::quality_control_modules::tpc::toVector + ; diff --git a/Modules/TPC/run/tpcQCGPUErrorQA_direct.json b/Modules/TPC/run/tpcQCGPUErrorQA_direct.json new file mode 100644 index 0000000000..76861f3c5d --- /dev/null +++ b/Modules/TPC/run/tpcQCGPUErrorQA_direct.json @@ -0,0 +1,38 @@ +{ + "qc": { + "config": { + "database": { + "implementation": "CCDB", + "host": "ccdb-test.cern.ch:8080", + "username": "not_applicable", + "password": "not_applicable", + "name": "not_applicable" + }, + "Activity": {}, + "monitoring": { + "url": "infologger:///debug?qc" + }, + "consul": { + "url": "" + }, + "conditionDB": { + "url": "ccdb-test.cern.ch:8080" + } + }, + "tasks": { + "GPUErrorQA": { + "active": "true", + "className": "o2::quality_control_modules::tpc::GPUErrorQA", + "moduleName": "QcTPC", + "detectorName": "TPC", + "cycleDurationSeconds": "10", + "dataSource": { + "type": "direct", + "query": "error-qa:GPU/ERRORQA/0" + }, + "location": "remote" + } + } + }, + "dataSamplingPolicies": [] +} diff --git a/Modules/TPC/src/GPUErrorQA.cxx b/Modules/TPC/src/GPUErrorQA.cxx new file mode 100644 index 0000000000..af76a60487 --- /dev/null +++ b/Modules/TPC/src/GPUErrorQA.cxx @@ -0,0 +1,72 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// +/// \file GPUErrorQA.cxx +/// \author Anton Riede, anton.riedel@cern.ch +/// + +// root includes +#include + +// O2 includes +#include "Framework/ProcessingContext.h" +#include + +// QC includes +#include "QualityControl/QcInfoLogger.h" +#include "TPC/GPUErrorQA.h" + +namespace o2::quality_control_modules::tpc +{ + +void GPUErrorQA::initialize(o2::framework::InitContext& /*ctx*/) +{ + ILOG(Debug, Devel) << "initialize TPC GPUErrorQA QC task" << ENDM; + mGPUErrorQA.initializeHistograms(); +} + +void GPUErrorQA::startOfActivity(const Activity& /*activity*/) +{ + ILOG(Debug, Support) << "startOfActivity" << ENDM; + mGPUErrorQA.resetHistograms(); +} + +void GPUErrorQA::startOfCycle() +{ + ILOG(Debug, Support) << "startOfCycle" << ENDM; +} + +void GPUErrorQA::monitorData(o2::framework::ProcessingContext& ctx) +{ + ILOG(Debug, Devel) << "monitorData" << ENDM; + auto errors = ctx.inputs().get>>("error-qa"); + mGPUErrorQA.processErrors(errors); +} + +void GPUErrorQA::endOfCycle() +{ + ILOG(Debug, Devel) << "endOfCycle" << ENDM; +} + +void GPUErrorQA::endOfActivity(const Activity& /*activity*/) +{ + ILOG(Debug, Devel) << "endOfActivity" << ENDM; +} + +void GPUErrorQA::reset() +{ + // clean all the monitor objects here + ILOG(Debug, Devel) << "Resetting the histograms" << ENDM; + mGPUErrorQA.resetHistograms(); +} + +} // namespace o2::quality_control_modules::tpc