Skip to content

Commit ea71866

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

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Framework/Core/src/CallbacksPolicy.cxx

Lines changed: 12 additions & 7 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,24 +53,29 @@ 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;
5964
return report;
6065
},
61-
.policy = [prescale](CallbackService& callbacks, InitContext& context) -> void {
62-
callbacks.set<CallbackService::Id::PreProcessing>([prescale](ServiceRegistryRef registry, int op) {
66+
.policy = [prescale, noDownscaling](CallbackService& callbacks, InitContext& context) -> void {
67+
callbacks.set<CallbackService::Id::PreProcessing>([prescale, noDownscaling](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);
6873
}
6974
info.lapse = uv_hrtime();
7075
});
71-
callbacks.set<CallbackService::Id::PostProcessing>([prescale](ServiceRegistryRef registry, int op) {
76+
callbacks.set<CallbackService::Id::PostProcessing>([prescale, noDownscaling](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)