Skip to content

Commit cf56231

Browse files
author
Vasileios Karakasis
committed
Code style fixes
1 parent dacd357 commit cf56231

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

reframe/core/schedulers/slurm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ def filternodes(self, job, nodes):
306306
# create a mutable list out of the immutable SequenceView that
307307
# sched_access is
308308
options = job.sched_access + job.options + job.cli_options
309+
310+
# Properly split lexically all the arguments in the options list so as
311+
# to treat correctly entries such as '--option foo'.
309312
options = list(itertools.chain.from_iterable(shlex.split(opt)
310313
for opt in options))
311314
option_parser = ArgumentParser()

reframe/frontend/cli.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,14 +1037,17 @@ def _case_failed(t):
10371037

10381038
if options.distribute:
10391039
node_map = getallnodes(options.distribute, parsed_job_options)
1040-
# In the distribute option we need to remove the cli options that
1041-
# begin with '--nodelist' and '-w', so that we don't include them
1042-
# in the job scripts
1043-
parsed_job_options = list(
1044-
filter(lambda x: (not x.startswith('-w') and
1045-
not x.startswith('--nodelist')),
1046-
parsed_job_options)
1047-
)
1040+
1041+
# Remove the job options that begin with '--nodelist' and '-w', so
1042+
# that they do not override those set from the distribute feature.
1043+
#
1044+
# NOTE: This is Slurm-specific. When support of distributing tests
1045+
# is added to other scheduler backends, this needs to be updated,
1046+
# too.
1047+
parsed_job_options = [
1048+
for x in parsed_job_options
1049+
if (not x.startswith('-w') and not x.startswith('--nodelist'))
1050+
]
10481051
testcases = distribute_tests(testcases, node_map)
10491052
testcases_all = testcases
10501053

0 commit comments

Comments
 (0)