Skip to content

Commit b8802aa

Browse files
authored
Merge pull request #2034 from ajocksch/nvidia_automatic_arrays_acc
[test] Update automatic_arrays_acc
2 parents 497d3fd + ec9875e commit b8802aa

File tree

1 file changed

+51
-36
lines changed

1 file changed

+51
-36
lines changed

cscs-checks/mch/automatic_arrays_acc.py

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,59 +10,51 @@
1010

1111
@rfm.simple_test
1212
class AutomaticArraysCheck(rfm.RegressionTest):
13-
def __init__(self):
14-
self.valid_systems = ['daint:gpu', 'dom:gpu', 'arolla:cn', 'tsa:cn']
15-
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-cce', 'PrgEnv-pgi']
16-
if self.current_system.name in ['daint', 'dom']:
17-
self.modules = ['craype-accel-nvidia60']
18-
elif self.current_system.name in ['arolla', 'tsa']:
13+
valid_systems = ['daint:gpu', 'dom:gpu', 'arolla:cn', 'tsa:cn']
14+
valid_prog_environs = [
15+
'PrgEnv-cray', 'PrgEnv-cce', 'PrgEnv-pgi', 'PrgEnv-nvidia'
16+
]
17+
num_tasks = 1
18+
num_gpus_per_node = 1
19+
num_tasks_per_node = 1
20+
sourcepath = 'automatic_arrays_OpenACC.F90'
21+
build_system = 'SingleSource'
22+
maintainers = ['AJ', 'MKr']
23+
tags = {'production', 'mch', 'craype'}
24+
envname = variable(str)
25+
26+
@run_after('setup')
27+
def set_exclusive_access(self):
28+
if self.current_system.name in ['arolla', 'tsa']:
1929
self.exclusive_access = True
2030

31+
@run_before('compile')
32+
def setflags(self):
2133
# This tets requires an MPI compiler, although it uses a single task
22-
self.num_tasks = 1
23-
self.num_gpus_per_node = 1
24-
self.num_tasks_per_node = 1
25-
self.sourcepath = 'automatic_arrays_OpenACC.F90'
26-
self.build_system = 'SingleSource'
2734
self.build_system.fflags = ['-O2']
28-
self.sanity_patterns = sn.assert_found(r'Result: ', self.stdout)
29-
self.perf_patterns = {
30-
'time': sn.extractsingle(r'Timing:\s+(?P<time>\S+)',
31-
self.stdout, 'time', float)
32-
}
33-
self.arrays_reference = {
34-
'PrgEnv-cray': {
35-
'daint:gpu': {'time': (5.7E-05, None, 0.15, 's')},
36-
'dom:gpu': {'time': (5.7E-05, None, 0.15, 's')},
37-
},
38-
'PrgEnv-pgi': {
39-
'daint:gpu': {'time': (7.5E-05, None, 0.15, 's')},
40-
'dom:gpu': {'time': (7.5e-05, None, 0.15, 's')},
41-
}
42-
}
4335

44-
self.maintainers = ['AJ', 'MKr']
45-
self.tags = {'production', 'mch', 'craype'}
36+
if self.current_system.name in ['daint', 'dom']:
37+
if not self.current_environ.name.startswith('PrgEnv-nvidia'):
38+
self.modules = ['craype-accel-nvidia60']
39+
else:
40+
self.build_system.fflags += ['-acc', '-ta=tesla,cc60',
41+
'-Mnorpath']
4642

47-
@run_before('compile')
48-
def setflags(self):
4943
if self.current_environ.name.startswith('PrgEnv-cray'):
50-
envname = 'PrgEnv-cray'
44+
self.envname = 'PrgEnv-cray'
5145
self.build_system.fflags += ['-hacc', '-hnoomp']
5246
elif self.current_environ.name.startswith('PrgEnv-cce'):
53-
envname = 'PrgEnv-cce'
47+
self.envname = 'PrgEnv-cce'
5448
self.build_system.fflags += ['-hacc', '-hnoomp']
5549
elif self.current_environ.name.startswith('PrgEnv-pgi'):
56-
envname = 'PrgEnv-pgi'
50+
self.envname = 'PrgEnv-pgi'
5751
self.build_system.fflags += ['-acc']
5852
if self.current_system.name in ['arolla', 'tsa']:
5953
self.build_system.fflags += ['-ta=tesla,cc70']
6054
elif self.current_system.name in ['daint', 'dom']:
6155
self.build_system.fflags += ['-ta=tesla,cc60', '-Mnorpath']
6256
else:
63-
envname = self.current_environ.name
64-
65-
self.reference = self.arrays_reference[envname]
57+
self.envname = self.current_environ.name
6658

6759
@run_before('compile')
6860
def cdt2008_pgi_workaround(self):
@@ -72,3 +64,26 @@ def cdt2008_pgi_workaround(self):
7264

7365
if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'):
7466
self.variables.update({'CUDA_HOME': '$CUDATOOLKIT_HOME'})
67+
68+
@run_before('sanity')
69+
def set_sanity_and_perf_patterns(self):
70+
self.sanity_patterns = sn.assert_found(r'Result: ', self.stdout)
71+
self.perf_patterns = {
72+
'time': sn.extractsingle(r'Timing:\s+(?P<time>\S+)',
73+
self.stdout, 'time', float)
74+
}
75+
self.arrays_reference = {
76+
'PrgEnv-cray': {
77+
'daint:gpu': {'time': (5.7E-05, None, 0.15, 's')},
78+
'dom:gpu': {'time': (5.7E-05, None, 0.15, 's')},
79+
},
80+
'PrgEnv-pgi': {
81+
'daint:gpu': {'time': (7.5E-05, None, 0.15, 's')},
82+
'dom:gpu': {'time': (7.5e-05, None, 0.15, 's')},
83+
},
84+
'PrgEnv-nvidia': {
85+
'daint:gpu': {'time': (7.5E-05, None, 0.15, 's')},
86+
'dom:gpu': {'time': (7.5e-05, None, 0.15, 's')},
87+
}
88+
}
89+
self.reference = self.arrays_reference[self.envname]

0 commit comments

Comments
 (0)