Skip to content

Commit 30d4393

Browse files
author
Caspar van Leeuwen
committed
Add initial functionality to schedule test for all EESSI environments in a single run, by configuring ReFrame environments and using ReFrame's own find_modules function
1 parent c7449f0 commit 30d4393

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

eessi/testsuite/common_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ def set_common_required_config(site_configuration: dict, set_memory: bool = True
4242
:param site_configuration: site configuration dictionary
4343
:param set_memory: whether to set memory resources
4444
"""
45-
environments = [{'name': 'default'}]
46-
environs = ['default']
45+
environments = [
46+
{'name': 'EESSI-2023.06', 'modules': ['EESSI/2023.06']},
47+
{'name': 'EESSI-2025.06', 'modules': ['EESSI/2025.06']},
48+
]
49+
environs = ['EESSI-2023.06', 'EESSI-2025.06']
4750
use_nodes_option = True
4851
if set_memory:
4952
resources_memory = [{

eessi/testsuite/eessi_mixin.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from reframe.core.pipeline import RegressionMixin as RegressionTestPlugin
1010
from reframe.utility.sanity import make_performance_function
1111
import reframe.utility.sanity as sn
12+
from reframe.core.runtime import valid_sysenv_comb
1213

1314
from eessi.testsuite import check_process_binding, hooks
1415
from eessi.testsuite.constants import COMPUTE_UNITS, DEVICE_TYPES, SCALES, TAGS
@@ -36,7 +37,7 @@ class EESSI_Mixin(RegressionTestPlugin):
3637
That definition needs to be done 'on time', i.e. early enough in the execution of the ReFrame pipeline.
3738
Here, we list which class attributes must be defined by the child class, and by (the end of) what phase:
3839
39-
- Init phase: device_type, scale, module_name, bench_name
40+
- Init phase: device_type, scale, module_info, bench_name
4041
- Setup phase: compute_unit, required_mem_per_node
4142
4243
The child class may also overwrite the following attributes:
@@ -80,8 +81,8 @@ class EESSI_Mixin(RegressionTestPlugin):
8081

8182
# Note that the error for an empty parameter is a bit unclear for ReFrame 4.6.2, but that will hopefully improve
8283
# see https://github.com/reframe-hpc/reframe/issues/3254
83-
# If that improves: uncomment the following to force the user to set module_name
84-
# module_name = parameter()
84+
# If that improves: uncomment the following to force the user to set module_info
85+
# module_info = parameter()
8586

8687
def __init_subclass__(cls, **kwargs):
8788
" set default values for built-in ReFrame attributes "
@@ -137,7 +138,7 @@ def mark_all_files_readonly(self):
137138
def EESSI_mixin_validate_init(self):
138139
"""Check that all variables that have to be set for subsequent hooks in the init phase have been set"""
139140
# List which variables we will need/use in the run_after('init') hooks
140-
var_list = ['device_type', 'scale', 'module_name', 'measure_memory_usage']
141+
var_list = ['device_type', 'scale', 'module_info', 'measure_memory_usage']
141142
for var in var_list:
142143
if not hasattr(self, var):
143144
msg = "The variable '%s' should be defined in any test class that inherits" % var
@@ -162,8 +163,6 @@ def EESSI_mixin_run_after_init(self):
162163
# Filter on which scales are supported by the partitions defined in the ReFrame configuration
163164
hooks.filter_supported_scales(self)
164165

165-
hooks.set_modules(self)
166-
167166
if self.require_buildenv_module:
168167
hooks.add_buildenv_module(self)
169168

@@ -174,8 +173,24 @@ def EESSI_mixin_run_after_init(self):
174173
err_msg = f"Invalid thread_binding value '{thread_binding}'. Valid values: 'true', 'compact', or 'false'."
175174
raise EESSIError(err_msg)
176175

176+
# Unpack module_info
177+
s, e, m = self.module_info
178+
self.valid_prog_environs = [e]
179+
self.module_name = [m]
180+
181+
# Set modules
182+
hooks.set_modules(self)
183+
184+
# Filter by defice type. E.g. add features based on whether CUDA appears in the module name
177185
hooks.filter_valid_systems_by_device_type(self, required_device_type=self.device_type)
178186

187+
# Check if the partitions returned by find_modules satisfy the current features/extras specified in valid_systems
188+
valid_partitions = [part.fullname for part in valid_sysenv_comb(self.valid_systems, e)]
189+
if s in valid_partitions:
190+
self.valid_systems = [s]
191+
else:
192+
self.valid_systems = []
193+
179194
# Set scales as tags
180195
hooks.set_tag_scale(self)
181196

eessi/testsuite/tests/apps/gromacs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@
3131

3232
import reframe as rfm
3333
from reframe.core.builtins import parameter, run_after # added only to make the linter happy
34+
from reframe.utility import find_modules
3435

3536
from hpctestlib.sciapps.gromacs.benchmarks import gromacs_check
3637

3738
from eessi.testsuite.constants import COMPUTE_UNITS, DEVICE_TYPES, SCALES
3839
from eessi.testsuite.eessi_mixin import EESSI_Mixin
39-
from eessi.testsuite.utils import find_modules, log
40+
from eessi.testsuite.utils import log
4041

4142

4243
class EESSI_GROMACS_base(gromacs_check):
@@ -49,7 +50,7 @@ def set_device_type(self):
4950
class EESSI_GROMACS(EESSI_GROMACS_base, EESSI_Mixin):
5051
scale = parameter(SCALES.keys())
5152
time_limit = '30m'
52-
module_name = parameter(find_modules('GROMACS'))
53+
module_info = parameter(find_modules('GROMACS'))
5354
# input files are downloaded
5455
readonly_files = ['']
5556
# executable_opts in addition to those set by the hpctestlib

eessi/testsuite/tests/apps/numpy/numpy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
import reframe as rfm
1313
import reframe.utility.sanity as sn
1414
from reframe.core.builtins import parameter, run_after, run_before, sanity_function, variable
15+
from reframe.utility import find_modules
1516

1617
from eessi.testsuite.constants import COMPUTE_UNITS, DEVICE_TYPES, SCALES
1718
from eessi.testsuite.eessi_mixin import EESSI_Mixin
18-
from eessi.testsuite.utils import find_modules
1919

2020

2121
@rfm.simple_test
@@ -24,7 +24,7 @@ class EESSI_NumPy(rfm.RunOnlyRegressionTest, EESSI_Mixin):
2424
executable = './np_ops.py'
2525
time_limit = '30m'
2626
readonly_files = ['np_ops.py']
27-
module_name = parameter(find_modules('SciPy-bundle'))
27+
module_info = parameter(find_modules('SciPy-bundle'))
2828
device_type = DEVICE_TYPES.CPU
2929
compute_unit = COMPUTE_UNITS.NODE
3030
scale = parameter([

0 commit comments

Comments
 (0)