Skip to content

Commit 80f1e7c

Browse files
committed
DPL / TPC: Fix printing 0xDEADBEEF alarm when using RawPageSequencer
1 parent 7e43d1b commit 80f1e7c

7 files changed

Lines changed: 24 additions & 17 deletions

File tree

Framework/Utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ o2_add_library(DPLUtils
1919
test/DPLBroadcasterMerger.cxx
2020
test/DPLOutputTest.cxx
2121
test/RawPageTestData.cxx
22-
PUBLIC_LINK_LIBRARIES O2::Framework ROOT::Tree ROOT::TreePlayer)
22+
PUBLIC_LINK_LIBRARIES O2::Framework ROOT::Tree ROOT::TreePlayer O2::CommonUtils)
2323

2424
o2_add_executable(raw-proxy
2525
COMPONENT_NAME dpl

Framework/Utils/include/DPLUtils/DPLRawPageSequencer.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,16 @@ class DPLRawPageSequencer
9898
int retVal = 0;
9999
for (auto const& ref : mInput) {
100100
auto size = DataRefUtils::getPayloadSize(ref);
101+
const auto dh = DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
102+
if (dh == nullptr) {
103+
continue;
104+
}
101105
if (size == 0) {
106+
if (dh->subSpecification == 0xDEADBEEF) {
107+
raw_parser::RawParserHelper::warnDeadBeef(dh);
108+
}
102109
continue;
103110
}
104-
const auto dh = DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
105111
auto const pageSize = rawparser_type::max_size;
106112
auto nPages = size / pageSize + (size % pageSize ? 1 : 0);
107113
if (!preCheck(ref.payload, dh->subSpecification)) {

Framework/Utils/include/DPLUtils/RawParser.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#include <stdexcept>
2626
#include <string>
2727
#include <type_traits>
28+
namespace o2::header
29+
{
30+
struct DataHeader;
31+
} // namespace o2::header
2832

2933
// FIXME: probably moved somewhere else
3034
namespace o2::framework
@@ -87,6 +91,7 @@ struct RawParserHelper {
8791
static unsigned long sErrorScale; // Exponentionally downscale verbosity.
8892

8993
static bool checkPrintError(size_t& localCounter);
94+
static void warnDeadBeef(const o2::header::DataHeader* dh);
9095
};
9196

9297
/// @class ConcreteRawParser

Framework/Utils/src/RawParser.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
/// @brief Generic parser for consecutive raw pages
1616

1717
#include "DPLUtils/RawParser.h"
18+
#include "CommonUtils/VerbosityConfig.h"
19+
#include "Headers/DataHeader.h"
1820
#include "fmt/format.h"
1921
#include <iostream>
2022

@@ -40,6 +42,15 @@ bool RawParserHelper::checkPrintError(size_t& localCounter)
4042
return sErrors % sErrorScale == 0;
4143
}
4244

45+
void RawParserHelper::warnDeadBeef(const o2::header::DataHeader* dh)
46+
{
47+
static auto maxWarn = o2::conf::VerbosityConfig::Instance().maxWarnDeadBeef;
48+
static int contDeadBeef = 0;
49+
if (++contDeadBeef <= maxWarn) {
50+
LOGP(alarm, "Found input [{}/{}/0xDEADBEEF] assuming no payload for all links in this TF{}", dh->dataOrigin.as<std::string>(), dh->dataDescription.as<std::string>(), contDeadBeef == maxWarn ? fmt::format(". {} such inputs in row received, stopping reporting", contDeadBeef) : "");
51+
}
52+
}
53+
4354
const char* RDHFormatter<V7>::sFormatString = "{:>5} {:>4} {:>4} {:>4} {:>4} {:>3} {:>3} {:>3} {:>1} {:>2}";
4455
void RDHFormatter<V7>::apply(std::ostream& os, V7 const& header, FormatSpec choice, const char* delimiter)
4556
{

GPU/Workflow/src/GPUWorkflowITS.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
3838
#include "DataFormatsTPC/Digit.h"
3939
#include "TPCFastTransform.h"
40-
#include "DPLUtils/DPLRawParser.h"
41-
#include "DPLUtils/DPLRawPageSequencer.h"
4240
#include "DetectorsBase/MatLayerCylSet.h"
4341
#include "DetectorsBase/Propagator.h"
4442
#include "DetectorsBase/GeometryManager.h"

GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
#include "TRDBase/Geometry.h"
7171
#include "TRDBase/GeometryFlat.h"
7272
#include "ITSBase/GeometryTGeo.h"
73-
#include "CommonUtils/VerbosityConfig.h"
7473
#include "CommonUtils/DebugStreamer.h"
7574
#include "GPUReconstructionConvert.h"
7675
#include "DetectorsRaw/RDHUtils.h"
@@ -413,23 +412,13 @@ void GPURecoWorkflowSpec::processInputs(ProcessingContext& pc, A& tpcZSmetaPoint
413412
(feeLinkID == o2::tpc::rdh_utils::DLBZSLinkID && (rdhLink == o2::tpc::rdh_utils::UserLogicLinkID || rdhLink == o2::tpc::rdh_utils::DLBZSLinkID || rdhLink == 0)));
414413
};
415414
auto insertPages = [&tpcZSmetaPointers, &tpcZSmetaSizes, checkForZSData](const char* ptr, size_t count, uint32_t subSpec) -> void {
416-
if (subSpec == 0xdeadbeef) {
417-
auto maxWarn = o2::conf::VerbosityConfig::Instance().maxWarnDeadBeef;
418-
static int contDeadBeef = 0;
419-
if (++contDeadBeef <= maxWarn) {
420-
LOGP(alarm, "Found input [TPC/RAWDATA/0xdeadbeef] assuming no payload for all links in this TF{}", contDeadBeef == maxWarn ? fmt::format(". {} such inputs in row received, stopping reporting", contDeadBeef) : "");
421-
}
422-
return;
423-
}
424415
if (checkForZSData(ptr, subSpec)) {
425416
int rawcru = o2::tpc::rdh_utils::getCRU(ptr);
426417
int rawendpoint = o2::tpc::rdh_utils::getEndPoint(ptr);
427418
tpcZSmetaPointers[rawcru / 10][(rawcru % 10) * 2 + rawendpoint].emplace_back(ptr);
428419
tpcZSmetaSizes[rawcru / 10][(rawcru % 10) * 2 + rawendpoint].emplace_back(count);
429420
}
430421
};
431-
// the sequencer processes all inputs matching the filter and finds sequences of consecutive
432-
// raw pages based on the matcher predicate, and calls the inserter for each sequence
433422
if (DPLRawPageSequencer(pc.inputs(), filter)(isSameRdh, insertPages, checkForZSData)) {
434423
debugTFDump = true;
435424
static unsigned int nErrors = 0;

GPU/Workflow/src/GPUWorkflowTPC.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
3838
#include "DataFormatsTPC/Digit.h"
3939
#include "TPCFastTransform.h"
40-
#include "DPLUtils/DPLRawParser.h"
41-
#include "DPLUtils/DPLRawPageSequencer.h"
4240
#include "DetectorsBase/MatLayerCylSet.h"
4341
#include "DetectorsBase/Propagator.h"
4442
#include "DetectorsBase/GeometryManager.h"

0 commit comments

Comments
 (0)