Esempio n. 1
0
 def test_allx(self):
     self.assertTrue(sn.allx([1, 1, 1]))
     self.assertFalse(sn.allx([1, 0]))
     self.assertFalse(sn.allx([]))
     self.assertFalse(sn.allx(i for i in range(0)))
     self.assertTrue(sn.allx(i for i in range(1, 2)))
     with self.assertRaises(TypeError):
         sn.evaluate(sn.allx(None))
Esempio n. 2
0
def test_allx():
    assert sn.allx([1, 1, 1])
    assert not sn.allx([1, 0])
    assert not sn.allx([])
    assert not sn.allx(i for i in range(0))
    assert sn.allx(i for i in range(1, 2))
    with pytest.raises(TypeError):
        sn.evaluate(sn.allx(None))
    def __init__(self, variant):
        super().__init__()
        self.valid_systems = ['daint:gpu']
        self.sourcesdir = os.path.join('../', variant)
        if variant == 'cuda':
            self.valid_prog_environs = ['PrgEnv-gnu']
        elif variant == 'openacc':
            self.valid_prog_environs = ['PrgEnv-pgi']

        if self.current_system.name == 'daint':
            self.modules = ['craype-accel-nvidia60']

        self.executable = './main'
        self.executable_opts = ['256', '256', '100', '0.01']
        self.keep_files = ['output.bin', 'output.bov']
        self.time_limit = (0, 5, 0)
        self.sanity_patterns = sn.allx([
            sn.assert_found(r'Goodbye\!', self.stdout),
            sn.assert_not_found(r'ERROR', self.stdout)
        ])
        self.perf_patterns = {
            'exec_time':
            sn.extractsingle(r'simulation took (\S+) seconds', self.stdout, 1,
                             float),
            'perf':
            sn.extractsingle(r'at rate of (\S+) iters/second', self.stdout, 1,
                             float)
        }
        self.reference = {
            'daint:gpu': {
                'exec_time': (0, None, None, 's'),
                'perf': (0, None, None, 'iters/s')
            },
            '*': {
                'exec_time': (0, None, None, 's'),
                'perf': (0, None, None, 'iters/s')
            }
        }
        self.maintainers = ['karakasis<at>cscs.ch']