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
58 changes: 27 additions & 31 deletions cscs-checks/tools/profiling_and_debugging/nvprof.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
import os
import reframe as rfm
import reframe.utility.sanity as sn

from reframe.core.pipeline import RegressionTest


class NvprofCheck(RegressionTest):
def __init__(self, **kwargs):
super().__init__('nvprof_check',
os.path.dirname(__file__), **kwargs)
@rfm.simple_test
class NvprofCheck(rfm.RegressionTest):
def __init__(self):
super().__init__()
self.descr = 'Checks the nvprof tool'
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
self.valid_prog_environs = ['PrgEnv-gnu']
self.num_gpus_per_node = 1
self.num_tasks_per_node = 1
self.num_gpus_per_node = 1
self.num_tasks_per_node = 1
self.sourcesdir = 'src/Cuda'
self.executable = 'nvprof'
self.executable_opts = [os.path.join('.', self.name)]
self.executable_opts = ['./nvprof_check']
self.sanity_patterns = sn.all([
sn.assert_found('Profiling application: ./nvprof_check',
'nvprof_check.err'),
sn.assert_found('[CUDA memcpy HtoD]', 'nvprof_check.err'),
sn.assert_found('[CUDA memcpy DtoH]', 'nvprof_check.err'),
sn.assert_found(r'\s+100(\s+\S+){3}\s+jacobi_kernel',
'nvprof_check.err')
self.stderr),
sn.assert_found('[CUDA memcpy HtoD]', self.stderr),
sn.assert_found('[CUDA memcpy DtoH]', self.stderr),
sn.assert_found(r'\s+100(\s+\S+){3}\s+jacobi_kernel', self.stderr)
])
self.modules = ['cudatoolkit']
self.makefile = 'Makefile_nvprof'
self.maintainers = ['MK', 'JG']
self.tags = {'production'}

def compile(self):
self.current_environ.cflags = ('-g -D_CSCS_ITMAX=100'
' -DOMP_MEMLOCALITY -DUSE_MPI'
' -DEVS_PER_NODE=1 -fopenmp -std=c99')
self.current_environ.cxxflags = '-g -G'
self.current_environ.ldflags = '-g -fopenmp -std=c99'
self.build_system = 'Make'
self.build_system.makefile = 'Makefile_nvprof'
self.build_system.cflags = [
'-g', '-D_CSCS_ITMAX=100', '-DOMP_MEMLOCALITY', '-DUSE_MPI',
'-DEVS_PER_NODE=1', '-fopenmp', '-std=c99'
]
self.build_system.cxxflags = ['-g', '-G']
self.build_system.ldflags = ['-g', '-fopenmp', '-std=c99']

# FIXME temporary workaround
# the programming environment should be adapted / fixed
if self.current_system.name == 'kesch':
self.current_environ.ldflags += ' -lcudart -lm'
self.modules = ['cudatoolkit']
self.build_system.ldflags += ['-lcudart', '-lm']
else:
self.modules = ['craype-accel-nvidia60']

super().compile(makefile=self.makefile)


def _get_checks(**kwargs):
return [NvprofCheck(**kwargs)]
self.maintainers = ['MK', 'JG']
self.tags = {'production'}