Skip to content

Commit 8073582

Browse files
committed
DPL: add possibility to disable downscaling of processing reporting by env variable
1 parent 1cfbc1d commit 8073582

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Framework/Core/src/CallbacksPolicy.cxx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
namespace o2::framework
2424
{
2525

26-
static bool checkPrescale(const TimingInfo& info, int prescale, bool startProcessing)
26+
static bool checkPrescale(const TimingInfo& info, int prescale, bool startProcessing, bool noDownscaling)
2727
{
2828
if (prescale <= 1) {
2929
static size_t counter = 0;
3030
static size_t downscaleFactor = 1;
3131
if (startProcessing) {
3232
counter++;
3333
}
34-
if (counter <= 100000) {
34+
if (counter <= 100000 || noDownscaling) {
3535
return true;
3636
}
3737
if (counter > 100000 * downscaleFactor) {
@@ -53,6 +53,11 @@ CallbacksPolicy epnProcessReporting()
5353
if (!prescale) {
5454
prescale = 1;
5555
}
56+
bool noDownscaling = false;
57+
if (getenv("DPL_REPORT_PROCESSING_NO_DOWNSCALING") != nullptr) {
58+
noDownscaling = true;
59+
}
60+
5661
return {
5762
.matcher = [forceReport](DeviceSpec const&, ConfigContext const& context) -> bool {
5863
static bool report = DefaultsHelpers::deploymentMode() == DeploymentMode::OnlineDDS || forceReport;
@@ -61,7 +66,7 @@ CallbacksPolicy epnProcessReporting()
6166
.policy = [prescale](CallbackService& callbacks, InitContext& context) -> void {
6267
callbacks.set<CallbackService::Id::PreProcessing>([prescale](ServiceRegistryRef registry, int op) {
6368
auto& info = registry.get<TimingInfo>();
64-
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, true)) {
69+
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, true, noDownscaling)) {
6570
char const* what = info.isTimer() ? "timer" : "timeslice";
6671
LOGP(info, "Processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}",
6772
what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op);
@@ -70,7 +75,7 @@ CallbacksPolicy epnProcessReporting()
7075
});
7176
callbacks.set<CallbackService::Id::PostProcessing>([prescale](ServiceRegistryRef registry, int op) {
7277
auto& info = registry.get<TimingInfo>();
73-
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, false)) {
78+
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, false, noDownscaling)) {
7479
char const* what = info.isTimer() ? "timer" : "timeslice";
7580
LOGP(info, "Done processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}, wall:{}",
7681
what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op, uv_hrtime() - info.lapse);

0 commit comments

Comments
 (0)