Skip to content

Commit 86c9889

Browse files
author
Theofilos Manitaras
committed
Adapt prgenv test to build systems
* Use the new regression test syntax.
1 parent 3cf1113 commit 86c9889

File tree

3 files changed

+32
-49
lines changed

3 files changed

+32
-49
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: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
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):
88
if num_tasks == 1:
9-
check_name = 'openacc_fortran_check'
9+
self.name = 'openacc_fortran_check'
1010
else:
11-
check_name = 'openacc_mpi_fortran_check'
12-
super().__init__(check_name,
13-
os.path.dirname(__file__), **kwargs)
11+
self.name = 'openacc_mpi_fortran_check'
12+
13+
super().__init__()
1414
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
1515
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-pgi']
1616
if self.current_system.name in ['daint', 'dom']:
1717
self.modules = ['craype-accel-nvidia60']
18-
self._pgi_flags = '-acc -ta=tesla:cc60'
18+
self._pgi_flags = ['-acc', '-ta=tesla:cc60']
1919
elif self.current_system.name in ['kesch']:
2020
self.modules = ['craype-accel-nvidia35']
21-
self._pgi_flags = '-acc -ta=tesla:cc35'
21+
self._pgi_flags = ['-acc', '-ta=tesla:cc35']
2222

2323
self.num_tasks = num_tasks
2424
if self.num_tasks == 1:
2525
self.sourcepath = 'vecAdd_openacc.f90'
2626
else:
2727
self.sourcepath = 'vecAdd_openacc_mpi.f90'
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+
self.build_system.fflags = self._pgi_flags
4445

4546
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: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
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-
15+
self.build_system = 'SingleSource'
2016
self.sanity_patterns = sn.all([
2117
sn.assert_found(r'The soft limit is unlimited', self.stdout),
2218
sn.assert_found(r'The hard limit is unlimited', self.stdout),
2319
])
2420

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

0 commit comments

Comments
 (0)