Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cscs-checks/libraries/io/hdf5_compile_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
for linkage in ['static', 'dynamic']))
class HDF5Test(rfm.RegressionTest):
def __init__(self, lang, linkage):
super().__init__()
lang_names = {
'c': 'C',
'f90': 'Fortran 90'
Expand All @@ -20,6 +19,7 @@ def __init__(self, lang, linkage):
'PrgEnv-intel', 'PrgEnv-pgi']
self.modules = ['cray-hdf5']
self.keep_files = ['h5dump_out.txt']

# C and Fortran write transposed matrix
if lang == 'c':
self.sanity_patterns = sn.all([
Expand Down
7 changes: 3 additions & 4 deletions cscs-checks/libraries/io/netcdf_compile_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
for linkage in ['dynamic', 'static']))
class NetCDFTest(rfm.RegressionTest):
def __init__(self, lang, linkage):
super().__init__()
lang_names = {
'c': 'C',
'cpp': 'C++',
Expand Down Expand Up @@ -42,7 +41,9 @@ def __init__(self, lang, linkage):
self.maintainers = ['AJ', 'SO']
self.tags = {'production', 'craype', 'external-resources'}

def setup(self, partition, environ, **job_opts):
@rfm.run_before('compile')
def setflags(self):
environ = self.current_environ
if self.current_system.name == 'kesch':
if environ.name == 'PrgEnv-cray-nompi':
self.modules = ['netcdf/4.4.1.1-gmvolf-17.02',
Expand Down Expand Up @@ -83,5 +84,3 @@ def setup(self, partition, environ, **job_opts):
]
else:
self.build_system.ldflags = ['-%s' % self.linkage]

super().setup(partition, environ, **job_opts)
2 changes: 0 additions & 2 deletions cscs-checks/libraries/math/scalapack_compile_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class ScaLAPACKTest(rfm.RegressionTest):
def __init__(self, linkage):
super().__init__()
self.sourcesdir = os.path.join(self.current_system.resourcesdir,
'scalapack')
self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:mc',
Expand All @@ -16,7 +15,6 @@ def __init__(self, linkage):
self.num_tasks = 16
self.num_tasks_per_node = 8
self.variables = {'CRAYPE_LINK_TYPE': linkage}

if self.current_system.name == 'kesch':
self.exclusive_access = True
self.valid_prog_environs = ['PrgEnv-cray']
Expand Down
18 changes: 9 additions & 9 deletions cscs-checks/libraries/petsc/petsc_helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
@rfm.required_version('>=2.14')
@rfm.parameterized_test(['dynamic'], ['static'])
class PetscPoisson2DCheck(rfm.RegressionTest):
def __init__(self, variant):
super().__init__()
def __init__(self, linkage):
self.descr = ('Compile/run PETSc 2D Poisson example with cray-petsc '
'(%s linking)') % variant
'(%s linking)') % linkage
self.valid_systems = ['daint:gpu', 'daint:mc',
'dom:gpu', 'dom:mc', 'tiger:gpu']
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',
'PrgEnv-intel']
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu']
if linkage == 'dynamic':
# FIXME: static compilation yields a link error in case of
# PrgEnv-intel (Cray Bug #255701)
self.valid_prog_environs += ['PrgEnv-intel']

self.sourcepath = 'poisson2d.c'
self.modules = ['cray-petsc']
self.num_tasks = 16
self.num_tasks_per_node = 8
self.build_system = 'SingleSource'
if variant == 'dynamic':
self.build_system.cflags = ['-dynamic']

self.variables = {'CRAYPE_LINK_TYPE': linkage}
self.executable_opts = ['-da_grid_x 4', '-da_grid_y 4', '-ksp_monitor']

# Check the final residual norm for convergence
norm = sn.extractsingle(r'\s+\d+\s+KSP Residual norm\s+(?P<norm>\S+)',
self.stdout, 'norm', float, -1)
self.sanity_patterns = sn.assert_lt(norm, 1.0e-5)

self.tags = {'production', 'craype'}
self.maintainers = ['AJ', 'CB']
83 changes: 44 additions & 39 deletions cscs-checks/prgenv/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class HelloWorldBaseTest(rfm.RegressionTest):
def __init__(self, variant, lang, linkage):
super().__init__()
self.variables = {'CRAYPE_LINK_TYPE': linkage}
self.prgenv_flags = {}
self.lang_names = {
Expand Down Expand Up @@ -36,71 +35,77 @@ def __init__(self, variant, lang, linkage):
self.maintainers = ['VH', 'EK']
self.tags = {'production', 'craype'}

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

num_tasks = sn.getattr(self, 'num_tasks')
num_cpus_per_task = sn.getattr(self, 'num_cpus_per_task')

def tid(match):
return int(match.group(1))

def num_threads(match):
return int(match.group(2))

def rank(match):
return int(match.group(3))

def num_ranks(match):
return int(match.group(4))

self.sanity_patterns = sn.all(
sn.chain([sn.assert_eq(sn.count(result), self.num_tasks *
self.num_cpus_per_task)],
sn.map(
lambda x: sn.assert_lt(int(x.group(1)),
int(x.group(2))),
result),
sn.map(
lambda x: sn.assert_lt(int(x.group(3)),
int(x.group(4))),
result),
sn.map(
lambda x: sn.assert_lt(int(x.group(1)),
self.num_cpus_per_task),
result),
sn.map(
lambda x: sn.assert_eq(int(x.group(2)),
self.num_cpus_per_task),
result),
sn.map(
lambda x: sn.assert_lt(int(x.group(3)),
self.num_tasks),
result),
sn.map(
lambda x: sn.assert_eq(int(x.group(4)),
self.num_tasks),
result),
)
sn.chain(
[sn.assert_eq(sn.count(result), num_tasks*num_cpus_per_task)],
sn.map(lambda x: sn.assert_lt(tid(x), num_threads(x)), result),
sn.map(lambda x: sn.assert_lt(rank(x), num_ranks(x)), result),
sn.map(
lambda x: sn.assert_lt(tid(x), num_cpus_per_task), result
),
sn.map(
lambda x: sn.assert_eq(num_threads(x), num_cpus_per_task),
result
),
sn.map(lambda x: sn.assert_lt(rank(x), num_tasks), result),
sn.map(
lambda x: sn.assert_eq(num_ranks(x), num_tasks), result
),
)
)

self.perf_patterns = {
'compilation_time': sn.getattr(self, 'compilation_time_seconds')
}
self.reference = {
'*': {
'compilation_time': (60, None, 0.1)
'compilation_time': (60, None, 0.1, 's')
}
}

envname = environ.name.replace('-nompi', '')
@rfm.run_before('compile')
def setflags(self):
envname = self.current_environ.name.replace('-nompi', '')
prgenv_flags = self.prgenv_flags[envname]
self.build_system.cflags = prgenv_flags
self.build_system.cxxflags = prgenv_flags
self.build_system.fflags = prgenv_flags
super().setup(partition, environ, **job_opts)

def compile(self):
@rfm.run_before('compile')
def compile_timer_start(self):
self.compilation_time_seconds = datetime.now()
super().compile()
self.compilation_time_seconds = (
datetime.now() - self.compilation_time_seconds).total_seconds()

@rfm.run_after('compile')
def compile_timer_end(self):
elapsed = datetime.now() - self.compilation_time_seconds
self.compilation_time_seconds = elapsed.total_seconds()


@rfm.required_version('>=2.14')
@rfm.parameterized_test(*([lang, linkage]
for lang in ['cpp', 'c', 'f90']
for linkage in ['dynamic', 'static']))
class HelloWorldTestSerial(HelloWorldBaseTest):
def __init__(self, lang, linkage, **kwargs):
super().__init__('serial', lang, linkage, **kwargs)
def __init__(self, lang, linkage):
super().__init__('serial', lang, linkage)
self.valid_systems += ['kesch:pn']
self.sourcepath += '_serial.' + lang
self.descr += ' Serial ' + linkage.capitalize()
Expand Down