Skip to content

Commit e456c5c

Browse files
authored
Merge branch 'master' into nvidia_automatic_arrays_acc
2 parents 4d9e3b2 + 30611f0 commit e456c5c

File tree

10 files changed

+54
-14
lines changed

10 files changed

+54
-14
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ def __init__(self):
2121
'arolla:cn', 'arolla:pn', 'tsa:cn', 'tsa:pn']
2222
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',
2323
'PrgEnv-intel', 'PrgEnv-pgi',
24-
'PrgEnv-cray_classic']
24+
'PrgEnv-nvidia']
2525

2626
self.use_multithreading = False
2727

2828
self.prgenv_flags = {
29-
'PrgEnv-cray_classic': ['-homp', '-O3'],
3029
'PrgEnv-cray': ['-fopenmp', '-O3'],
3130
'PrgEnv-gnu': ['-fopenmp', '-O3'],
3231
'PrgEnv-intel': ['-qopenmp', '-O3'],
33-
'PrgEnv-pgi': ['-mp', '-O3']
32+
'PrgEnv-pgi': ['-mp', '-O3'],
33+
'PrgEnv-nvidia': ['-mp', '-O3']
3434
}
3535

3636
if self.current_system.name in ['arolla', 'tsa']:
@@ -64,12 +64,6 @@ def __init__(self):
6464
self.stdout, 'triad', float)
6565
}
6666
self.stream_bw_reference = {
67-
'PrgEnv-cray_classic': {
68-
'daint:gpu': {'triad': (57000, -0.05, None, 'MB/s')},
69-
'daint:mc': {'triad': (117000, -0.05, None, 'MB/s')},
70-
'dom:gpu': {'triad': (57000, -0.05, None, 'MB/s')},
71-
'dom:mc': {'triad': (117000, -0.05, None, 'MB/s')},
72-
},
7367
'PrgEnv-cray': {
7468
'daint:gpu': {'triad': (44000, -0.05, None, 'MB/s')},
7569
'daint:mc': {'triad': (89000, -0.05, None, 'MB/s')},

cscs-checks/microbenchmarks/gpu/hooks.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ def set_gpu_arch(self):
2424
else:
2525
self.modules = ['cdt-cuda/21.05']
2626

27-
if cs == 'dom':
28-
self.modules += ['cudatoolkit/11.1.0_3.39-4.1__g484e319']
29-
3027
elif cs in {'arola', 'tsa'}:
3128
self.gpu_arch = '70'
3229
self.modules = ['cuda/10.1.243']

cscs-checks/prgenv/affinity_check.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
from reframe.core.exceptions import SanityError
1414

1515

16+
def add_prgenv_nvidia(self):
17+
cs = self.current_system.name
18+
if cs in {'daint', 'dom'}:
19+
self.valid_prog_environs += ['PrgEnv-nvidia']
20+
21+
1622
@rfm.simple_test
1723
class CompileAffinityTool(rfm.CompileOnlyRegressionTest):
1824
valid_systems = [
@@ -34,10 +40,21 @@ class CompileAffinityTool(rfm.CompileOnlyRegressionTest):
3440
maintainers = ['RS', 'SK']
3541
tags = {'production', 'scs', 'maintenance', 'craype'}
3642

43+
run_after('init')(bind(add_prgenv_nvidia))
44+
3745
@run_before('compile')
3846
def set_build_opts(self):
3947
self.build_system.options = ['-C affinity', 'MPI=1']
4048

49+
@run_before('compile')
50+
def prgenv_nvidia_workaround(self):
51+
cs = self.current_system.name
52+
ce = self.current_environ.name
53+
if ce == 'PrgEnv-nvidia' and cs == 'dom':
54+
self.build_system.cppflags = [
55+
'-D__GCC_ATOMIC_TEST_AND_SET_TRUEVAL'
56+
]
57+
4158
@run_before('sanity')
4259
def assert_exec_exists(self):
4360
self.sanity_patterns = sn.assert_found(r'affinity', self.stdout)
@@ -106,6 +123,8 @@ class to figure out the processor's topology. The content of this reference
106123
maintainers = ['RS', 'SK']
107124
tags = {'production', 'scs', 'maintenance', 'craype'}
108125

126+
run_after('init')(bind(add_prgenv_nvidia))
127+
109128
@run_after('init')
110129
def set_deps(self):
111130
self.depends_on('CompileAffinityTool')

cscs-checks/prgenv/cuda/cuda_aware_mpi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ def set_valid_prog_environs(self):
4747
def set_compilers(self):
4848
if self.current_environ.name == 'PrgEnv-pgi':
4949
self.build_system.cflags = ['-std=c99', ' -O3']
50+
elif self.current_environ.name == 'PrgEnv-nvidia':
51+
self.variables = {
52+
'CUDA_HOME': '$CRAY_NVIDIA_PREFIX/cuda'
53+
}
5054

5155
gcd_flgs = (
5256
'-gencode arch=compute_{0},code=sm_{0}'.format(self.gpu_arch)

cscs-checks/prgenv/cuda/cuda_samples.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,16 @@ def set_build_options(self):
5353
self.build_system.options = [
5454
f'SMS="{self.gpu_arch}"', f'CUDA_PATH=$CUDA_HOME'
5555
]
56+
cs = self.current_system.name
57+
ce = self.current_environ.name
58+
if cs == 'dom' and ce == 'PrgEnv-nvidia':
59+
cuda_ver = 'v11.3-6-g95b7cea'
60+
else:
61+
cuda_ver = 'v11.0'
62+
5663
self.prebuild_cmds = [
57-
f'git checkout v11.0', f'cd Samples/{self.sample}'
64+
f'git checkout {cuda_ver}',
65+
f'cd Samples/{self.sample}'
5866
]
5967

6068
@run_before('run')

reframe/core/buildsystems.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
class _UndefinedType:
1616
'''Used as an initial value for undefined values instead of None.'''
17+
__slots__ = ()
18+
19+
def __deepcopy__(self, memo):
20+
return self
1721

1822

1923
_Undefined = _UndefinedType()

reframe/core/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class was created or even at the instance level (e.g. doing
243243

244244
blacklist = [
245245
'parameter', 'variable', 'bind', 'run_before', 'run_after',
246-
'require_deps'
246+
'require_deps', 'required'
247247
]
248248
for b in blacklist:
249249
namespace.pop(b, None)

reframe/core/variables.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,11 @@ def extend(self, cls):
493493
if key in self.vars:
494494
self.vars[key].define(value)
495495
_assigned_vars.add(key)
496+
elif value is Undefined:
497+
# Cannot be set as Undefined if not a variable
498+
raise ValueError(
499+
f'{key!r} has not been declared as a variable'
500+
)
496501

497502
# Delete the vars from the class __dict__.
498503
for key in _assigned_vars:

unittests/test_meta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class MyTest(rfm.RegressionTest):
2020
run_before('run')(ext)
2121
run_after('run')(ext)
2222
require_deps(ext)
23+
v = required
2324

2425
def __init__(self):
2526
assert not hasattr(self, 'parameter')
@@ -28,6 +29,7 @@ def __init__(self):
2829
assert not hasattr(self, 'run_before')
2930
assert not hasattr(self, 'run_after')
3031
assert not hasattr(self, 'require_deps')
32+
assert not hasattr(self, 'required')
3133

3234
MyTest()
3335

unittests/test_variables.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ def __init__(self):
170170
MyTest()
171171

172172

173+
def test_required_non_var():
174+
msg = "'not_a_var' has not been declared as a variable"
175+
with pytest.raises(ValueError, match=msg):
176+
class Foo(rfm.RegressionTest):
177+
not_a_var = required
178+
179+
173180
def test_invalid_field():
174181
class Foo:
175182
'''An invalid descriptor'''

0 commit comments

Comments
 (0)