Skip to content

Commit 487c3fa

Browse files
author
Vasileios Karakasis
authored
Merge pull request #2151 from ekouts/test/fftw_new_syntax
[test] Modernize FFTW test
2 parents 78e7ce2 + cc67d00 commit 487c3fa

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,40 @@
77
import reframe.utility.sanity as sn
88

99

10-
@rfm.parameterized_test(['nompi'], ['mpi'])
10+
@rfm.simple_test
1111
class FFTWTest(rfm.RegressionTest):
12-
def __init__(self, exec_mode):
13-
self.sourcepath = 'fftw_benchmark.c'
14-
self.build_system = 'SingleSource'
15-
self.valid_systems = ['daint:gpu', 'dom:gpu']
12+
exec_mode = parameter(['nompi', 'mpi'])
13+
sourcepath = 'fftw_benchmark.c'
14+
build_system = 'SingleSource'
15+
valid_systems = ['daint:gpu', 'dom:gpu']
16+
# Cray FFTW library is not officially supported for the PGI
17+
valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu']
18+
modules = ['cray-fftw']
19+
num_tasks_per_node = 12
20+
num_gpus_per_node = 0
21+
maintainers = ['AJ']
22+
tags = {'benchmark', 'scs', 'craype'}
1623

17-
# Cray FFTW library is not officially supported for the PGI
18-
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu']
19-
self.modules = ['cray-fftw']
20-
self.num_tasks_per_node = 12
21-
self.num_gpus_per_node = 0
22-
self.sanity_patterns = sn.assert_eq(
23-
sn.count(sn.findall(r'execution time', self.stdout)), 1)
24+
@performance_function('s')
25+
def fftw_exec_time(self):
26+
return sn.extractsingle(
27+
r'execution time:\s+(?P<exec_time>\S+)', self.stdout,
28+
'exec_time', float
29+
)
30+
31+
@sanity_function
32+
def assert_finished(self):
33+
return sn.assert_eq(
34+
sn.count(sn.findall(r'execution time', self.stdout)), 1
35+
)
36+
37+
@run_before('compile')
38+
def set_cflags(self):
2439
self.build_system.cflags = ['-O2']
25-
self.perf_patterns = {
26-
'fftw_exec_time': sn.extractsingle(
27-
r'execution time:\s+(?P<exec_time>\S+)', self.stdout,
28-
'exec_time', float),
29-
}
3040

31-
if exec_mode == 'nompi':
41+
@run_before('run')
42+
def configure_exec_mode(self):
43+
if self.exec_mode == 'nompi':
3244
self.num_tasks = 12
3345
self.executable_opts = ['72 12 1000 0']
3446
self.reference = {
@@ -50,6 +62,3 @@ def __init__(self, exec_mode):
5062
'fftw_exec_time': (0.47, None, 0.50, 's'),
5163
},
5264
}
53-
54-
self.maintainers = ['AJ']
55-
self.tags = {'benchmark', 'scs', 'craype'}

0 commit comments

Comments
 (0)