Skip to content

Commit a99bd86

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into feat/log-format-rfc3339
2 parents cdf381c + 3f5e97f commit a99bd86

File tree

12 files changed

+609
-74
lines changed

12 files changed

+609
-74
lines changed

cscs-checks/libraries/io/hdf5_compile_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
for linkage in ['static', 'dynamic']))
88
class HDF5Test(rfm.RegressionTest):
99
def __init__(self, lang, linkage):
10-
super().__init__()
1110
lang_names = {
1211
'c': 'C',
1312
'f90': 'Fortran 90'
@@ -20,6 +19,7 @@ def __init__(self, lang, linkage):
2019
'PrgEnv-intel', 'PrgEnv-pgi']
2120
self.modules = ['cray-hdf5']
2221
self.keep_files = ['h5dump_out.txt']
22+
2323
# C and Fortran write transposed matrix
2424
if lang == 'c':
2525
self.sanity_patterns = sn.all([

cscs-checks/libraries/io/netcdf_compile_run.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
for linkage in ['dynamic', 'static']))
1010
class NetCDFTest(rfm.RegressionTest):
1111
def __init__(self, lang, linkage):
12-
super().__init__()
1312
lang_names = {
1413
'c': 'C',
1514
'cpp': 'C++',
@@ -42,7 +41,9 @@ def __init__(self, lang, linkage):
4241
self.maintainers = ['AJ', 'SO']
4342
self.tags = {'production', 'craype', 'external-resources'}
4443

45-
def setup(self, partition, environ, **job_opts):
44+
@rfm.run_before('compile')
45+
def setflags(self):
46+
environ = self.current_environ
4647
if self.current_system.name == 'kesch':
4748
if environ.name == 'PrgEnv-cray-nompi':
4849
self.modules = ['netcdf/4.4.1.1-gmvolf-17.02',
@@ -83,5 +84,3 @@ def setup(self, partition, environ, **job_opts):
8384
]
8485
else:
8586
self.build_system.ldflags = ['-%s' % self.linkage]
86-
87-
super().setup(partition, environ, **job_opts)

cscs-checks/libraries/math/scalapack_compile_run.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class ScaLAPACKTest(rfm.RegressionTest):
88
def __init__(self, linkage):
9-
super().__init__()
109
self.sourcesdir = os.path.join(self.current_system.resourcesdir,
1110
'scalapack')
1211
self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:mc',
@@ -16,7 +15,6 @@ def __init__(self, linkage):
1615
self.num_tasks = 16
1716
self.num_tasks_per_node = 8
1817
self.variables = {'CRAYPE_LINK_TYPE': linkage}
19-
2018
if self.current_system.name == 'kesch':
2119
self.exclusive_access = True
2220
self.valid_prog_environs = ['PrgEnv-cray']

cscs-checks/libraries/math/trilinos_compile_run.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
@rfm.parameterized_test(['static'], ['dynamic'])
77
class TrilinosTest(rfm.RegressionTest):
88
def __init__(self, linkage):
9-
super().__init__()
109
self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc',
1110
'tiger:gpu']
1211
# NOTE: PrgEnv-cray in dynamic does not work because of CrayBug/809265
@@ -38,7 +37,7 @@ def __init__(self, linkage):
3837
self.maintainers = ['AJ', 'CB']
3938
self.tags = {'production', 'craype'}
4039

41-
def setup(self, partition, environ, **job_opts):
42-
prgenv_flags = self.prgenv_flags[environ.name]
43-
self.build_system.cxxflags = prgenv_flags
44-
super().setup(partition, environ, **job_opts)
40+
@rfm.run_before('compile')
41+
def set_cxxflags(self):
42+
flags = self.prgenv_flags[self.current_environ.name]
43+
self.build_system.cxxflags = flags

cscs-checks/libraries/petsc/petsc_helloworld.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
@rfm.required_version('>=2.14')
66
@rfm.parameterized_test(['dynamic'], ['static'])
77
class PetscPoisson2DCheck(rfm.RegressionTest):
8-
def __init__(self, variant):
9-
super().__init__()
8+
def __init__(self, linkage):
109
self.descr = ('Compile/run PETSc 2D Poisson example with cray-petsc '
11-
'(%s linking)') % variant
10+
'(%s linking)') % linkage
1211
self.valid_systems = ['daint:gpu', 'daint:mc',
1312
'dom:gpu', 'dom:mc', 'tiger:gpu']
14-
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',
15-
'PrgEnv-intel']
13+
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu']
14+
if linkage == 'dynamic':
15+
# FIXME: static compilation yields a link error in case of
16+
# PrgEnv-intel (Cray Bug #255701)
17+
self.valid_prog_environs += ['PrgEnv-intel']
18+
1619
self.sourcepath = 'poisson2d.c'
1720
self.modules = ['cray-petsc']
1821
self.num_tasks = 16
1922
self.num_tasks_per_node = 8
2023
self.build_system = 'SingleSource'
21-
if variant == 'dynamic':
22-
self.build_system.cflags = ['-dynamic']
23-
24+
self.variables = {'CRAYPE_LINK_TYPE': linkage}
2425
self.executable_opts = ['-da_grid_x 4', '-da_grid_y 4', '-ksp_monitor']
2526

2627
# Check the final residual norm for convergence
2728
norm = sn.extractsingle(r'\s+\d+\s+KSP Residual norm\s+(?P<norm>\S+)',
2829
self.stdout, 'norm', float, -1)
2930
self.sanity_patterns = sn.assert_lt(norm, 1.0e-5)
30-
3131
self.tags = {'production', 'craype'}
3232
self.maintainers = ['AJ', 'CB']

cscs-checks/mch/g2g_meteoswiss_check.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
@rfm.parameterized_test([1], [2])
66
class G2GMeteoswissTest(rfm.RegressionTest):
77
def __init__(self, g2g):
8-
super().__init__()
98
self.descr = 'G2G Meteoswiss check with G2G=%s' % g2g
109
self.strict_check = False
1110
self.valid_systems = ['kesch:cn']
12-
13-
# FIXME: temporary workaround until the mvapich module is fixed;
14-
# 'PrgEnv-gnu-c2sm-gpu' will be added later
1511
self.valid_prog_environs = ['PrgEnv-gnu']
1612
self.exclusive_access = True
1713
self.modules = ['cmake']

cscs-checks/mch/gpu_direct_cuda.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
@rfm.simple_test
77
class GpuDirectCudaCheck(rfm.RegressionTest):
88
def __init__(self):
9-
super().__init__()
109
self.descr = 'tests gpu-direct for CUDA'
1110
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn', 'tiger:gpu']
12-
# FIXME: temporary workaround until the mvapich module is fixed
13-
# 'PrgEnv-gnu-c2sm-gpu' will be added later
1411
self.valid_prog_environs = ['PrgEnv-gnu']
1512
self.sourcepath = 'gpu_direct_cuda.cu'
1613
self.build_system = 'SingleSource'

cscs-checks/prgenv/helloworld.py

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class HelloWorldBaseTest(rfm.RegressionTest):
88
def __init__(self, variant, lang, linkage):
9-
super().__init__()
109
self.variables = {'CRAYPE_LINK_TYPE': linkage}
1110
self.prgenv_flags = {}
1211
self.lang_names = {
@@ -36,71 +35,77 @@ def __init__(self, variant, lang, linkage):
3635
self.maintainers = ['VH', 'EK']
3736
self.tags = {'production', 'craype'}
3837

39-
def setup(self, partition, environ, **job_opts):
4038
result = sn.findall(r'Hello World from thread \s*(\d+) out '
4139
r'of \s*(\d+) from process \s*(\d+) out of '
4240
r'\s*(\d+)', self.stdout)
4341

42+
num_tasks = sn.getattr(self, 'num_tasks')
43+
num_cpus_per_task = sn.getattr(self, 'num_cpus_per_task')
44+
45+
def tid(match):
46+
return int(match.group(1))
47+
48+
def num_threads(match):
49+
return int(match.group(2))
50+
51+
def rank(match):
52+
return int(match.group(3))
53+
54+
def num_ranks(match):
55+
return int(match.group(4))
56+
4457
self.sanity_patterns = sn.all(
45-
sn.chain([sn.assert_eq(sn.count(result), self.num_tasks *
46-
self.num_cpus_per_task)],
47-
sn.map(
48-
lambda x: sn.assert_lt(int(x.group(1)),
49-
int(x.group(2))),
50-
result),
51-
sn.map(
52-
lambda x: sn.assert_lt(int(x.group(3)),
53-
int(x.group(4))),
54-
result),
55-
sn.map(
56-
lambda x: sn.assert_lt(int(x.group(1)),
57-
self.num_cpus_per_task),
58-
result),
59-
sn.map(
60-
lambda x: sn.assert_eq(int(x.group(2)),
61-
self.num_cpus_per_task),
62-
result),
63-
sn.map(
64-
lambda x: sn.assert_lt(int(x.group(3)),
65-
self.num_tasks),
66-
result),
67-
sn.map(
68-
lambda x: sn.assert_eq(int(x.group(4)),
69-
self.num_tasks),
70-
result),
71-
)
58+
sn.chain(
59+
[sn.assert_eq(sn.count(result), num_tasks*num_cpus_per_task)],
60+
sn.map(lambda x: sn.assert_lt(tid(x), num_threads(x)), result),
61+
sn.map(lambda x: sn.assert_lt(rank(x), num_ranks(x)), result),
62+
sn.map(
63+
lambda x: sn.assert_lt(tid(x), num_cpus_per_task), result
64+
),
65+
sn.map(
66+
lambda x: sn.assert_eq(num_threads(x), num_cpus_per_task),
67+
result
68+
),
69+
sn.map(lambda x: sn.assert_lt(rank(x), num_tasks), result),
70+
sn.map(
71+
lambda x: sn.assert_eq(num_ranks(x), num_tasks), result
72+
),
73+
)
7274
)
73-
7475
self.perf_patterns = {
7576
'compilation_time': sn.getattr(self, 'compilation_time_seconds')
7677
}
7778
self.reference = {
7879
'*': {
79-
'compilation_time': (60, None, 0.1)
80+
'compilation_time': (60, None, 0.1, 's')
8081
}
8182
}
8283

83-
envname = environ.name.replace('-nompi', '')
84+
@rfm.run_before('compile')
85+
def setflags(self):
86+
envname = self.current_environ.name.replace('-nompi', '')
8487
prgenv_flags = self.prgenv_flags[envname]
8588
self.build_system.cflags = prgenv_flags
8689
self.build_system.cxxflags = prgenv_flags
8790
self.build_system.fflags = prgenv_flags
88-
super().setup(partition, environ, **job_opts)
8991

90-
def compile(self):
92+
@rfm.run_before('compile')
93+
def compile_timer_start(self):
9194
self.compilation_time_seconds = datetime.now()
92-
super().compile()
93-
self.compilation_time_seconds = (
94-
datetime.now() - self.compilation_time_seconds).total_seconds()
95+
96+
@rfm.run_after('compile')
97+
def compile_timer_end(self):
98+
elapsed = datetime.now() - self.compilation_time_seconds
99+
self.compilation_time_seconds = elapsed.total_seconds()
95100

96101

97102
@rfm.required_version('>=2.14')
98103
@rfm.parameterized_test(*([lang, linkage]
99104
for lang in ['cpp', 'c', 'f90']
100105
for linkage in ['dynamic', 'static']))
101106
class HelloWorldTestSerial(HelloWorldBaseTest):
102-
def __init__(self, lang, linkage, **kwargs):
103-
super().__init__('serial', lang, linkage, **kwargs)
107+
def __init__(self, lang, linkage):
108+
super().__init__('serial', lang, linkage)
104109
self.valid_systems += ['kesch:pn']
105110
self.sourcepath += '_serial.' + lang
106111
self.descr += ' Serial ' + linkage.capitalize()

cscs-checks/tools/profiling_and_debugging/perftools.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def __init__(self, lang):
2929
self.modules += ['craype-accel-nvidia60']
3030

3131
self.build_system = 'Make'
32-
# NOTE: Restrict concurrency to allow creation of Fortran modules
3332
if lang == 'F90':
33+
# NOTE: Restrict concurrency to allow creation of Fortran modules
3434
self.build_system.max_concurrency = 1
3535

3636
self.prgenv_flags = {
@@ -50,10 +50,6 @@ def __init__(self, lang):
5050
'LIB=-lstdc++']
5151

5252
self.executable = 'jacobi'
53-
# NOTE: Reduce time limit because for PrgEnv-pgi even if the output
54-
# is correct, the batch job uses all the time.
55-
self.time_limit = (0, 5, 0)
56-
5753
self.num_tasks = 3
5854
self.num_tasks_per_node = 3
5955
self.num_cpus_per_task = 4
@@ -94,8 +90,8 @@ def __init__(self, lang):
9490
self.maintainers = ['JG', 'MKr']
9591
self.tags = {'production', 'craype'}
9692

97-
def setup(self, environ, partition, **job_opts):
98-
super().setup(environ, partition, **job_opts)
93+
@rfm.run_before('compile')
94+
def setflags(self):
9995
flags = self.prgenv_flags[self.current_environ.name]
10096
self.build_system.cflags = flags
10197
self.build_system.cxxflags = flags

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
jsonschema
12
pytest>=3.5.0
23
coverage
34
setuptools

0 commit comments

Comments
 (0)