From 8a0cb65774b534434b2128e7fe56d688fc63bdb2 Mon Sep 17 00:00:00 2001 From: lietava Date: Thu, 25 Apr 2024 17:53:35 +0200 Subject: [PATCH 1/2] dev: max-input-size option for error or fatal --- .../CTP/workflow/include/CTPWorkflow/RawDecoderSpec.h | 1 + Detectors/CTP/workflow/src/RawDecoderSpec.cxx | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Detectors/CTP/workflow/include/CTPWorkflow/RawDecoderSpec.h b/Detectors/CTP/workflow/include/CTPWorkflow/RawDecoderSpec.h index 239701c83fb93..607491b5cb48a 100644 --- a/Detectors/CTP/workflow/include/CTPWorkflow/RawDecoderSpec.h +++ b/Detectors/CTP/workflow/include/CTPWorkflow/RawDecoderSpec.h @@ -57,6 +57,7 @@ class RawDecoderSpec : public framework::Task bool mDoDigits = true; o2::pmr::vector mOutputDigits; int mMaxInputSize = 0; + bool mMaxInputSizeFatal = 0; // for lumi bool mDoLumi = true; // diff --git a/Detectors/CTP/workflow/src/RawDecoderSpec.cxx b/Detectors/CTP/workflow/src/RawDecoderSpec.cxx index b3c140279e8f1..5a5fef4935d17 100644 --- a/Detectors/CTP/workflow/src/RawDecoderSpec.cxx +++ b/Detectors/CTP/workflow/src/RawDecoderSpec.cxx @@ -41,7 +41,8 @@ void RawDecoderSpec::init(framework::InitContext& ctx) mOutputLumiInfo.inp1 = inp1; mOutputLumiInfo.inp2 = inp2; mMaxInputSize = ctx.options().get("max-input-size"); - LOG(info) << "CTP reco init done. Inputs decoding here:" << decodeinps << " DoLumi:" << mDoLumi << " DoDigits:" << mDoDigits << " NTF:" << mNTFToIntegrate << " Lumi inputs:" << lumiinp1 << ":" << inp1 << " " << lumiinp2 << ":" << inp2 << " Max errors:" << maxerrors << " Max input size:" << mMaxInputSize; + mMaxInputSizeFatal = ctx.options().get("max-input-size-fatal"); + LOG(info) << "CTP reco init done. Inputs decoding here:" << decodeinps << " DoLumi:" << mDoLumi << " DoDigits:" << mDoDigits << " NTF:" << mNTFToIntegrate << " Lumi inputs:" << lumiinp1 << ":" << inp1 << " " << lumiinp2 << ":" << inp2 << " Max errors:" << maxerrors << " Max input size:" << mMaxInputSize << " MaxInputSizeFatal:" << mMaxInputSizeFatal; // mOutputLumiInfo.printInputs(); } void RawDecoderSpec::endOfStream(framework::EndOfStreamContext& ec) @@ -118,7 +119,11 @@ void RawDecoderSpec::run(framework::ProcessingContext& ctx) payloadSize += o2::framework::DataRefUtils::getPayloadSize(ref); } if (payloadSize > (size_t)mMaxInputSize) { - LOG(error) << "Input data size:" << payloadSize; + if(mMaxInputSizeFatal) { + LOG(fatal) << "Input data size:" << payloadSize; + } else { + LOG(error) << "Input data size:" << payloadSize; + } dummyOutput(); return; } @@ -203,5 +208,6 @@ o2::framework::DataProcessorSpec o2::ctp::reco_workflow::getRawDecoderSpec(bool {"lumi-inp2", o2::framework::VariantType::String, "VBA", {"The second input used for online lumi. Name in capital."}}, {"use-verbose-mode", o2::framework::VariantType::Bool, false, {"Verbose logging"}}, {"max-input-size", o2::framework::VariantType::Int, 0, {"Do not process input if bigger than max size, 0 - do not check"}}, + {"max-input-size-fatal", o2::framework::VariantType::Bool, false, {"If true issue fatal error otherwise error on;y"}}, {"ctpinputs-decoding", o2::framework::VariantType::Bool, false, {"Inputs alignment: true - raw decoder - has to be compatible with CTF decoder: allowed options: 10,01,00"}}}}; } From 921c74abe6c97977d106bbca931f8777e7858880 Mon Sep 17 00:00:00 2001 From: lietava Date: Thu, 25 Apr 2024 17:55:20 +0200 Subject: [PATCH 2/2] clang --- Detectors/CTP/workflow/src/RawDecoderSpec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/CTP/workflow/src/RawDecoderSpec.cxx b/Detectors/CTP/workflow/src/RawDecoderSpec.cxx index 5a5fef4935d17..df0988c871196 100644 --- a/Detectors/CTP/workflow/src/RawDecoderSpec.cxx +++ b/Detectors/CTP/workflow/src/RawDecoderSpec.cxx @@ -119,7 +119,7 @@ void RawDecoderSpec::run(framework::ProcessingContext& ctx) payloadSize += o2::framework::DataRefUtils::getPayloadSize(ref); } if (payloadSize > (size_t)mMaxInputSize) { - if(mMaxInputSizeFatal) { + if (mMaxInputSizeFatal) { LOG(fatal) << "Input data size:" << payloadSize; } else { LOG(error) << "Input data size:" << payloadSize;