diff --git a/cscs-checks/cuda/nvml_check.py b/cscs-checks/cuda/nvml_check.py index 242975f9f5..ec6eb2fa25 100644 --- a/cscs-checks/cuda/nvml_check.py +++ b/cscs-checks/cuda/nvml_check.py @@ -1,30 +1,24 @@ import os +import reframe as rfm import reframe.utility.sanity as sn -from reframe.core.pipeline import RegressionTest -class NvmlCheck(RegressionTest): - def __init__(self, **kwargs): - super().__init__('nvml_check', os.path.dirname(__file__), **kwargs) +@rfm.simple_test +class NvmlCheck(rfm.RegressionTest): + def __init__(self): + super().__init__() self.descr = 'check GPU compute mode' self.valid_systems = ['daint:gpu', 'dom:gpu'] self.valid_prog_environs = ['PrgEnv-gnu'] self.sourcesdir = os.path.join(self.current_system.resourcesdir, 'CUDA', 'nvml') + self.modules = ['craype-accel-nvidia60'] self.sourcepath = 'nvml.c' + self.build_system = 'SingleSource' + self.build_system.ldflags = ['-lnvidia-ml'] self.sanity_patterns = sn.assert_found( r"compute\s+mode\s+'Exclusive Process'", self.stdout) - self.modules = ['cudatoolkit'] self.maintainers = ['AJ', 'VK'] self.tags = {'production'} - - def compile(self): - # Set cc flags - self.current_environ.cflags = '-lnvidia-ml' - super().compile() - - -def _get_checks(**kwargs): - return [NvmlCheck(**kwargs)]