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
13 changes: 8 additions & 5 deletions cscs-checks/prgenv/gpu_direct_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@

@rfm.simple_test
class GpuDirectAccCheck(rfm.RegressionTest):
def __init__(self, **kwargs):
def __init__(self):
super().__init__()
self.descr = 'tests gpu-direct for Fortran OpenACC'
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
self.valid_prog_environs = ['PrgEnv-cray*', 'PrgEnv-pgi*']
if self.current_system.name in ['daint', 'dom']:
self.modules = ['craype-accel-nvidia60']
self._pgi_flags = '-acc -ta=tesla:cc60 -Mnorpath'
self.variables = {'MPICH_RDMA_ENABLED_CUDA': '1'}
self.num_tasks = 2
self.num_gpus_per_node = 1
self.num_tasks_per_node = 1
elif self.current_system.name in ['kesch']:
self.modules = ['craype-accel-nvidia35']
self._pgi_flags = '-acc -ta=tesla:cc35'
self.variables = {
'MPICH_RDMA_ENABLED_CUDA': '1',
'MV2_USE_CUDA': '1',
Expand All @@ -29,6 +27,7 @@ def __init__(self, **kwargs):
self.num_tasks_per_node = 8

self.sourcepath = 'gpu_direct_acc.F90'
self.build_system = 'SingleSource'
self.sanity_patterns = sn.all([
sn.assert_found(r'GPU with OpenACC', self.stdout),
sn.assert_found(r'Result :\s+OK', self.stdout)
Expand All @@ -39,8 +38,12 @@ def __init__(self, **kwargs):

def setup(self, partition, environ, **job_opts):
if environ.name.startswith('PrgEnv-cray'):
environ.fflags = '-hacc -hnoomp'
self.build_system.fflags = ['-hacc', '-hnoomp']
elif environ.name.startswith('PrgEnv-pgi'):
environ.fflags = self._pgi_flags
self.build_system.fflags = ['-acc']
if self.current_system.name in ['daint', 'dom']:
self.build_system.fflags += ['-ta=tesla:cc60', '-Mnorpath']
elif self.current_system.name == 'kesch':
self.build_system.fflags += ['-ta=tesla:cc35']

super().setup(partition, environ, **job_opts)
31 changes: 11 additions & 20 deletions cscs-checks/prgenv/gpu_direct_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,38 @@

@rfm.simple_test
class GpuDirectCudaCheck(rfm.RegressionTest):
def __init__(self, **kwargs):
def __init__(self):
super().__init__()
self.descr = 'tests gpu-direct for CUDA'
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
self.valid_prog_environs = ['PrgEnv-gnu']
self.sourcepath = 'gpu_direct_cuda.cu'
self.build_system = 'SingleSource'
self.build_system.ldflags = ['-lcublas', '-lcudart']
if self.current_system.name in ['daint', 'dom']:
self.modules = ['craype-accel-nvidia60']
self.variables = {'MPICH_RDMA_ENABLED_CUDA': '1'}
elif self.current_system.name in ['kesch']:
self.build_system.cxxflags = ['-ccbin CC', '-arch=sm_60']
elif self.current_system.name == 'kesch':
self.modules = ['cudatoolkit']
self.valid_prog_environs = ['PrgEnv-gnu-gdr']
self.variables = {
'MPICH_RDMA_ENABLED_CUDA': '1',
'MV2_USE_CUDA': '1',
'G2G': '1',
}
self.build_system.cxxflags = ['-ccbin mpicxx', '-arch=sm_37']

self.num_tasks = 2
self.num_gpus_per_node = 1
self.sourcepath = 'gpu_direct_cuda.cu'
self.num_tasks_per_node = 1
self.modules = ['cudatoolkit']

result = sn.extractsingle(r'Result :\s+(?P<result>\d+\.?\d*)',
self.stdout, 'result', float)
self.sanity_patterns = sn.assert_reference(result, 1., -1e-5, 1e-5)
self.maintainers = ['AJ', 'VK']
self.tags = {'production'}
self.pre_run = [
'export LD_PRELOAD='
'$(pkg-config --variable=libdir mvapich2-gdr)/libmpi.so'
]

def compile(self):
# Set nvcc flags
if self.current_system.name == 'kesch':
nvidia_sm = '37'
cpp_compiler = 'mpicxx'
else:
nvidia_sm = '60'
cpp_compiler = 'CC'

self.current_environ.cxxflags = (
'-ccbin %s -lcublas -lcudart -arch=sm_%s' %
(cpp_compiler, nvidia_sm))
super().compile()
self.maintainers = ['AJ', 'VK']
self.tags = {'production'}