From bbb8184a289e3b54f09bc9bb576692b15283a4e1 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Wed, 29 Jul 2020 14:17:36 +0200 Subject: [PATCH 1/2] Fix glob pattern to search for txt instead of yaml * Correct also the sanity pattern. * Use f-strings instead of `%` based string formatting. --- .../microbenchmarks/hpcg/hpcg_benchmark.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py b/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py index e7af857edf..6adc504ad4 100644 --- a/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py +++ b/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py @@ -99,8 +99,7 @@ def __init__(self): self.modules = ['craype-hugepages8M'] self.build_system = 'Make' self.prebuild_cmds = ['cp -r ${MKLROOT}/benchmarks/hpcg/* .', - 'mv Make.CrayXC setup', - './configure CrayXC'] + 'mv Make.CrayXC setup', './configure CrayXC'] self.num_tasks = 0 self.num_tasks_per_core = 2 @@ -116,9 +115,9 @@ def __init__(self): } self.executable = 'bin/xhpcg_avx2' - self.executable_opts = ['--nx=%d' % self.problem_size, - '--ny=%d' % self.problem_size, - '--nz=%d' % self.problem_size, '-t2'] + self.executable_opts = [f'--nx={self.problem_size}', + f'--ny={self.problem_size}', + f'--nz={self.problem_size}', '-t2'] self.reference = { 'dom:mc': { @@ -146,9 +145,8 @@ def num_tasks_assigned(self): @property @sn.sanity_function def outfile_lazy(self): - pattern = 'n%d-%dp-%dt-*.yaml' % (self.problem_size, - self.job.num_tasks, - self.num_cpus_per_task) + pattern = (f'n{self.problem_size}-{self.job.num_tasks}p-' + f'{self.num_cpus_per_task}t*.txt') return sn.getitem(sn.glob(pattern), 0) @rfm.run_before('compile') @@ -168,7 +166,7 @@ def set_performance(self): num_nodes = self.num_tasks_assigned / self.num_tasks_per_node self.perf_patterns = { 'gflops': sn.extractsingle( - r'HPCG result is VALID with a GFLOP\/s rating of:\s*' + r'HPCG result is VALID with a GFLOP\/s rating of=' r'(?P\S+)', self.outfile_lazy, 'perf', float) / num_nodes } From 8e70898eeb1462a7110a2bb738dc953adbf6d857 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Wed, 29 Jul 2020 15:12:35 +0200 Subject: [PATCH 2/2] Change glob pattern to work for both txt/yaml --- cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py b/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py index 6adc504ad4..f80c540181 100644 --- a/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py +++ b/cscs-checks/microbenchmarks/hpcg/hpcg_benchmark.py @@ -146,7 +146,7 @@ def num_tasks_assigned(self): @sn.sanity_function def outfile_lazy(self): pattern = (f'n{self.problem_size}-{self.job.num_tasks}p-' - f'{self.num_cpus_per_task}t*.txt') + f'{self.num_cpus_per_task}t*.*') return sn.getitem(sn.glob(pattern), 0) @rfm.run_before('compile') @@ -166,7 +166,7 @@ def set_performance(self): num_nodes = self.num_tasks_assigned / self.num_tasks_per_node self.perf_patterns = { 'gflops': sn.extractsingle( - r'HPCG result is VALID with a GFLOP\/s rating of=' + r'HPCG result is VALID with a GFLOP\/s rating of(=|:)\s*' r'(?P\S+)', self.outfile_lazy, 'perf', float) / num_nodes }