Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert expander fixes #352

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lib/ramble/ramble/expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,6 @@ def perform_math_eval(self, in_str):
"""
try:
math_ast = ast.parse(in_str, mode='eval')
# If the only node in the AST is a constant, return an unmodified
# in_str.
is_num_const = isinstance(math_ast.body, ast.Constant) and \
hasattr(math_ast.body, 'value')
backport_num_const = isinstance(math_ast.body, ast.Num) and hasattr(math_ast.body, 'n')
if is_num_const or backport_num_const:
return in_str
out_str = self.eval_math(math_ast.body)
return out_str
except MathEvaluationError as e:
Expand Down
2 changes: 2 additions & 0 deletions lib/ramble/ramble/test/expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def exp_dict():
'var2': '{var3}',
'var3': '3',
'decimal.06.var': 'foo',
'size': '0000.96'
}


Expand All @@ -51,6 +52,7 @@ def exp_dict():
('{{n_ranks}+2}', '6'),
('{{n_ranks}*{var{processes_per_node}}:05d}', '00012'),
('{{n_ranks}-1}', '3'),
('{{{n_ranks}/2}:0.0f}', '2')
]
)
def test_expansions(input, output):
Expand Down
4 changes: 2 additions & 2 deletions var/ramble/repos/builtin/applications/gromacs/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ class Gromacs(SpackApplication):
description='Workload type.',
values=['pme', 'rf'],
workloads=['water_gmx50', 'water_bare'])
workload_variable('input_path', default='{water_gmx50_bare}/{size}',
workload_variable('input_path', default='{water_gmx50_bare}/*{size}',
description='Input path for water GMX50',
workload='water_gmx50')
workload_variable('input_path', default='{water_bare_hbonds}/{size}',
workload_variable('input_path', default='{water_bare_hbonds}/*{size}',
description='Input path for water bare hbonds',
workload='water_bare')
workload_variable('input_path', default='{lignocellulose}/lignocellulose-rf.tpr',
Expand Down