Skip to content

Commit cbeaeab

Browse files
authored
DPL: add possibility to disable downscaling of processing reporting by env variable (#14656)
1 parent 28eb74a commit cbeaeab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Framework/Core/src/CallbacksPolicy.cxx

Lines changed: 6 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,8 @@ CallbacksPolicy epnProcessReporting()
5353
if (!prescale) {
5454
prescale = 1;
5555
}
56+
static bool noDownscaling = getenv("DPL_REPORT_PROCESSING_NO_DOWNSCALING") != nullptr && std::abs(atoi(getenv("DPL_REPORT_PROCESSING_NO_DOWNSCALING")));
57+
5658
return {
5759
.matcher = [forceReport](DeviceSpec const&, ConfigContext const& context) -> bool {
5860
static bool report = DefaultsHelpers::deploymentMode() == DeploymentMode::OnlineDDS || forceReport;
@@ -61,7 +63,7 @@ CallbacksPolicy epnProcessReporting()
6163
.policy = [prescale](CallbackService& callbacks, InitContext& context) -> void {
6264
callbacks.set<CallbackService::Id::PreProcessing>([prescale](ServiceRegistryRef registry, int op) {
6365
auto& info = registry.get<TimingInfo>();
64-
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, true)) {
66+
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, true, noDownscaling)) {
6567
char const* what = info.isTimer() ? "timer" : "timeslice";
6668
LOGP(info, "Processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}",
6769
what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op);
@@ -70,7 +72,7 @@ CallbacksPolicy epnProcessReporting()
7072
});
7173
callbacks.set<CallbackService::Id::PostProcessing>([prescale](ServiceRegistryRef registry, int op) {
7274
auto& info = registry.get<TimingInfo>();
73-
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, false)) {
75+
if ((int)info.firstTForbit != -1 && checkPrescale(info, prescale, false, noDownscaling)) {
7476
char const* what = info.isTimer() ? "timer" : "timeslice";
7577
LOGP(info, "Done processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}, wall:{}",
7678
what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op, uv_hrtime() - info.lapse);

0 commit comments

Comments
 (0)