From 21f3d581bdc64e5a7fd6c099a6b4705bcae52c03 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Fri, 23 Jan 2026 16:04:23 +0100 Subject: [PATCH 1/3] workaround to accept string variables. Currently not supported by reframe. Cannot be compared to reference values during perf checks. #296 --- .../benchmarking/reframe/scalability.py | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/scalability.py b/src/feelpp/benchmarking/reframe/scalability.py index ccb1b7d7..7cd3ae3e 100644 --- a/src/feelpp/benchmarking/reframe/scalability.py +++ b/src/feelpp/benchmarking/reframe/scalability.py @@ -1,8 +1,22 @@ import reframe.utility.sanity as sn -import os, re,json +import os, re,json, numbers from feelpp.benchmarking.reframe.config.configReader import TemplateProcessor +class StringNumber(numbers.Number): + def __init__(self, value): self.value = value + def __repr__(self): return str(self.value) + def __str__(self): return str(self.value) + def __float__(self): pass + def __int__(self): pass + def __add__(self, other): return self.value + other + def __radd__(self, other): return other + self.value + def __eq__(self, value): return self.value == value + def __le__(self, other): return self.value + def __lt__(self, other): return self.value + def __ge__(self, other): return self.value + def __gt__(self, other): return self.value + class Extractor: def __init__(self,filepath,stage_name, units): self.filepath = filepath @@ -17,7 +31,14 @@ def _getPerfVars(self,columns,vars): perfvar_name = f"{self.stage_name}_{col}" if self.stage_name else col if nb_rows > 1: perfvar_name = f"{perfvar_name}_{line}" - perf_variables[perfvar_name] = sn.make_performance_function(vars[line][i],unit=self.units.get(col,self.units["*"])) + + val = vars[line][i] + unit = self.units.get(col, self.units["*"]) + + if isinstance(val.evaluate(), str): + val = sn.defer(StringNumber(val.evaluate())) + + perf_variables[perfvar_name] = sn.make_performance_function(val,unit=unit) return perf_variables From e45cad9adb81aecf3e6ccccf5822b91020215588 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Fri, 23 Jan 2026 16:14:05 +0100 Subject: [PATCH 2/3] fix not appearing on report --- src/feelpp/benchmarking/reframe/scalability.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/scalability.py b/src/feelpp/benchmarking/reframe/scalability.py index 7cd3ae3e..dc709592 100644 --- a/src/feelpp/benchmarking/reframe/scalability.py +++ b/src/feelpp/benchmarking/reframe/scalability.py @@ -3,12 +3,16 @@ from feelpp.benchmarking.reframe.config.configReader import TemplateProcessor -class StringNumber(numbers.Number): +class StringNumber(float): + def __new__(cls, value): + obj = float.__new__(cls, float('nan')) + obj.payload = value + return obj def __init__(self, value): self.value = value def __repr__(self): return str(self.value) def __str__(self): return str(self.value) - def __float__(self): pass - def __int__(self): pass + def __float__(self): return str(self.value) + def __int__(self): return str(self.value) def __add__(self, other): return self.value + other def __radd__(self, other): return other + self.value def __eq__(self, value): return self.value == value From e064db94234fbd7af19f945dda2f57d6d75e5525 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Fri, 23 Jan 2026 16:15:06 +0100 Subject: [PATCH 3/3] reinject string payloads to report --- src/feelpp/benchmarking/reframe/regression.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/feelpp/benchmarking/reframe/regression.py b/src/feelpp/benchmarking/reframe/regression.py index 3ed8d769..9762d0bd 100644 --- a/src/feelpp/benchmarking/reframe/regression.py +++ b/src/feelpp/benchmarking/reframe/regression.py @@ -82,6 +82,13 @@ def setPerfVars(self): self.scalability_handler.getCustomPerformanceVariables(self.perf_variables) ) + @run_after('performance') + def restore_string_values(self): + for key, values in self._perfvalues.items(): + val = values[0] + if isinstance(val, float) and hasattr(val, 'payload'): + values[0] = val.payload + @run_before("cleanup") def removeDirectories(self): if self.app_reader.config.scalability and self.app_reader.config.scalability.clean_directory: