Skip to content

Commit 84a93d5

Browse files
authored
Merge pull request #449 from teojgo/regression_test/prgenv_build_systems
[test] Adapt prgenv test to build systems
2 parents 0d168ad + 18c8877 commit 84a93d5

File tree

3 files changed

+39
-54
lines changed

3 files changed

+39
-54
lines changed

cscs-checks/prgenv/environ_check.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import os
1+
import reframe as rfm
22

3-
from reframe.core.pipeline import RunOnlyRegressionTest
43
from reframe.core.runtime import runtime
54

65

7-
class DefaultPrgEnvCheck(RunOnlyRegressionTest):
8-
def __init__(self, **kwargs):
9-
super().__init__('default_prgenv_check',
10-
os.path.dirname(__file__), **kwargs)
11-
6+
@rfm.simple_test
7+
class DefaultPrgEnvCheck(rfm.RunOnlyRegressionTest):
8+
def __init__(self):
9+
super().__init__()
1210
self.descr = 'Ensure PrgEnv-cray is loaded by default'
1311
self.valid_prog_environs = ['PrgEnv-cray']
1412
self.valid_systems = ['daint:login', 'dom:login']
@@ -37,10 +35,10 @@ def cleanup(self, remove_files=False, unload_env=True):
3735
pass
3836

3937

40-
class EnvironmentCheck(RunOnlyRegressionTest):
41-
def __init__(self, **kwargs):
42-
super().__init__('environ_load_check',
43-
os.path.dirname(__file__), **kwargs)
38+
@rfm.simple_test
39+
class EnvironmentCheck(rfm.RunOnlyRegressionTest):
40+
def __init__(self):
41+
super().__init__()
4442
self.descr = 'Ensure programming environment is loaded correctly'
4543
self.valid_systems = ['daint:login', 'dom:login', 'kesch:login']
4644
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-pgi']
@@ -55,7 +53,3 @@ def __init__(self, **kwargs):
5553
def check_sanity(self):
5654
return runtime().modules_system.is_module_loaded(
5755
self.current_environ.name)
58-
59-
60-
def _get_checks(**kwargs):
61-
return [DefaultPrgEnvCheck(**kwargs), EnvironmentCheck(**kwargs)]
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
1-
import os
2-
1+
import reframe as rfm
32
import reframe.utility.sanity as sn
4-
from reframe.core.pipeline import RegressionTest
53

6-
class OpenACCFortranCheck(RegressionTest):
7-
def __init__(self, num_tasks, **kwargs):
4+
5+
@rfm.parameterized_test([1], [2])
6+
class OpenACCFortranCheck(rfm.RegressionTest):
7+
def __init__(self, num_tasks):
8+
super().__init__()
89
if num_tasks == 1:
9-
check_name = 'openacc_fortran_check'
10+
self.name = 'openacc_fortran_check'
11+
self.descr = 'OpenACC Fortran check'
1012
else:
11-
check_name = 'openacc_mpi_fortran_check'
12-
super().__init__(check_name,
13-
os.path.dirname(__file__), **kwargs)
13+
self.name = 'openacc_mpi_fortran_check'
14+
self.descr = 'OpenACC+MPI Fortran check'
15+
1416
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
1517
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-pgi']
16-
if self.current_system.name in ['daint', 'dom']:
17-
self.modules = ['craype-accel-nvidia60']
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-
2318
self.num_tasks = num_tasks
2419
if self.num_tasks == 1:
2520
self.sourcepath = 'vecAdd_openacc.f90'
2621
else:
2722
self.sourcepath = 'vecAdd_openacc_mpi.f90'
23+
24+
if self.current_system.name in ['daint', 'dom']:
25+
self.modules = ['craype-accel-nvidia60']
26+
elif self.current_system.name == 'kesch':
27+
self.modules = ['craype-accel-nvidia35']
28+
29+
self.build_system = 'SingleSource'
2830
self.num_gpus_per_node = 1
2931
self.executable = self.name
3032
self.num_tasks_per_node = 1
31-
3233
result = sn.extractsingle(r'final result:\s+(?P<result>\d+\.?\d*)',
33-
self.stdout, 'result', float)
34+
self.stdout, 'result', float)
3435
self.sanity_patterns = sn.assert_reference(result, 1., -1e-5, 1e-5)
3536

3637
self.maintainers = ['TM', 'VK']
3738
self.tags = {'production'}
3839

3940
def setup(self, partition, environ, **job_opts):
4041
if environ.name == 'PrgEnv-cray':
41-
environ.fflags = '-hacc -hnoomp'
42+
self.build_system.fflags = ['-hacc', '-hnoomp']
4243
elif environ.name == 'PrgEnv-pgi':
43-
environ.fflags = self._pgi_flags
44+
if self.current_system.name in ['daint', 'dom']:
45+
self.build_system.fflags = ['-acc', '-ta=tesla:cc60']
46+
else:
47+
self.build_system.fflags = ['-acc', '-ta=tesla:cc35']
4448

4549
super().setup(partition, environ, **job_opts)
46-
47-
48-
def _get_checks(**kwargs):
49-
return [OpenACCFortranCheck(1, **kwargs),
50-
OpenACCFortranCheck(2, **kwargs)]

cscs-checks/prgenv/ulimit_check.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
1-
import os
2-
1+
import reframe as rfm
32
import reframe.utility.sanity as sn
4-
from reframe.core.pipeline import RegressionTest
5-
63

7-
class UlimitCheck(RegressionTest):
84

9-
def __init__(self, **kwargs):
10-
super().__init__('ulimit_check', os.path.dirname(__file__), **kwargs)
5+
@rfm.simple_test
6+
class UlimitCheck(rfm.RegressionTest):
7+
def __init__(self):
8+
super().__init__()
119
self.descr = 'Checking the output of ulimit -s in node.'
12-
1310
self.valid_systems = ['daint:gpu', 'daint:mc',
1411
'dom:gpu', 'dom:mc']
1512
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',
1613
'PrgEnv-intel', 'PrgEnv-pgi']
1714
self.sourcepath = 'ulimit.c'
18-
self.tags = {'production', 'scs'}
19-
2015
self.sanity_patterns = sn.all([
2116
sn.assert_found(r'The soft limit is unlimited', self.stdout),
2217
sn.assert_found(r'The hard limit is unlimited', self.stdout),
2318
])
2419

2520
self.maintainers = ['RS', 'VK']
26-
27-
28-
def _get_checks(**kwargs):
29-
return [UlimitCheck(**kwargs)]
21+
self.tags = {'production', 'scs'}

0 commit comments

Comments
 (0)