Skip to content
Merged
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
87 changes: 51 additions & 36 deletions cscs-checks/mch/automatic_arrays_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,51 @@

@rfm.simple_test
class AutomaticArraysCheck(rfm.RegressionTest):
def __init__(self):
self.valid_systems = ['daint:gpu', 'dom:gpu', 'arolla:cn', 'tsa:cn']
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-cce', 'PrgEnv-pgi']
if self.current_system.name in ['daint', 'dom']:
self.modules = ['craype-accel-nvidia60']
elif self.current_system.name in ['arolla', 'tsa']:
valid_systems = ['daint:gpu', 'dom:gpu', 'arolla:cn', 'tsa:cn']
valid_prog_environs = [
'PrgEnv-cray', 'PrgEnv-cce', 'PrgEnv-pgi', 'PrgEnv-nvidia'
]
num_tasks = 1
num_gpus_per_node = 1
num_tasks_per_node = 1
sourcepath = 'automatic_arrays_OpenACC.F90'
build_system = 'SingleSource'
maintainers = ['AJ', 'MKr']
tags = {'production', 'mch', 'craype'}
envname = variable(str)

@run_after('setup')
def set_exclusive_access(self):
if self.current_system.name in ['arolla', 'tsa']:
self.exclusive_access = True

@run_before('compile')
def setflags(self):
# This tets requires an MPI compiler, although it uses a single task
self.num_tasks = 1
self.num_gpus_per_node = 1
self.num_tasks_per_node = 1
self.sourcepath = 'automatic_arrays_OpenACC.F90'
self.build_system = 'SingleSource'
self.build_system.fflags = ['-O2']
self.sanity_patterns = sn.assert_found(r'Result: ', self.stdout)
self.perf_patterns = {
'time': sn.extractsingle(r'Timing:\s+(?P<time>\S+)',
self.stdout, 'time', float)
}
self.arrays_reference = {
'PrgEnv-cray': {
'daint:gpu': {'time': (5.7E-05, None, 0.15, 's')},
'dom:gpu': {'time': (5.7E-05, None, 0.15, 's')},
},
'PrgEnv-pgi': {
'daint:gpu': {'time': (7.5E-05, None, 0.15, 's')},
'dom:gpu': {'time': (7.5e-05, None, 0.15, 's')},
}
}

self.maintainers = ['AJ', 'MKr']
self.tags = {'production', 'mch', 'craype'}
if self.current_system.name in ['daint', 'dom']:
if not self.current_environ.name.startswith('PrgEnv-nvidia'):
self.modules = ['craype-accel-nvidia60']
else:
self.build_system.fflags += ['-acc', '-ta=tesla,cc60',
'-Mnorpath']

@run_before('compile')
def setflags(self):
if self.current_environ.name.startswith('PrgEnv-cray'):
envname = 'PrgEnv-cray'
self.envname = 'PrgEnv-cray'
self.build_system.fflags += ['-hacc', '-hnoomp']
elif self.current_environ.name.startswith('PrgEnv-cce'):
envname = 'PrgEnv-cce'
self.envname = 'PrgEnv-cce'
self.build_system.fflags += ['-hacc', '-hnoomp']
elif self.current_environ.name.startswith('PrgEnv-pgi'):
envname = 'PrgEnv-pgi'
self.envname = 'PrgEnv-pgi'
self.build_system.fflags += ['-acc']
if self.current_system.name in ['arolla', 'tsa']:
self.build_system.fflags += ['-ta=tesla,cc70']
elif self.current_system.name in ['daint', 'dom']:
self.build_system.fflags += ['-ta=tesla,cc60', '-Mnorpath']
else:
envname = self.current_environ.name

self.reference = self.arrays_reference[envname]
self.envname = self.current_environ.name

@run_before('compile')
def cdt2008_pgi_workaround(self):
Expand All @@ -72,3 +64,26 @@ def cdt2008_pgi_workaround(self):

if (self.current_environ.name == 'PrgEnv-pgi' and cdt == '20.08'):
self.variables.update({'CUDA_HOME': '$CUDATOOLKIT_HOME'})

@run_before('sanity')
def set_sanity_and_perf_patterns(self):
self.sanity_patterns = sn.assert_found(r'Result: ', self.stdout)
self.perf_patterns = {
'time': sn.extractsingle(r'Timing:\s+(?P<time>\S+)',
self.stdout, 'time', float)
}
self.arrays_reference = {
'PrgEnv-cray': {
'daint:gpu': {'time': (5.7E-05, None, 0.15, 's')},
'dom:gpu': {'time': (5.7E-05, None, 0.15, 's')},
},
'PrgEnv-pgi': {
'daint:gpu': {'time': (7.5E-05, None, 0.15, 's')},
'dom:gpu': {'time': (7.5e-05, None, 0.15, 's')},
},
'PrgEnv-nvidia': {
'daint:gpu': {'time': (7.5E-05, None, 0.15, 's')},
'dom:gpu': {'time': (7.5e-05, None, 0.15, 's')},
}
}
self.reference = self.arrays_reference[self.envname]