From 5d2457a1b5c5379ea73d03f4d19ba8e2eea285e3 Mon Sep 17 00:00:00 2001 From: Jack Morrison Date: Mon, 14 Jul 2025 15:09:11 -0400 Subject: [PATCH 1/2] Print performance variable references only if ref, lower, and upper are all defined Signed-off-by: Jack Morrison --- reframe/frontend/executors/policies.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reframe/frontend/executors/policies.py b/reframe/frontend/executors/policies.py index a6084fec1..d90452b29 100644 --- a/reframe/frontend/executors/policies.py +++ b/reframe/frontend/executors/policies.py @@ -50,7 +50,13 @@ def _print_perf(task): for key, info in perfvars.items(): val, ref, lower, upper, unit, result = info name = key.split(':')[-1] - msg = f'P: {name}: {val} {unit} (r:{ref}, l:{lower}, u:{upper})' + + # Build reference info string only if all three reference value components are defined + if ref is not None and lower is not None and upper is not None: + msg = f'P: {name}: {val} {unit} (r:{ref}, l:{lower}, u:{upper})' + else: + msg = f'P: {name}: {val} {unit}' + if result == 'xfail': msg = color.colorize(msg, color.MAGENTA) elif result == 'fail' or result == 'xpass': From b34fab8c6df90ab37bd74f018910f1c6a391161c Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 11 Nov 2025 22:07:21 +0100 Subject: [PATCH 2/2] Address PR comments --- docs/tutorial.rst | 7 +++++++ reframe/frontend/executors/policies.py | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/tutorial.rst b/docs/tutorial.rst index e7b51f831..aa775883c 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -163,6 +163,13 @@ The :ref:`logging` section article describes how logging can be configured in mo Once a performance test finishes, its figures of merit are printed immediately using the ``P:`` prefix. This can be suppressed by increasing the level at which this information is logged using the :envvar:`RFM_PERF_INFO_LEVEL` environment variable. +.. note:: + + .. versionchanged:: 4.9 + + If the test sets no references, then the reference tuples are not printed in the ``P:`` line. + + .. _run-reports-and-performance-logging: Run reports and performance logging diff --git a/reframe/frontend/executors/policies.py b/reframe/frontend/executors/policies.py index d90452b29..4d0434e5e 100644 --- a/reframe/frontend/executors/policies.py +++ b/reframe/frontend/executors/policies.py @@ -50,13 +50,13 @@ def _print_perf(task): for key, info in perfvars.items(): val, ref, lower, upper, unit, result = info name = key.split(':')[-1] - - # Build reference info string only if all three reference value components are defined - if ref is not None and lower is not None and upper is not None: - msg = f'P: {name}: {val} {unit} (r:{ref}, l:{lower}, u:{upper})' - else: + + # Build reference info string only if reference is defined + if ref == 0 and lower is None and upper is None: msg = f'P: {name}: {val} {unit}' - + else: + msg = f'P: {name}: {val} {unit} (r:{ref}, l:{lower}, u:{upper})' + if result == 'xfail': msg = color.colorize(msg, color.MAGENTA) elif result == 'fail' or result == 'xpass':