Skip to content

Commit 86a7ab6

Browse files
Merge branch 'master' into sanity_slurm_tests
2 parents fc70eaf + d05b850 commit 86a7ab6

File tree

22 files changed

+311
-50
lines changed

22 files changed

+311
-50
lines changed

config/cscs.py

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@
826826
{
827827
'name': 'PrgEnv-pgi-nompi-nocuda',
828828
'target_systems': [
829-
'arolla', 'tsa'
829+
'arolla',
830830
],
831831
'modules': [
832832
'PrgEnv-pgi/19.9-nocuda'
@@ -835,10 +835,22 @@
835835
'cxx': 'pgc++',
836836
'ftn': 'pgf90'
837837
},
838+
{
839+
'name': 'PrgEnv-pgi-nompi-nocuda',
840+
'target_systems': [
841+
'tsa',
842+
],
843+
'modules': [
844+
'PrgEnv-pgi/20.4-nocuda'
845+
],
846+
'cc': 'pgcc',
847+
'cxx': 'pgc++',
848+
'ftn': 'pgf90'
849+
},
838850
{
839851
'name': 'PrgEnv-pgi-nompi',
840852
'target_systems': [
841-
'arolla', 'tsa'
853+
'arolla',
842854
],
843855
'modules': [
844856
'PrgEnv-pgi/19.9'
@@ -847,10 +859,22 @@
847859
'cxx': 'pgc++',
848860
'ftn': 'pgf90'
849861
},
862+
{
863+
'name': 'PrgEnv-pgi-nompi',
864+
'target_systems': [
865+
'tsa',
866+
],
867+
'modules': [
868+
'PrgEnv-pgi/20.4'
869+
],
870+
'cc': 'pgcc',
871+
'cxx': 'pgc++',
872+
'ftn': 'pgf90'
873+
},
850874
{
851875
'name': 'PrgEnv-pgi',
852876
'target_systems': [
853-
'arolla', 'tsa'
877+
'arolla',
854878
],
855879
'modules': [
856880
'PrgEnv-pgi/19.9'
@@ -859,10 +883,22 @@
859883
'cxx': 'mpicxx',
860884
'ftn': 'mpifort'
861885
},
886+
{
887+
'name': 'PrgEnv-pgi',
888+
'target_systems': [
889+
'tsa',
890+
],
891+
'modules': [
892+
'PrgEnv-pgi/20.4'
893+
],
894+
'cc': 'mpicc',
895+
'cxx': 'mpicxx',
896+
'ftn': 'mpifort'
897+
},
862898
{
863899
'name': 'PrgEnv-pgi-nocuda',
864900
'target_systems': [
865-
'arolla', 'tsa'
901+
'arolla',
866902
],
867903
'modules': [
868904
'PrgEnv-pgi/19.9-nocuda'
@@ -871,6 +907,18 @@
871907
'cxx': 'mpicxx',
872908
'ftn': 'mpifort'
873909
},
910+
{
911+
'name': 'PrgEnv-pgi-nocuda',
912+
'target_systems': [
913+
'tsa',
914+
],
915+
'modules': [
916+
'PrgEnv-pgi/20.4-nocuda'
917+
],
918+
'cc': 'mpicc',
919+
'cxx': 'mpicxx',
920+
'ftn': 'mpifort'
921+
},
874922
{
875923
'name': 'PrgEnv-gnu',
876924
'target_systems': [

cscs-checks/apps/pytorch/pytorch_horovod_check.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import reframe as rfm
77
import reframe.utility.sanity as sn
8-
import reframe.utility.osext as osext
98

109

1110
@rfm.parameterized_test(*[[model, mpi_task]
@@ -19,8 +18,7 @@ def __init__(self, model, mpi_task):
1918
self.valid_systems += ['dom:gpu']
2019

2120
self.valid_prog_environs = ['builtin']
22-
cray_cdt_version = osext.cray_cdt_version()
23-
self.modules = [f'Horovod/0.19.5-CrayGNU-{cray_cdt_version}-pt-1.6.0']
21+
self.modules = ['PyTorch']
2422
self.num_tasks_per_node = 1
2523
self.num_cpus_per_task = 12
2624
self.num_tasks = mpi_task

reframe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77
import sys
88

9-
VERSION = '3.6.0-dev.0'
9+
VERSION = '3.6.0-dev.1'
1010
INSTALL_PREFIX = os.path.normpath(
1111
os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
1212
)

reframe/core/decorators.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import traceback
2121

2222
import reframe.utility.osext as osext
23-
from reframe.core.exceptions import ReframeSyntaxError, user_frame
23+
from reframe.core.exceptions import (ReframeSyntaxError,
24+
SkipTestError,
25+
user_frame)
2426
from reframe.core.logging import getlogger
2527
from reframe.core.pipeline import RegressionTest
2628
from reframe.utility.versioning import VersionValidator
@@ -54,12 +56,15 @@ def _instantiate_all():
5456

5557
try:
5658
ret.append(_instantiate(cls, args))
59+
except SkipTestError as e:
60+
getlogger().warning(f'skipping test {cls.__name__!r}: {e}')
5761
except Exception:
5862
frame = user_frame(*sys.exc_info())
59-
msg = "skipping test due to errors: %s: " % cls.__name__
60-
msg += "use `-v' for more information\n"
61-
msg += " FILE: %s:%s" % (frame.filename, frame.lineno)
62-
getlogger().warning(msg)
63+
getlogger().warning(
64+
f"skipping test {cls.__name__!r} due to errors: "
65+
f"use `-v' for more information\n"
66+
f" FILE: {frame.filename}:{frame.lineno}"
67+
)
6368
getlogger().verbose(traceback.format_exc())
6469

6570
return ret

reframe/core/exceptions.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Base regression exceptions
88
#
99

10+
import contextlib
1011
import inspect
1112
import os
1213
import sys
@@ -156,12 +157,23 @@ class ContainerError(ReframeError):
156157
class BuildError(ReframeError):
157158
'''Raised when a build fails.'''
158159

159-
def __init__(self, stdout, stderr):
160+
def __init__(self, stdout, stderr, prefix=None):
160161
super().__init__()
161-
self._message = (
162-
"standard error can be found in `%s', "
163-
"standard output can be found in `%s'" % (stderr, stdout)
164-
)
162+
num_lines = 10
163+
prefix = prefix or '.'
164+
lines = [
165+
f'stdout: {stdout!r}, stderr: {stderr!r}',
166+
f'--- {stderr} (first {num_lines} lines) ---'
167+
]
168+
with contextlib.suppress(OSError):
169+
with open(os.path.join(prefix, stderr)) as fp:
170+
for i, line in enumerate(fp):
171+
if i < num_lines:
172+
# Remove trailing '\n'
173+
lines.append(line[:-1])
174+
175+
lines += [f'--- {stderr} --- ']
176+
self._message = '\n'.join(lines)
165177

166178

167179
class SpawnedProcessError(ReframeError):
@@ -276,6 +288,10 @@ class DependencyError(ReframeError):
276288
'''Raised when a dependency problem is encountered.'''
277289

278290

291+
class SkipTestError(ReframeError):
292+
'''Raised when a test needs to be skipped.'''
293+
294+
279295
def user_frame(exc_type, exc_value, tb):
280296
'''Return a user frame from the exception's traceback.
281297

reframe/core/meta.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def __setitem__(self, key, value):
3232
if isinstance(value, variables.TestVar):
3333
# Insert the attribute in the variable namespace
3434
self['_rfm_local_var_space'][key] = value
35+
value.__set_name__(self, key)
3536

3637
# Override the regular class attribute (if present)
3738
self._namespace.pop(key, None)
@@ -64,9 +65,7 @@ def __getitem__(self, key):
6465
except KeyError as err:
6566
try:
6667
# Handle variable access
67-
v = self['_rfm_local_var_space'][key]
68-
v.__set_name__(self, key)
69-
return v
68+
return self['_rfm_local_var_space'][key]
7069

7170
except KeyError:
7271
# Handle parameter access
@@ -81,12 +80,10 @@ def __getitem__(self, key):
8180
# available in the current class' namespace.
8281
for b in self['_rfm_bases']:
8382
if key in b._rfm_var_space:
84-
v = b._rfm_var_space[key]
85-
v.__set_name__(self, key)
86-
8783
# Store a deep-copy of the variable's
8884
# value and return.
89-
self._namespace[key] = v.default_value
85+
v = b._rfm_var_space[key].default_value
86+
self._namespace[key] = v
9087
return self._namespace[key]
9188

9289
# If 'key' is neither a variable nor a parameter,

reframe/core/parameters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ def filter_params(x):
4646
self.values = tuple(values)
4747
self.filter_params = filter_params
4848

49-
def __set_name__(self, owner, name):
50-
self.name = name
51-
5249

5350
class ParamSpace(namespaces.Namespace):
5451
''' Regression test parameter space

reframe/core/pipeline.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
from reframe.core.containers import ContainerPlatformField
3838
from reframe.core.deferrable import _DeferredExpression
3939
from reframe.core.exceptions import (BuildError, DependencyError,
40-
PipelineError, SanityError,
41-
PerformanceError)
40+
PerformanceError, PipelineError,
41+
SanityError, SkipTestError)
4242
from reframe.core.meta import RegressionTestMeta
4343
from reframe.core.schedulers import Job
4444
from reframe.core.warnings import user_deprecation_warning
@@ -603,7 +603,7 @@ def pipeline_hooks(cls):
603603
#:
604604
#: ::
605605
#:
606-
#: self.sanity_patterns = sn.assert_found(r'.*', self.stdout)
606+
#: self.sanity_patterns = sn.assert_true(1)
607607
sanity_patterns = variable(_DeferredExpression, type(None), value=None)
608608

609609
#: Patterns for verifying the performance of this test.
@@ -1294,7 +1294,8 @@ def compile_wait(self):
12941294

12951295
# We raise a BuildError when we an exit code and it is non zero
12961296
if self._build_job.exitcode:
1297-
raise BuildError(self._build_job.stdout, self._build_job.stderr)
1297+
raise BuildError(self._build_job.stdout,
1298+
self._build_job.stderr, self._stagedir)
12981299

12991300
self.build_system.post_build(self._build_job)
13001301

@@ -1842,6 +1843,26 @@ def getdep(self, target, environ=None, part=None):
18421843
raise DependencyError(f'could not resolve dependency to ({target!r}, '
18431844
f'{part!r}, {environ!r})')
18441845

1846+
def skip(self, msg=None):
1847+
'''Skip test.
1848+
1849+
:arg msg: A message explaining why the test was skipped.
1850+
1851+
.. versionadded:: 3.5.1
1852+
'''
1853+
raise SkipTestError(msg)
1854+
1855+
def skip_if(self, cond, msg=None):
1856+
'''Skip test if condition is true.
1857+
1858+
:arg cond: The condition to check for skipping the test.
1859+
:arg msg: A message explaining why the test was skipped.
1860+
1861+
.. versionadded:: 3.5.1
1862+
'''
1863+
if cond:
1864+
self.skip(msg)
1865+
18451866
def __str__(self):
18461867
return "%s(name='%s', prefix='%s')" % (type(self).__name__,
18471868
self.name, self.prefix)

0 commit comments

Comments
 (0)