From 28fe6ae21668cf2d2d768c6cf373b650d3efdbc8 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 5 May 2026 16:26:02 +0200 Subject: [PATCH 1/4] Migrated MetalWalls to EESSI_Mixin --- eessi/testsuite/tests/apps/MetalWalls.py | 83 ++++++------------------ 1 file changed, 19 insertions(+), 64 deletions(-) diff --git a/eessi/testsuite/tests/apps/MetalWalls.py b/eessi/testsuite/tests/apps/MetalWalls.py index b3f45d18..21adb016 100644 --- a/eessi/testsuite/tests/apps/MetalWalls.py +++ b/eessi/testsuite/tests/apps/MetalWalls.py @@ -32,59 +32,50 @@ from reframe.core.parameters import TestParam as parameter from eessi.testsuite import hooks +from eessi.testsuite.eessi_mixin import EESSI_Mixin from eessi.testsuite.constants import COMPUTE_UNITS, DEVICE_TYPES, SCALES, TAGS from eessi.testsuite.hpctestlib.sciapps.metalwalls.benchmarks import MetalWallsCheck from eessi.testsuite.utils import find_modules, log @rfm.simple_test -class EESSI_MetalWalls_MW(MetalWallsCheck): +class EESSI_MetalWalls_MW(MetalWallsCheck, EESSI_Mixin): """MetalWalls benchmark tests. `MetalWalls `__ """ - scale = parameter(SCALES.keys()) - - valid_systems = ['*'] - valid_prog_environs = ['default'] - time_limit = '60m' # input files are downloaded readonly_files = [''] module_name = parameter(find_modules('MetalWalls')) # For now, MetalWalls is being build for CPU targets only # compute_device = parameter([DEVICE_TYPES.CPU, DEVICE_TYPES.GPU]) - compute_device = parameter([DEVICE_TYPES.CPU]) - num_tasks_per_compute_unit = 1 - used_cpus_per_task = None + device_type = parameter([DEVICE_TYPES.CPU]) + + def required_mem_per_node(self): + mem_per_task = 0.4 + if self.benchmark_info[0] == 'hackathonGPU/benchmark5': + mem_per_task = 1.2 + return self.num_tasks_per_node * mem_per_task + 2 @run_after('init') def run_after_init(self): """Hooks to run after the init phase""" - - # Filter on which scales are supported by the partitions defined in the ReFrame configuration - hooks.filter_supported_scales(self) - - # Support selecting modules on the cmd line. - hooks.set_modules(self) - - # Make sure that GPU tests run in partitions that support running on a GPU, - # and that CPU-only tests run in partitions that support running CPU-only. - # Also support setting valid_systems on the cmd line. - hooks.filter_valid_systems_by_device_type(self, required_device_type=self.compute_device) - - # Make sure the test is not run on offline partitions - hooks.filter_valid_systems_for_offline_partitions(self) - - # Support selecting scales on the cmd line via tags. - hooks.set_tag_scale(self) + # Launch 1 task per CPU (when run on CPUs) or 1 task per GPU (when run on GPUs) + if self.device_type == DEVICE_TYPES.CPU: + self.compute_unit = COMPUTE_UNITS.CPU + elif self.device_type == DEVICE_TYPES.GPU: + self.compute_unit = COMPUTE_UNITS.GPU + else: + raise NotImplementedError( + f"Compute unit {compute_unit} was not implement for test {self.name}" + ) @run_after('init') def set_tag_ci(self): """Set tag CI on smallest benchmark, so it can be selected on the cmd line via --tag CI""" if self.benchmark_info[0] == 'hackathonGPU/benchmark': - self.tags.add(TAGS.CI) - log(f'tags set to {self.tags}') + self.is_ci_test = True @run_after('init') def set_increased_walltime(self): @@ -94,34 +85,6 @@ def set_increased_walltime(self): if self.num_tasks <= 4 and self.benchmark_info[0] in large_benchmarks: self.time_limit = '120m' - @run_after('setup') - def run_after_setup(self): - """Hooks to run after the setup phase""" - - # Calculate default requested resources based on the scale: - # 1 task per CPU for CPU-only tests, 1 task per GPU for GPU tests. - # Also support setting the resources on the cmd line. - if self.compute_device == DEVICE_TYPES.GPU: - self.compute_unit = COMPUTE_UNITS.GPU - hooks.assign_tasks_per_compute_unit(test=self) - else: - self.compute_unit = COMPUTE_UNITS.CPU - hooks.assign_tasks_per_compute_unit(test=self) - - @run_after('setup') - def set_binding(self): - """Set binding to compact to improve performance reproducibility.""" - hooks.set_compact_process_binding(self) - - @run_after('setup') - def request_mem(self): - """Request memory per node based on the benchmark.""" - mem_per_task = 0.4 - if self.benchmark_info[0] == 'hackathonGPU/benchmark5': - mem_per_task = 1.2 - memory_required = self.num_tasks_per_node * mem_per_task + 2 - hooks.req_memory_per_node(test=self, app_mem_req=memory_required * 1024) - @run_after('setup') def skip_max_corecnt(self): """Skip tests if number of tasks per node exceeds maximum core count.""" @@ -131,11 +94,3 @@ def skip_max_corecnt(self): self.num_tasks > max_task_cnt, f'Number of tasks {self.num_tasks} exceeds maximum task count {max_task_cnt} for {bench_name}' ) - - @run_after('setup') - def set_omp_num_threads(self): - """ - Set number of OpenMP threads via OMP_NUM_THREADS. - Set default number of OpenMP threads equal to number of CPUs per task. - """ - hooks.set_omp_num_threads(self) From a7c309f4093582a8b5d977b1a3de9be628a90c50 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 5 May 2026 16:45:07 +0200 Subject: [PATCH 2/4] Fix linting issues --- eessi/testsuite/tests/apps/MetalWalls.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eessi/testsuite/tests/apps/MetalWalls.py b/eessi/testsuite/tests/apps/MetalWalls.py index 21adb016..4ffe0416 100644 --- a/eessi/testsuite/tests/apps/MetalWalls.py +++ b/eessi/testsuite/tests/apps/MetalWalls.py @@ -31,11 +31,10 @@ from reframe.core.builtins import run_after from reframe.core.parameters import TestParam as parameter -from eessi.testsuite import hooks from eessi.testsuite.eessi_mixin import EESSI_Mixin -from eessi.testsuite.constants import COMPUTE_UNITS, DEVICE_TYPES, SCALES, TAGS +from eessi.testsuite.constants import COMPUTE_UNITS, DEVICE_TYPES from eessi.testsuite.hpctestlib.sciapps.metalwalls.benchmarks import MetalWallsCheck -from eessi.testsuite.utils import find_modules, log +from eessi.testsuite.utils import find_modules @rfm.simple_test @@ -68,7 +67,7 @@ def run_after_init(self): self.compute_unit = COMPUTE_UNITS.GPU else: raise NotImplementedError( - f"Compute unit {compute_unit} was not implement for test {self.name}" + f"Compute unit {self.compute_unit} was not implement for test {self.name}" ) @run_after('init') From 0dc7792a8f2f21e5ba9180b986c3c1b0e4bc92c2 Mon Sep 17 00:00:00 2001 From: Sam Moors Date: Tue, 5 May 2026 16:59:07 +0200 Subject: [PATCH 3/4] fix typo --- eessi/testsuite/tests/apps/MetalWalls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eessi/testsuite/tests/apps/MetalWalls.py b/eessi/testsuite/tests/apps/MetalWalls.py index 4ffe0416..3b52d6ae 100644 --- a/eessi/testsuite/tests/apps/MetalWalls.py +++ b/eessi/testsuite/tests/apps/MetalWalls.py @@ -67,7 +67,7 @@ def run_after_init(self): self.compute_unit = COMPUTE_UNITS.GPU else: raise NotImplementedError( - f"Compute unit {self.compute_unit} was not implement for test {self.name}" + f"Compute unit {self.compute_unit} was not implemented for test {self.name}" ) @run_after('init') From f5a19bd1be27eb6bc23f6757817953102f638499 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> Date: Tue, 5 May 2026 20:28:55 +0200 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Sam Moors --- eessi/testsuite/tests/apps/MetalWalls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eessi/testsuite/tests/apps/MetalWalls.py b/eessi/testsuite/tests/apps/MetalWalls.py index 3b52d6ae..cd648a3a 100644 --- a/eessi/testsuite/tests/apps/MetalWalls.py +++ b/eessi/testsuite/tests/apps/MetalWalls.py @@ -67,7 +67,7 @@ def run_after_init(self): self.compute_unit = COMPUTE_UNITS.GPU else: raise NotImplementedError( - f"Compute unit {self.compute_unit} was not implemented for test {self.name}" + f"Device type {self.device_type} was not implemented for test {self.name}" ) @run_after('init')