|
| 1 | +import reframe as rfm |
| 2 | +import reframe.utility.sanity as sn |
| 3 | + |
| 4 | + |
| 5 | +@rfm.simple_test |
| 6 | +class Stencil4HPXCheck(rfm.RunOnlyRegressionTest): |
| 7 | + def __init__(self): |
| 8 | + super().__init__() |
| 9 | + |
| 10 | + self.descr = 'HPX 1d_stencil_4 check' |
| 11 | + self.valid_systems = ['daint:gpu, daint:mc', 'dom:gpu', 'dom:mc'] |
| 12 | + self.valid_prog_environs = ['PrgEnv-gnu'] |
| 13 | + |
| 14 | + self.modules = ['HPX'] |
| 15 | + self.executable = '1d_stencil_4' |
| 16 | + |
| 17 | + self.nt_opts = '100' # number of time steps |
| 18 | + self.np_opts = '100' # number of partitions |
| 19 | + self.nx_opts = '10000000' # number of points per partition |
| 20 | + self.executable_opts = ['--nt', self.nt_opts, |
| 21 | + '--np', self.np_opts, |
| 22 | + '--nx', self.nx_opts] |
| 23 | + self.sourcesdir = None |
| 24 | + |
| 25 | + self.use_multithreading = None |
| 26 | + |
| 27 | + self.perf_patterns = { |
| 28 | + 'time': sn.extractsingle(r'\d+,\s*(?P<time>(\d+)?.?\d+),\s*\d+,' |
| 29 | + r'\s*\d+,\s*\d+', |
| 30 | + self.stdout, 'time', float) |
| 31 | + } |
| 32 | + self.reference = { |
| 33 | + 'dom:gpu': { |
| 34 | + 'time': (42, None, 0.1, 's') |
| 35 | + }, |
| 36 | + 'dom:mc': { |
| 37 | + 'time': (30, None, 0.1, 's') |
| 38 | + }, |
| 39 | + 'daint:gpu': { |
| 40 | + 'time': (42, None, 0.1, 's') |
| 41 | + }, |
| 42 | + 'daint:mc': { |
| 43 | + 'time': (30, None, 0.1, 's') |
| 44 | + }, |
| 45 | + } |
| 46 | + |
| 47 | + self.tags = {'production'} |
| 48 | + self.maintainers = ['VH', 'JG'] |
| 49 | + |
| 50 | + def setup(self, partition, environ, **job_opts): |
| 51 | + result = sn.findall(r'(?P<tid>\d+),\s*(?P<time>(\d+)?.?\d+),' |
| 52 | + r'\s*(?P<pts>\d+),\s*(?P<parts>\d+),' |
| 53 | + r'\s*(?P<steps>\d+)', |
| 54 | + self.stdout) |
| 55 | + |
| 56 | + if partition.fullname == 'daint:gpu': |
| 57 | + self.num_tasks = 1 |
| 58 | + self.num_tasks_per_node = 1 |
| 59 | + self.num_cpus_per_task = 12 |
| 60 | + elif partition.fullname == 'daint:mc': |
| 61 | + self.num_tasks = 1 |
| 62 | + self.num_tasks_per_node = 1 |
| 63 | + self.num_cpus_per_task = 36 |
| 64 | + elif partition.fullname == 'dom:gpu': |
| 65 | + self.num_tasks = 1 |
| 66 | + self.num_tasks_per_node = 1 |
| 67 | + self.num_cpus_per_task = 12 |
| 68 | + elif partition.fullname == 'dom:mc': |
| 69 | + self.num_tasks = 1 |
| 70 | + self.num_tasks_per_node = 1 |
| 71 | + self.num_cpus_per_task = 36 |
| 72 | + |
| 73 | + self.executable_opts += ['--hpx:threads=%s' % self.num_cpus_per_task] |
| 74 | + |
| 75 | + assert_num_threads = sn.map(lambda x: sn.assert_eq( |
| 76 | + int(x.group('tid')), self.num_cpus_per_task), result) |
| 77 | + assert_num_points = sn.map(lambda x: sn.assert_eq( |
| 78 | + x.group('pts'), self.nx_opts), result) |
| 79 | + assert_num_parts = sn.map(lambda x: sn.assert_eq(x.group('parts'), |
| 80 | + self.np_opts), result) |
| 81 | + assert_num_steps = sn.map(lambda x: sn.assert_eq(x.group('steps'), |
| 82 | + self.nt_opts), result) |
| 83 | + |
| 84 | + self.sanity_patterns = sn.all(sn.chain(assert_num_threads, |
| 85 | + assert_num_points, |
| 86 | + assert_num_parts, |
| 87 | + assert_num_steps)) |
| 88 | + |
| 89 | + super().setup(partition, environ, **job_opts) |
| 90 | + |
| 91 | + |
| 92 | +@rfm.simple_test |
| 93 | +class Stencil8HPXCheck(rfm.RunOnlyRegressionTest): |
| 94 | + def __init__(self): |
| 95 | + super().__init__() |
| 96 | + |
| 97 | + self.descr = 'HPX 1d_stencil_8 check' |
| 98 | + self.valid_systems = ['daint:gpu, daint:mc', 'dom:gpu', 'dom:mc'] |
| 99 | + self.valid_prog_environs = ['PrgEnv-gnu'] |
| 100 | + |
| 101 | + self.modules = ['HPX'] |
| 102 | + self.executable = '1d_stencil_8' |
| 103 | + |
| 104 | + self.nt_opts = '100' # number of time steps |
| 105 | + self.np_opts = '100' # number of partitions |
| 106 | + self.nx_opts = '10000000' # number of points per partition |
| 107 | + self.executable_opts = ['--nt', self.nt_opts, |
| 108 | + '--np', self.np_opts, |
| 109 | + '--nx', self.nx_opts] |
| 110 | + self.sourcesdir = None |
| 111 | + |
| 112 | + self.use_multithreading = None |
| 113 | + |
| 114 | + self.perf_patterns = { |
| 115 | + 'time': sn.extractsingle(r'\d+,\s*\d+,\s*(?P<time>(\d+)?.?\d+),' |
| 116 | + r'\s*\d+,\s*\d+,\s*\d+', |
| 117 | + self.stdout, 'time', float) |
| 118 | + } |
| 119 | + self.reference = { |
| 120 | + 'dom:gpu': { |
| 121 | + 'time': (26, None, 0.1, 's') |
| 122 | + }, |
| 123 | + 'dom:mc': { |
| 124 | + 'time': (19, None, 0.1, 's') |
| 125 | + }, |
| 126 | + 'daint:gpu': { |
| 127 | + 'time': (26, None, 0.1, 's') |
| 128 | + }, |
| 129 | + 'daint:mc': { |
| 130 | + 'time': (19, None, 0.1, 's') |
| 131 | + }, |
| 132 | + } |
| 133 | + |
| 134 | + self.tags = {'production'} |
| 135 | + self.maintainers = ['VH', 'JG'] |
| 136 | + |
| 137 | + def setup(self, partition, environ, **job_opts): |
| 138 | + result = sn.findall(r'(?P<lid>\d+),\s*(?P<tid>\d+),' |
| 139 | + r'\s*(?P<time>(\d+)?.?\d+),' |
| 140 | + r'\s*(?P<pts>\d+),' |
| 141 | + r'\s*(?P<parts>\d+),' |
| 142 | + r'\s*(?P<steps>\d+)', self.stdout) |
| 143 | + |
| 144 | + if partition.fullname == 'daint:gpu': |
| 145 | + self.num_tasks = 2 |
| 146 | + self.num_tasks_per_node = 1 |
| 147 | + self.num_cpus_per_task = 12 |
| 148 | + elif partition.fullname == 'daint:mc': |
| 149 | + self.num_tasks = 4 |
| 150 | + self.num_tasks_per_node = 2 |
| 151 | + self.num_cpus_per_task = 18 |
| 152 | + self.num_tasks_per_socket = 1 |
| 153 | + elif partition.fullname == 'dom:gpu': |
| 154 | + self.num_tasks = 2 |
| 155 | + self.num_tasks_per_node = 1 |
| 156 | + self.num_cpus_per_task = 12 |
| 157 | + elif partition.fullname == 'dom:mc': |
| 158 | + self.num_tasks = 4 |
| 159 | + self.num_tasks_per_node = 2 |
| 160 | + self.num_cpus_per_task = 18 |
| 161 | + self.num_tasks_per_socket = 1 |
| 162 | + |
| 163 | + self.executable_opts += ['--hpx:threads=%s' % self.num_cpus_per_task] |
| 164 | + |
| 165 | + num_threads = self.num_tasks * self.num_cpus_per_task |
| 166 | + assert_num_tasks = sn.map(lambda x: sn.assert_eq(int(x.group('lid')), |
| 167 | + self.num_tasks), result) |
| 168 | + assert_num_threads = sn.map(lambda x: sn.assert_eq(int(x.group('tid')), |
| 169 | + num_threads), result) |
| 170 | + assert_num_points = sn.map(lambda x: sn.assert_eq(x.group('pts'), |
| 171 | + self.nx_opts), result) |
| 172 | + assert_num_parts = sn.map(lambda x: sn.assert_eq(x.group('parts'), |
| 173 | + self.np_opts), result) |
| 174 | + assert_num_steps = sn.map(lambda x: sn.assert_eq(x.group('steps'), |
| 175 | + self.nt_opts), result) |
| 176 | + |
| 177 | + self.sanity_patterns = sn.all(sn.chain(assert_num_tasks, |
| 178 | + assert_num_threads, |
| 179 | + assert_num_points, |
| 180 | + assert_num_parts, |
| 181 | + assert_num_steps)) |
| 182 | + |
| 183 | + super().setup(partition, environ, **job_opts) |
0 commit comments