77import reframe .utility .sanity as sn
88
99
10- @rfm .parameterized_test ([ 'nompi' ], [ 'mpi' ])
10+ @rfm .simple_test
1111class 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' ]
16-
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- self .build_system .cflags = ['-O2' ]
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' }
23+
24+ @run_before ('performance' )
25+ def set_performance (self ):
2526 self .perf_patterns = {
2627 'fftw_exec_time' : sn .extractsingle (
2728 r'execution time:\s+(?P<exec_time>\S+)' , self .stdout ,
2829 'exec_time' , float ),
2930 }
3031
31- if exec_mode == 'nompi' :
32+ @sanity_function
33+ def found_execution_time (self ):
34+ return sn .assert_eq (
35+ sn .count (sn .findall (r'execution time' , self .stdout )), 1
36+ )
37+
38+ @run_before ('compile' )
39+ def set_cflags (self ):
40+ self .build_system .cflags = ['-O2' ]
41+
42+ @run_after ('init' )
43+ def configure_mode (self ):
44+ if self .exec_mode == 'nompi' :
3245 self .num_tasks = 12
3346 self .executable_opts = ['72 12 1000 0' ]
3447 self .reference = {
@@ -51,5 +64,3 @@ def __init__(self, exec_mode):
5164 },
5265 }
5366
54- self .maintainers = ['AJ' ]
55- self .tags = {'benchmark' , 'scs' , 'craype' }
0 commit comments