33import reframe .utility .sanity as sn
44from reframe .core .pipeline import RegressionTest
55
6-
76class OpenACCFortranCheck (RegressionTest ):
8- def __init__ (self , ** kwargs ):
9- super ().__init__ ('openacc_fortran_check' ,
7+ def __init__ (self , num_tasks , ** kwargs ):
8+ if num_tasks == 1 :
9+ check_name = 'openacc_fortran_check'
10+ else :
11+ check_name = 'openacc_mpi_fortran_check'
12+ super ().__init__ (check_name ,
1013 os .path .dirname (__file__ ), ** kwargs )
1114 self .valid_systems = ['daint:gpu' , 'dom:gpu' , 'kesch:cn' ]
1215 self .valid_prog_environs = ['PrgEnv-cray' , 'PrgEnv-pgi' ]
1316 if self .current_system .name in ['daint' , 'dom' ]:
1417 self .modules = ['craype-accel-nvidia60' ]
15-
16- self .sourcepath = 'vecAdd_openacc.f90'
18+ self ._pgi_flags = '-acc -ta=tesla:cc60'
19+ elif self .current_system .name in ['kesch' ]:
20+ self .modules = ['craype-accel-nvidia35' ]
21+ self ._pgi_flags = '-acc -ta=tesla:cc35'
22+
23+ self .num_tasks = num_tasks
24+ if self .num_tasks == 1 :
25+ self .sourcepath = 'vecAdd_openacc.f90'
26+ else :
27+ self .sourcepath = 'vecAdd_openacc_mpi.f90'
1728 self .num_gpus_per_node = 1
1829 self .executable = self .name
30+ self .num_tasks_per_node = 1
1931
2032 result = sn .extractsingle (r'final result:\s+(?P<result>\d+\.?\d*)' ,
2133 self .stdout , 'result' , float )
@@ -28,10 +40,11 @@ def setup(self, partition, environ, **job_opts):
2840 if environ .name == 'PrgEnv-cray' :
2941 environ .fflags = '-hacc -hnoomp'
3042 elif environ .name == 'PrgEnv-pgi' :
31- environ .fflags = '-acc -ta=tesla:cc60'
43+ environ .fflags = self . _pgi_flags
3244
3345 super ().setup (partition , environ , ** job_opts )
3446
3547
3648def _get_checks (** kwargs ):
37- return [OpenACCFortranCheck (** kwargs )]
49+ return [OpenACCFortranCheck (1 , ** kwargs ),
50+ OpenACCFortranCheck (2 , ** kwargs )]
0 commit comments