Skip to content

Commit 4aba90f

Browse files
committed
Merge branch 'master' of https://github.com/eth-cscs/reframe into bugfix/var_options_type
2 parents c99002a + 8ff8bcb commit 4aba90f

File tree

10 files changed

+71
-20
lines changed

10 files changed

+71
-20
lines changed

cscs-checks/microbenchmarks/cpu/latency/latency.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CPULatencyTest(rfm.RegressionTest):
1212
sourcepath = 'latency.cpp'
1313
build_system = 'SingleSource'
1414
valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc',
15-
'ault:intel', 'ault:amdvega', 'tave:compute']
15+
'ault:intel', 'ault:amdvega', 'eiger:mc', 'pilatus:mc']
1616
valid_prog_environs = ['PrgEnv-gnu']
1717
num_tasks = 0
1818
num_tasks_per_node = 1
@@ -54,11 +54,17 @@ class CPULatencyTest(rfm.RegressionTest):
5454
'latencyL3': (14.4, -0.01, 0.26, 'ns'),
5555
'latencyMem': (90.0, -0.01, 0.05, 'ns')
5656
},
57-
'tave:compute': {
58-
'latencyL1': (2.86, -0.01, 0.05, 'ns'),
59-
'latencyL2': (12.15, -0.01, 0.05, 'ns'),
60-
'latencyL3': (137, -0.01, 0.05, 'ns'),
61-
'latencyMem': (150, -0.05, 0.05, 'ns')
57+
'eiger:mc': {
58+
'latencyL1': (1.19, -0.02, 0.05, 'ns'),
59+
'latencyL2': (3.40, -0.03, 0.05, 'ns'),
60+
'latencyL3': (11.5, -0.05, 0.05, 'ns'),
61+
'latencyMem': (105, -0.05, 0.05, 'ns')
62+
},
63+
'pilatus:mc': {
64+
'latencyL1': (1.19, -0.02, 0.05, 'ns'),
65+
'latencyL2': (3.40, -0.03, 0.05, 'ns'),
66+
'latencyL3': (11.5, -0.05, 0.05, 'ns'),
67+
'latencyMem': (105, -0.05, 0.05, 'ns')
6268
},
6369
}
6470
maintainers = ['SK']
@@ -68,8 +74,6 @@ class CPULatencyTest(rfm.RegressionTest):
6874
def set_modules(self):
6975
if self.current_system.name in {'daint', 'dom'}:
7076
self.modules = ['craype-hugepages1G']
71-
if self.current_system.name in {'tave'}:
72-
self.modules = ['craype-hugepages512M']
7377

7478
@run_before('compile')
7579
def set_flags(self):

docs/regression_test_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ Therefore, classes that derive from the base :class:`~reframe.core.pipeline.Regr
670670
.. automethod:: reframe.core.pipeline.RegressionMixin.variant_name
671671

672672

673-
674673
------------------------
675674
Environments and Systems
676675
------------------------

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ archspec==0.1.3
22
docutils==0.16 # https://github.com/sphinx-doc/sphinx/issues/9001
33
jsonschema==3.2.0
44
semver==2.13.0
5-
Sphinx==4.3.2
5+
Sphinx==4.4.0
66
sphinx-rtd-theme==1.0.0

reframe/core/meta.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,13 +832,12 @@ def fixture_space(cls):
832832
def is_abstract(cls):
833833
'''Check if the class is an abstract test.
834834
835-
This is the case when some parameters are undefined, which results in
836-
the length of the parameter space being 0.
835+
A test is considered abstract if any of its direct or indirect
836+
parameters (inherited from a base class or from a fixture) is
837+
undefined.
837838
838-
:return: bool indicating whether the test or any of its fixtures has
839-
undefined parameters.
839+
:returns: :obj:`True` if the test is abstract, :obj:`False` otherwise.
840840
841-
:meta private:
842841
'''
843842
return cls.num_variants == 0
844843

@@ -908,6 +907,8 @@ class HelloTest(rfm.RunOnlyRegressionTest):
908907
:param kwargs: Any keyword arguments to be passed to the
909908
:class:`RegressionTestMeta` metaclass.
910909
910+
.. versionadded:: 3.10.0
911+
911912
'''
912913
namespace = RegressionTestMeta.__prepare__(name, bases, **kwargs)
913914
namespace.update(body)

reframe/core/pipeline.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,26 @@ def fixture_variant(self):
11661166
'''
11671167
return getattr(self, '_rfm_fixt_variant', None)
11681168

1169+
def set_var_default(self, name, value):
1170+
'''Set the default value of a variable if variable is undefined.
1171+
1172+
A variable is undefined if it is declared and required and no value is
1173+
yet assigned to it.
1174+
1175+
:param name: The name of the variable.
1176+
:param value: The value to set the variable to.
1177+
:raises ValueError: If the variable does not exist
1178+
1179+
.. versionadded:: 3.10.1
1180+
1181+
'''
1182+
var_space = type(self).var_space
1183+
if name not in var_space:
1184+
raise ValueError(f'no such variable: {name!r}')
1185+
1186+
if not var_space[name].is_defined():
1187+
setattr(self, name, value)
1188+
11691189
@property
11701190
def perfvalues(self):
11711191
return util.MappingView(self._perfvalues)

reframe/frontend/executors/policies.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ def on_task_compile_exit(self, task):
579579
pass
580580

581581
def on_task_skip(self, task):
582-
pass
582+
msg = str(task.exc_info[1])
583+
self.printer.status('SKIP', msg, just='right')
583584

584585
def on_task_failure(self, task):
585586
self._num_failed_tasks += 1

reframe/utility/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def _is_valid_for_env(m, e):
678678
for p in current_system.partitions:
679679
for e in p.environs:
680680
rt.loadenv(p.local_env, e)
681-
modules = ms.available_modules(substr)
681+
modules = OrderedSet(ms.available_modules(substr))
682682
snap0.restore()
683683
for m in modules:
684684
if _is_valid_for_env(m, e.name):

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# rfmdocstart: required-packages
22
archspec==0.1.3
3-
argcomplete==1.12.3
3+
argcomplete==2.0.0
44
coverage==6.2
55
importlib_metadata==4.0.1; python_version < '3.8'
66
jsonschema==3.2.0
@@ -9,7 +9,7 @@ pytest==6.2.5
99
pytest-forked==1.4.0
1010
pytest-parallel==0.1.1
1111
PyYAML==6.0
12-
requests==2.26.0
12+
requests==2.27.1
1313
semver==2.13.0
1414
setuptools==59.6.0
1515
wcwidth==0.2.5

unittests/test_pipeline.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,24 @@ def validate(self):
15271527
_run(hello_cls(), *local_exec_ctx)
15281528

15291529

1530+
def test_set_var_default():
1531+
class _X(rfm.RunOnlyRegressionTest):
1532+
foo = variable(int, value=10)
1533+
bar = variable(int)
1534+
1535+
@run_after('init')
1536+
def set_defaults(self):
1537+
self.set_var_default('foo', 100)
1538+
self.set_var_default('bar', 100)
1539+
1540+
with pytest.raises(ValueError):
1541+
self.set_var_default('foobar', 10)
1542+
1543+
x = _X()
1544+
assert x.foo == 10
1545+
assert x.bar == 100
1546+
1547+
15301548
def test_set_name_deprecation():
15311549
from reframe.core.warnings import ReframeDeprecationWarning
15321550

unittests/test_utility.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,16 +1450,24 @@ def user_exec_ctx(request, make_exec_ctx_g):
14501450

14511451

14521452
@pytest.fixture
1453-
def modules_system(user_exec_ctx, monkeypatch):
1453+
def modules_system(user_exec_ctx, monkeypatch, tmp_path):
14541454
# Pretend to be on a clean modules environment
14551455
monkeypatch.setenv('MODULEPATH', '')
14561456
monkeypatch.setenv('LOADEDMODULES', '')
14571457
monkeypatch.setenv('_LMFILES_', '')
14581458

1459+
# Create a symlink to testmod_foo to check for unique module names
1460+
# found by `find_modules`
1461+
(tmp_path / 'testmod_foo').symlink_to(
1462+
os.path.join(test_util.TEST_MODULES, 'testmod_foo')
1463+
)
1464+
14591465
ms = rt.runtime().system.modules_system
1466+
ms.searchpath_add(str(tmp_path))
14601467
ms.searchpath_add(test_util.TEST_MODULES)
14611468
yield ms
14621469
ms.searchpath_remove(test_util.TEST_MODULES)
1470+
ms.searchpath_remove(str(tmp_path))
14631471

14641472

14651473
def test_find_modules(modules_system):

0 commit comments

Comments
 (0)