99 from reframe .core .pipeline import RegressionMixin as RegressionTestPlugin
1010from reframe .utility .sanity import make_performance_function
1111import reframe .utility .sanity as sn
12+ from reframe .core .runtime import valid_sysenv_comb
1213
1314from eessi .testsuite import check_process_binding , hooks
1415from 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
0 commit comments