Skip to content
99 changes: 70 additions & 29 deletions cscs-checks/prgenv/environ_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,106 @@ class DefaultPrgEnvCheck(rfm.RunOnlyRegressionTest):
def __init__(self):
self.descr = 'Ensure PrgEnv-cray is loaded by default'
self.valid_prog_environs = ['builtin']
self.valid_systems = ['daint:login', 'dom:login']
self.valid_systems = ['daint:login', 'dom:login', 'eiger:login']
self.executable = 'module'
self.executable_opts = ['list', '-t']
self.maintainers = ['TM', 'CB']
self.tags = {'production', 'craype'}
self.sanity_patterns = sn.assert_found(r'^PrgEnv-cray', self.stderr)

if self.current_system.name == 'eiger':
self.executable_opts = ['list']
prgenv_patt = r'1\) cpe-cray'
else:
self.executable_opts = ['list', '-t']
prgenv_patt = r'^PrgEnv-cray'

self.sanity_patterns = sn.assert_found(prgenv_patt, self.stderr)


@rfm.simple_test
class EnvironmentCheck(rfm.RunOnlyRegressionTest):
def __init__(self):
self.descr = 'Ensure programming environment is loaded correctly'
self.valid_systems = ['daint:login', 'dom:login']
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',
'PrgEnv-intel', 'PrgEnv-pgi']

self.valid_systems = ['daint:login', 'dom:login', 'eiger:login']
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-pgi',
'PrgEnv-intel', 'PrgEnv-aocc']
self.executable = 'module'
self.executable_opts = ['list', '-t']
self.sanity_patterns = sn.assert_found(self.env_module_patt,
self.stderr)
if self.current_system.name == 'eiger':
self.executable_opts = ['list']
else:
self.executable_opts = ['list', '-t']

self.maintainers = ['TM', 'CB']
self.tags = {'production', 'craype'}

@property
@sn.sanity_function
def env_module_patt(self):
return r'^%s' % self.current_environ.name
@rfm.run_before('sanity')
def set_sanity(self):
# NOTE: On eiger, the first module of each programming environment,
# follows the 'cpe-<name>' pattern where <name> corresponds to the
# 'PrgEnv-<name>' used.
if self.current_system.name == 'eiger':
module_patt = rf'1\) cpe-{self.current_environ.name[7:]}'
else:
module_patt = rf'^{self.current_environ.name}'

self.sanity_patterns = sn.assert_found(module_patt, self.stderr)


@rfm.parameterized_test(['cray-fftw'], ['cray-hdf5'], ['cray-hdf5-parallel'],
['cray-libsci'], ['cray-netcdf'],
['cray-netcdf-hdf5parallel'], ['cray-petsc'],
['cray-petsc-64'], ['cray-petsc-complex'],
['cray-petsc-complex-64'], ['cray-python'],
['cray-R'], ['cray-tpsl'], ['cray-tpsl-64'],
['cudatoolkit'], ['gcc'], ['papi'], ['pmi'])
class CrayVariablesCheck(rfm.RunOnlyRegressionTest):
def __init__(self, module_name):
cray_module = parameter()

def __init__(self):
self.descr = 'Check for standard Cray variables'
self.valid_systems = ['daint:login', 'dom:login']
self.valid_prog_environs = ['builtin']
self.executable = 'module'
self.executable_opts = ['show', module_name]
envvar_prefix = module_name.upper().replace('-', '_')
self.executable_opts = ['show', self.cray_module]
envvar_prefix = self.cray_module.upper().replace('-', '_')
self.sanity_patterns = sn.all([
sn.assert_found(f'{envvar_prefix}_PREFIX', self.stderr),
sn.assert_found(f'{envvar_prefix}_VERSION', self.stderr)
])
self.tags = {'production', 'craype'}
self.maintainers = ['EK', 'TM']


@rfm.simple_test
class CrayVariablesCheckDaint(CrayVariablesCheck):
cray_module = parameter([
'cray-fftw', 'cray-hdf5', 'cray-hdf5-parallel', 'cray-libsci',
'cray-mpich', 'cray-netcdf', 'cray-netcdf-hdf5parallel', 'cray-petsc',
'cray-petsc-complex-64', 'cray-python', 'cray-R', 'cray-tpsl',
'cray-tpsl-64', 'cudatoolkit', 'gcc', 'papi', 'pmi'
])

def __init__(self):
super().__init__()
self.valid_systems = ['daint:login', 'dom:login']

# FIXME: These modules should be fixed in later releases,
# while gcc was fixed in 20.11

cdt = osext.cray_cdt_version()
if ((cdt and cdt <= '20.11' and
module_name in ['cray-petsc-complex',
'cray-petsc-complex-64',
'cudatoolkit']) or
self.cray_module in ['cray-petsc-complex',
'cray-petsc-complex-64',
'cudatoolkit']) or
(cdt and cdt < '20.11' and module_name == 'gcc')):
self.valid_systems = []

self.maintainers = ['EK', 'VH']
self.tags = {'production', 'craype'}

@rfm.simple_test
class CrayVariablesCheckEiger(CrayVariablesCheck):
cray_module = parameter([
'cray-fftw', 'cray-hdf5', 'cray-hdf5-parallel', 'cray-libsci',
'cray-mpich', 'cray-openshmemx', 'cray-parallel-netcdf', 'cray-pmi',
'cray-python', 'cray-R', 'gcc', 'papi'
])

def __init__(self):
super().__init__()
self.valid_systems = ['eiger:login']

# FIXME: These modules should be fixed in later releases

if self.cray_module in {'cray-fftw', 'cray-python', 'cray-mpich'}:
self.valid_systems = []