Skip to content

Commit df08a4b

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into tutorials-docker
2 parents 88b4633 + 79bedf8 commit df08a4b

File tree

8 files changed

+395
-392
lines changed

8 files changed

+395
-392
lines changed

cscs-checks/apps/namd/namd_check.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class NamdCheck(rfm.RunOnlyRegressionTest):
1515
variant = parameter(['maint', 'prod'])
1616
arch = parameter(['gpu', 'cpu'])
1717

18-
valid_prog_environs = ['builtin', 'cpeIntel']
18+
valid_prog_environs = ['builtin', 'cpeGNU']
1919
modules = ['NAMD']
2020
executable = 'namd2'
2121
use_multithreading = True
@@ -48,10 +48,8 @@ def adapt_valid_systems(self):
4848

4949
@run_after('init')
5050
def adapt_valid_prog_environs(self):
51-
if self.current_system.name == 'pilatus':
51+
if self.current_system.name in ['eiger', 'pilatus']:
5252
self.valid_prog_environs.remove('builtin')
53-
else:
54-
self.valid_prog_environs.remove('cpeIntel')
5553

5654
@run_after('init')
5755
def setup_parallel_run(self):
@@ -104,13 +102,7 @@ def validate_energy(self):
104102
])
105103

106104
@run_before('performance')
107-
def setup_perf_vars(self):
108-
self.perf_patterns = {
109-
'days_ns': sn.avg(sn.extractall(
110-
r'Info: Benchmark time: \S+ CPUs \S+ '
111-
r's/step (?P<days_ns>\S+) days/ns \S+ MB memory',
112-
self.stdout, 'days_ns', float))
113-
}
105+
def set_reference(self):
114106
if self.arch == 'gpu':
115107
if self.scale == 'small':
116108
self.reference = {
@@ -135,3 +127,10 @@ def setup_perf_vars(self):
135127
'eiger:mc': {'days_ns': (0.05, None, 0.05, 'days/ns')},
136128
'pilatus:mc': {'days_ns': (0.05, None, 0.05, 'days/ns')}
137129
}
130+
131+
@performance_function('days/ns')
132+
def days_ns(self):
133+
return sn.avg(sn.extractall(
134+
r'Info: Benchmark time: \S+ CPUs \S+ '
135+
r's/step (?P<days_ns>\S+) days/ns \S+ MB memory',
136+
self.stdout, 'days_ns', float))

cscs-checks/microbenchmarks/cpu/roofline/berkeley-ert.py

Lines changed: 119 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,12 @@ class RunErt_Base(rfm.RegressionTest):
7272
etc...
7373
"""
7474
# }}}
75-
def __init__(self):
76-
self.descr = f'Empirical Roofline Toolkit (Base for building/running)'
77-
# pe step
78-
# build step
79-
# run step
80-
# postprocess step
81-
# sanity step
75+
descr = f'Empirical Roofline Toolkit (Base for building/running)'
76+
# pe step
77+
# build step
78+
# run step
79+
# postprocess step
80+
# sanity step
8281

8382
# {{{ hooks
8483
@run_before('compile')
@@ -174,46 +173,48 @@ def set_sanity(self):
174173

175174
# {{{ class PlotErt_Base
176175
class PlotErt_Base(rfm.RunOnlyRegressionTest):
177-
def __init__(self):
178-
self.descr = f'Empirical Roofline Toolkit (Base for plotting)'
179-
self.roofline_script1_fname = 'roofline.py'
180-
self.roofline_script1 = f'./Scripts/{self.roofline_script1_fname}'
181-
self.roofline_script2 = './ert_cscs.py'
182-
self.roofline_out_script1 = 'o.roofline'
183-
self.roofline_summary = 'sum'
184-
self.executable = f'cat'
185-
self.executable_opts = [
186-
r'*.sum',
187-
r'|',
188-
'python3',
189-
self.roofline_script1_fname,
190-
'&> ',
191-
self.roofline_out_script1,
192-
]
176+
descr = f'Empirical Roofline Toolkit (Base for plotting)'
177+
roofline_script1_fname = 'roofline.py'
178+
roofline_script1 = f'./Scripts/{roofline_script1_fname}'
179+
roofline_script2 = './ert_cscs.py'
180+
roofline_out_script1 = 'o.roofline'
181+
roofline_summary = 'sum'
182+
executable = f'cat'
183+
executable_opts = [
184+
r'*.sum',
185+
r'|',
186+
'python3',
187+
roofline_script1_fname,
188+
'&> ',
189+
roofline_out_script1,
190+
]
193191

194-
# {{{ sanity_patterns
195-
self.sanity_patterns = sn.all(
192+
# {{{ sanity_patterns
193+
@sanity_function
194+
def assert_stringss_found(self):
195+
return sn.all(
196196
[
197197
sn.assert_found(r'GFLOPs EMP', self.roofline_out_script1),
198198
sn.assert_found(r'DRAM EMP', self.roofline_out_script1),
199199
sn.assert_found('Empirical roofline graph:', self.stdout),
200200
]
201201
)
202-
# }}}
202+
# }}}
203203

204-
# {{{ performance
204+
# {{{ performance
205+
@performance_function('GF/s')
206+
def gflops(self):
205207
regex_gflops = r'(\S+)\sFP64 GFLOPs EMP'
206208
regex_L1bw = r'(\S+)\sL1 EMP'
209+
return sn.extractsingle(regex_gflops, self.roofline_out_script1, 1,
210+
float)
211+
212+
@performance_function('GB/s')
213+
def DRAMbw(self):
207214
regex_DRAMbw = r'(\S+)\sDRAM EMP'
208-
gflops = sn.extractsingle(regex_gflops, self.roofline_out_script1, 1,
209-
float)
210-
DRAMbw = sn.extractsingle(regex_DRAMbw, self.roofline_out_script1, 1,
211-
float)
212-
self.perf_patterns = {
213-
'gflops': gflops,
214-
'DRAMbw': DRAMbw,
215-
}
216-
# }}}
215+
return sn.extractsingle(regex_DRAMbw, self.roofline_out_script1, 1,
216+
float)
217+
# }}}
217218

218219
# {{{ hooks
219220
@run_before('run')
@@ -237,39 +238,34 @@ def check_gnuplot(self):
237238

238239
# {{{ Intel Haswell
239240
# {{{ HWL_RunErt
240-
@rfm.parameterized_test(
241-
*[
242-
[ert_precision, ert_flop, ert_mpi_task]
243-
for ert_precision in ert_precisions
244-
for ert_flop in ert_flops
245-
for ert_mpi_task in cpu_specs['HWL']['mpi_tasks']
246-
]
247-
)
241+
@rfm.simple_test
248242
class HWL_RunErt(RunErt_Base):
249-
def __init__(self, ert_precision, ert_flop, ert_mpi_task):
250-
# {{{ pe
251-
cpu = 'HWL'
252-
self.descr = f'Collect ERT data from INTEL {cpu}'
253-
self.valid_systems = ['dom:gpu']
254-
self.valid_prog_environs = ['PrgEnv-gnu']
255-
# }}}
243+
ert_precision = parameter(ert_precisions)
244+
ert_flop = parameter(ert_flops)
245+
ert_mpi_task = parameter(cpu_specs['HWL']['mpi_tasks'])
246+
# {{{ pe
247+
cpu = 'HWL'
248+
descr = f'Collect ERT data from INTEL {cpu}'
249+
valid_systems = ['dom:gpu']
250+
valid_prog_environs = ['PrgEnv-gnu']
251+
# }}}
256252

257-
# {{{ build
258-
self.ert_trials_min = 1
259-
self.ert_precision = ert_precision
260-
self.ert_flop = ert_flop
261-
# }}}
253+
# {{{ build
254+
ert_trials_min = 1
255+
# }}}
262256

257+
@run_after('init')
258+
def setup_run(self):
263259
# {{{ run
264-
self.num_tasks = ert_mpi_task
265-
self.num_tasks_per_node = ert_mpi_task
266-
self.num_cpus_per_task = 12 // ert_mpi_task
260+
self.num_tasks = self.ert_mpi_task
261+
self.num_tasks_per_node = self.ert_mpi_task
262+
self.num_cpus_per_task = 12 // self.ert_mpi_task
267263
# NOTE: mpi*openmp -> [1 12| 2 6| 3 4| 4 3| 6 2| 12 1]
268264
self.num_tasks_per_core = 1
269265
self.use_multithreading = False
270266
self.exclusive = True
271267
# Assuming ert_repeat=2, time can be adjusted as:
272-
if ert_flop >= 512:
268+
if self.ert_flop >= 512:
273269
self.time_limit = '20m'
274270
else:
275271
self.time_limit = '10m'
@@ -288,33 +284,33 @@ class HWL_PlotErt(PlotErt_Base):
288284
It can be run with: -n HWL_PlotErt -r
289285
"""
290286

291-
def __init__(self):
292-
super().__init__()
293-
cpu = 'HWL'
294-
self.descr = f'Plot ERT data on the Roofline chart (INTEL {cpu})'
295-
self.valid_systems = ['dom:login']
296-
self.valid_prog_environs = ['PrgEnv-gnu']
297-
self.maintainers = ['JG']
298-
self.tags = {'cpu'}
299-
self.sourcesdir = None
300-
# gnuplot already installed as rpm on dom but keeping as reminder
301-
# self.modules = ['gnuplot']
302-
self.dep_name = f'{cpu}_RunErt'
287+
cpu = 'HWL'
288+
descr = f'Plot ERT data on the Roofline chart (INTEL {cpu})'
289+
valid_systems = ['dom:login']
290+
valid_prog_environs = ['PrgEnv-gnu']
291+
maintainers = ['JG']
292+
tags = {'cpu'}
293+
sourcesdir = None
294+
# gnuplot already installed as rpm on dom but keeping as reminder
295+
# self.modules = ['gnuplot']
296+
# {{{ performance
297+
reference = {
298+
'*': {
299+
'gflops': (cpu_specs[cpu]['ref_GFLOPs'], None, None, 'GF/s'),
300+
'DRAMbw': (cpu_specs[cpu]['ref_DRAMbw'], None, None, 'GB/s'),
301+
}
302+
}
303+
# }}}
304+
305+
@run_after('init')
306+
def set_dependencies(self):
307+
self.dep_name = f'{self.cpu}_RunErt'
303308
for ii in ert_precisions:
304309
for jj in ert_flops:
305-
for kk in cpu_specs[cpu]['mpi_tasks']:
310+
for kk in cpu_specs[self.cpu]['mpi_tasks']:
306311
self.depends_on(f'{self.dep_name}_{ii}_{jj}_{kk}',
307312
udeps.by_env)
308313

309-
# {{{ performance
310-
self.reference = {
311-
'*': {
312-
'gflops': (cpu_specs[cpu]['ref_GFLOPs'], None, None, 'GF/s'),
313-
'DRAMbw': (cpu_specs[cpu]['ref_DRAMbw'], None, None, 'GB/s'),
314-
}
315-
}
316-
# }}}
317-
318314
# {{{ hooks
319315
@require_deps
320316
def prepare_logs(self, HWL_RunErt):
@@ -346,40 +342,34 @@ def prepare_logs(self, HWL_RunErt):
346342

347343

348344
# {{{ Intel Broadwell
349-
# {{{ BWL_RunErt
350-
@rfm.parameterized_test(
351-
*[
352-
[ert_precision, ert_flop, ert_mpi_task]
353-
for ert_precision in ert_precisions
354-
for ert_flop in ert_flops
355-
for ert_mpi_task in cpu_specs['BWL']['mpi_tasks']
356-
]
357-
)
345+
@rfm.simple_test
358346
class BWL_RunErt(RunErt_Base):
359-
def __init__(self, ert_precision, ert_flop, ert_mpi_task):
360-
# {{{ pe
361-
cpu = 'BWL'
362-
self.descr = f'Collect ERT data from INTEL {cpu}'
363-
self.valid_systems = ['dom:mc']
364-
self.valid_prog_environs = ['PrgEnv-gnu']
365-
# }}}
347+
ert_precision = parameter(ert_precisions)
348+
ert_flop = parameter(ert_flops)
349+
ert_mpi_task = parameter(cpu_specs['BWL']['mpi_tasks'])
350+
# {{{ pe
351+
cpu = 'BWL'
352+
descr = f'Collect ERT data from INTEL {cpu}'
353+
valid_systems = ['dom:mc']
354+
valid_prog_environs = ['PrgEnv-gnu']
355+
# }}}
366356

367-
# {{{ build
368-
self.ert_trials_min = 1
369-
self.ert_precision = ert_precision
370-
self.ert_flop = ert_flop
371-
# }}}
357+
# {{{ build
358+
ert_trials_min = 1
359+
# }}}
372360

361+
@run_after('init')
362+
def setup_run(self):
373363
# {{{ run
374-
self.num_tasks = ert_mpi_task
375-
self.num_tasks_per_node = ert_mpi_task
376-
self.num_cpus_per_task = 36 // ert_mpi_task
364+
self.num_tasks = self.ert_mpi_task
365+
self.num_tasks_per_node = self.ert_mpi_task
366+
self.num_cpus_per_task = 36 // self.ert_mpi_task
377367
# NOTE: mpi*openmp: [1 36| 2 18| 3 12| 4 9| 6 6| 9 4| 12 3| 18 2| 36 1]
378368
self.num_tasks_per_core = 1
379369
self.use_multithreading = False
380370
self.exclusive = True
381371
# Assuming ert_repeat=2, time can be adjusted as:
382-
if ert_flop >= 64 or ert_mpi_task >= 12:
372+
if self.ert_flop >= 64 or self.ert_mpi_task >= 12:
383373
self.time_limit = '20m'
384374
else:
385375
self.time_limit = '10m'
@@ -398,33 +388,33 @@ class BWL_PlotErt(PlotErt_Base):
398388
It can be run with: -n BWL_PlotErt -r
399389
"""
400390

401-
def __init__(self):
402-
super().__init__()
403-
cpu = 'BWL'
404-
self.descr = f'Plot ERT data on the Roofline chart (INTEL {cpu})'
405-
self.valid_systems = ['dom:login']
406-
self.valid_prog_environs = ['PrgEnv-gnu']
407-
self.maintainers = ['JG']
408-
self.tags = {'cpu'}
409-
self.sourcesdir = None
410-
# gnuplot already installed as rpm on dom but keeping as reminder
411-
# self.modules = ['gnuplot']
412-
self.dep_name = f'{cpu}_RunErt'
391+
cpu = 'BWL'
392+
descr = f'Plot ERT data on the Roofline chart (INTEL {cpu})'
393+
valid_systems = ['dom:login']
394+
valid_prog_environs = ['PrgEnv-gnu']
395+
maintainers = ['JG']
396+
tags = {'cpu'}
397+
sourcesdir = None
398+
# gnuplot already installed as rpm on dom but keeping as reminder
399+
# self.modules = ['gnuplot']
400+
# {{{ performance
401+
reference = {
402+
'*': {
403+
'gflops': (cpu_specs[cpu]['ref_GFLOPs'], None, None, 'GF/s'),
404+
'DRAMbw': (cpu_specs[cpu]['ref_DRAMbw'], None, None, 'GB/s'),
405+
}
406+
}
407+
# }}}
408+
409+
@run_after('init')
410+
def set_dependencies(self):
411+
self.dep_name = f'{self.cpu}_RunErt'
413412
for ii in ert_precisions:
414413
for jj in ert_flops:
415-
for kk in cpu_specs[cpu]['mpi_tasks']:
414+
for kk in cpu_specs[self.cpu]['mpi_tasks']:
416415
self.depends_on(f'{self.dep_name}_{ii}_{jj}_{kk}',
417416
udeps.by_env)
418417

419-
# {{{ performance
420-
self.reference = {
421-
'*': {
422-
'gflops': (cpu_specs[cpu]['ref_GFLOPs'], None, None, 'GF/s'),
423-
'DRAMbw': (cpu_specs[cpu]['ref_DRAMbw'], None, None, 'GB/s'),
424-
}
425-
}
426-
# }}}
427-
428418
# {{{ hooks
429419
@require_deps
430420
def prepare_logs(self, HWL_RunErt):

0 commit comments

Comments
 (0)