|
9 | 9 |
|
10 | 10 | @rfm.simple_test |
11 | 11 | class CPULatencyTest(rfm.RegressionTest): |
12 | | - def __init__(self): |
13 | | - self.sourcepath = 'latency.cpp' |
14 | | - self.build_system = 'SingleSource' |
15 | | - self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc', |
16 | | - 'ault:intel', 'ault:amdvega', 'tave:compute'] |
17 | | - self.valid_prog_environs = ['PrgEnv-gnu'] |
18 | | - self.num_tasks = 0 |
19 | | - self.num_tasks_per_node = 1 |
20 | | - |
21 | | - self.build_system.cxxflags = ['-O3'] |
22 | | - |
23 | | - self.executable_opts = ['16000', '128000', '8000000', '500000000'] |
| 12 | + sourcepath = 'latency.cpp' |
| 13 | + build_system = 'SingleSource' |
| 14 | + valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc', |
| 15 | + 'ault:intel', 'ault:amdvega', 'tave:compute'] |
| 16 | + valid_prog_environs = ['PrgEnv-gnu'] |
| 17 | + num_tasks = 0 |
| 18 | + num_tasks_per_node = 1 |
| 19 | + executable_opts = ['16000', '128000', '8000000', '500000000'] |
| 20 | + reference = { |
| 21 | + 'dom:mc': { |
| 22 | + 'latencyL1': (1.21, -0.01, 0.26, 'ns'), |
| 23 | + 'latencyL2': (3.65, -0.01, 0.26, 'ns'), |
| 24 | + 'latencyL3': (18.83, -0.01, 0.05, 'ns'), |
| 25 | + 'latencyMem': (76.6, -0.01, 0.05, 'ns') |
| 26 | + }, |
| 27 | + 'dom:gpu': { |
| 28 | + 'latencyL1': (1.14, -0.01, 0.26, 'ns'), |
| 29 | + 'latencyL2': (3.44, -0.01, 0.26, 'ns'), |
| 30 | + 'latencyL3': (15.65, -0.01, 0.05, 'ns'), |
| 31 | + 'latencyMem': (71.7, -0.01, 0.05, 'ns') |
| 32 | + }, |
| 33 | + 'daint:mc': { |
| 34 | + 'latencyL1': (1.21, -0.01, 0.26, 'ns'), |
| 35 | + 'latencyL2': (3.65, -0.01, 0.26, 'ns'), |
| 36 | + 'latencyL3': (18.83, -0.01, 0.05, 'ns'), |
| 37 | + 'latencyMem': (76.6, -0.01, 0.05, 'ns') |
| 38 | + }, |
| 39 | + 'daint:gpu': { |
| 40 | + 'latencyL1': (1.14, -0.01, 0.26, 'ns'), |
| 41 | + 'latencyL2': (3.44, -0.01, 0.26, 'ns'), |
| 42 | + 'latencyL3': (15.65, -0.01, 0.05, 'ns'), |
| 43 | + 'latencyMem': (71.7, -0.01, 0.05, 'ns') |
| 44 | + }, |
| 45 | + 'ault:intel': { |
| 46 | + 'latencyL1': (1.08, -0.01, 0.26, 'ns'), |
| 47 | + 'latencyL2': (3.8, -0.01, 0.26, 'ns'), |
| 48 | + 'latencyL3': (21.5, -0.01, 0.05, 'ns'), |
| 49 | + 'latencyMem': (86.5, -0.01, 0.05, 'ns') |
| 50 | + }, |
| 51 | + 'ault:amdvega': { |
| 52 | + 'latencyL1': (1.32, -0.01, 0.26, 'ns'), |
| 53 | + 'latencyL2': (4.02, -0.01, 0.26, 'ns'), |
| 54 | + 'latencyL3': (14.4, -0.01, 0.26, 'ns'), |
| 55 | + 'latencyMem': (90.0, -0.01, 0.05, 'ns') |
| 56 | + }, |
| 57 | + 'tave:compute': { |
| 58 | + 'latencyL1': (2.86, -0.01, 0.05, 'ns'), |
| 59 | + 'latencyL2': (12.15, -0.01, 0.05, 'ns'), |
| 60 | + 'latencyL3': (137, -0.01, 0.05, 'ns'), |
| 61 | + 'latencyMem': (150, -0.05, 0.05, 'ns') |
| 62 | + }, |
| 63 | + } |
| 64 | + maintainers = ['SK'] |
| 65 | + tags = {'benchmark', 'diagnostic'} |
24 | 66 |
|
| 67 | + @run_after('init') |
| 68 | + def set_modules(self): |
25 | 69 | if self.current_system.name in {'daint', 'dom'}: |
26 | 70 | self.modules = ['craype-hugepages1G'] |
27 | 71 | if self.current_system.name in {'tave'}: |
28 | 72 | self.modules = ['craype-hugepages512M'] |
29 | 73 |
|
30 | | - self.sanity_patterns = sn.assert_eq( |
| 74 | + @run_before('compile') |
| 75 | + def set_flags(self): |
| 76 | + self.build_system.cxxflags = ['-O3'] |
| 77 | + |
| 78 | + @sanity_function |
| 79 | + def assert_success(self): |
| 80 | + return sn.assert_eq( |
31 | 81 | sn.count(sn.findall(r'latency', self.stdout)), |
32 | | - self.num_tasks_assigned * len(self.executable_opts)) |
| 82 | + self.num_tasks * len(self.executable_opts) |
| 83 | + ) |
33 | 84 |
|
34 | | - def lat_pattern(index): |
35 | | - return sn.extractsingle( |
36 | | - r'latency \(ns\) for input size %s: (?P<bw>\S+) clocks' % |
37 | | - self.executable_opts[index], self.stdout, 'bw', float) |
| 85 | + def lat_pattern(self, index): |
| 86 | + return sn.extractsingle( |
| 87 | + r'latency \(ns\) for input size %s: (?P<bw>\S+) clocks' % |
| 88 | + self.executable_opts[index], self.stdout, 'bw', float) |
38 | 89 |
|
39 | | - self.perf_patterns = { |
40 | | - 'latencyL1': lat_pattern(0), |
41 | | - 'latencyL2': lat_pattern(1), |
42 | | - 'latencyL3': lat_pattern(2), |
43 | | - 'latencyMem': lat_pattern(3), |
44 | | - } |
| 90 | + @performance_function('ns') |
| 91 | + def latencyL1(self): |
| 92 | + return self.lat_pattern(0) |
45 | 93 |
|
46 | | - self.reference = { |
47 | | - 'dom:mc': { |
48 | | - 'latencyL1': (1.21, -0.01, 0.26, 'ns'), |
49 | | - 'latencyL2': (3.65, -0.01, 0.26, 'ns'), |
50 | | - 'latencyL3': (18.83, -0.01, 0.05, 'ns'), |
51 | | - 'latencyMem': (76.6, -0.01, 0.05, 'ns') |
52 | | - }, |
53 | | - 'dom:gpu': { |
54 | | - 'latencyL1': (1.14, -0.01, 0.26, 'ns'), |
55 | | - 'latencyL2': (3.44, -0.01, 0.26, 'ns'), |
56 | | - 'latencyL3': (15.65, -0.01, 0.05, 'ns'), |
57 | | - 'latencyMem': (71.7, -0.01, 0.05, 'ns') |
58 | | - }, |
59 | | - 'daint:mc': { |
60 | | - 'latencyL1': (1.21, -0.01, 0.26, 'ns'), |
61 | | - 'latencyL2': (3.65, -0.01, 0.26, 'ns'), |
62 | | - 'latencyL3': (18.83, -0.01, 0.05, 'ns'), |
63 | | - 'latencyMem': (76.6, -0.01, 0.05, 'ns') |
64 | | - }, |
65 | | - 'daint:gpu': { |
66 | | - 'latencyL1': (1.14, -0.01, 0.26, 'ns'), |
67 | | - 'latencyL2': (3.44, -0.01, 0.26, 'ns'), |
68 | | - 'latencyL3': (15.65, -0.01, 0.05, 'ns'), |
69 | | - 'latencyMem': (71.7, -0.01, 0.05, 'ns') |
70 | | - }, |
71 | | - 'ault:intel': { |
72 | | - 'latencyL1': (1.08, -0.01, 0.26, 'ns'), |
73 | | - 'latencyL2': (3.8, -0.01, 0.26, 'ns'), |
74 | | - 'latencyL3': (21.5, -0.01, 0.05, 'ns'), |
75 | | - 'latencyMem': (86.5, -0.01, 0.05, 'ns') |
76 | | - }, |
77 | | - 'ault:amdvega': { |
78 | | - 'latencyL1': (1.32, -0.01, 0.26, 'ns'), |
79 | | - 'latencyL2': (4.02, -0.01, 0.26, 'ns'), |
80 | | - 'latencyL3': (14.4, -0.01, 0.26, 'ns'), |
81 | | - 'latencyMem': (90.0, -0.01, 0.05, 'ns') |
82 | | - }, |
83 | | - 'tave:compute': { |
84 | | - 'latencyL1': (2.86, -0.01, 0.05, 'ns'), |
85 | | - 'latencyL2': (12.15, -0.01, 0.05, 'ns'), |
86 | | - 'latencyL3': (137, -0.01, 0.05, 'ns'), |
87 | | - 'latencyMem': (150, -0.05, 0.05, 'ns') |
88 | | - }, |
89 | | - } |
| 94 | + @performance_function('ns') |
| 95 | + def latencyL2(self): |
| 96 | + return self.lat_pattern(1) |
90 | 97 |
|
91 | | - self.maintainers = ['SK'] |
92 | | - self.tags = {'benchmark', 'diagnostic'} |
| 98 | + @performance_function('ns') |
| 99 | + def latencyL3(self): |
| 100 | + return self.lat_pattern(2) |
93 | 101 |
|
94 | | - @property |
95 | | - @sn.sanity_function |
96 | | - def num_tasks_assigned(self): |
97 | | - return self.job.num_tasks |
| 102 | + @performance_function('ns') |
| 103 | + def latencyMem(self): |
| 104 | + return self.lat_pattern(3) |
0 commit comments