Skip to content

Commit

Permalink
Update context output format to reduce duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
rfbgo committed Apr 4, 2024
1 parent 5dce905 commit f799b6d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/ramble/ramble/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,8 +1427,7 @@ def format_context(context_match, context_format):
if group[1]:
context_val[group[1]] = context_match[group[1]]

context_string = context_format.replace('{', '').replace('}', '') \
+ ' = ' + context_format.format(**context_val)
context_string = context_format.format(**context_val)
return context_string

fom_values = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Cloverleaf(SpackApplication):

figure_of_merit_context('step',
regex=step_count_regex,
output_format='{step}')
output_format='Step {step}')

step_summary_regex = (r'\s*step:\s+(?P<step>[0-9]+)\s+' +
r'(?P<volume>' + floating_point_regex + r')\s+' +
Expand Down
2 changes: 1 addition & 1 deletion var/ramble/repos/builtin/applications/hpl/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class Hpl(SpackApplication):
group_name='gflops', units='GFLOP/s',
contexts=['problem-name'])

figure_of_merit_context('problem-name', regex=r'.*\s+(?P<N>[0-9]+)\s+(?P<NB>[0-9]+)\s+(?P<P>[0-9]+)\s+(?P<Q>[0-9]+)\s+(?P<time>[0-9]+\.[0-9]+)\s+(?P<gflops>[0-9].*)\n', output_format='{N}-{NB}-{P}-{Q}')
figure_of_merit_context('problem-name', regex=r'.*\s+(?P<N>[0-9]+)\s+(?P<NB>[0-9]+)\s+(?P<P>[0-9]+)\s+(?P<Q>[0-9]+)\s+(?P<time>[0-9]+\.[0-9]+)\s+(?P<gflops>[0-9].*)\n', output_format='N-NB-P-Q = {N}-{NB}-{P}-{Q}')

# Integer sqrt
def _isqrt(self, n):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class IntelHpl(SpackApplication):
group_name='gflops', units='GFLOP/s',
contexts=['problem-name'])

figure_of_merit_context('problem-name', regex=r'.*\s+(?P<N>[0-9]+)\s+(?P<NB>[0-9]+)\s+(?P<P>[0-9]+)\s+(?P<Q>[0-9]+)\s+(?P<time>[0-9]+\.[0-9]+)\s+(?P<gflops>[0-9].*)\n', output_format='{N}-{NB}-{P}-{Q}')
figure_of_merit_context('problem-name', regex=r'.*\s+(?P<N>[0-9]+)\s+(?P<NB>[0-9]+)\s+(?P<P>[0-9]+)\s+(?P<Q>[0-9]+)\s+(?P<time>[0-9]+\.[0-9]+)\s+(?P<gflops>[0-9].*)\n', output_format='N-NB-P-Q = {N}-{NB}-{P}-{Q}')

# Integer sqrt
def _isqrt(self, n):
Expand Down
2 changes: 1 addition & 1 deletion var/ramble/repos/builtin/applications/ior/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Ior(SpackApplication):

access_regex = '(?P<access>(read|write))' + iter_regex
figure_of_merit_context('iter', regex=access_regex,
output_format='{iter}')
output_format='iter {iter}')

log_str = Expander.expansion_str('log_file')

Expand Down

0 comments on commit f799b6d

Please sign in to comment.