Skip to content

Commit 8f7c399

Browse files
committed
Fix bug in cli options
1 parent 9f6d4ed commit 8f7c399

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

reframe/core/schedulers/slurm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import glob
88
import itertools
99
import re
10+
import shlex
1011
import time
1112
from argparse import ArgumentParser
1213
from contextlib import suppress
@@ -305,6 +306,8 @@ def filternodes(self, job, nodes):
305306
# create a mutable list out of the immutable SequenceView that
306307
# sched_access is
307308
options = job.sched_access + job.options + job.cli_options
309+
options = list(itertools.chain.from_iterable(shlex.split(m)
310+
for m in options))
308311
option_parser = ArgumentParser()
309312
option_parser.add_argument('--reservation')
310313
option_parser.add_argument('-p', '--partition')

reframe/frontend/cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,14 @@ 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+
)
10401048
testcases = distribute_tests(testcases, node_map)
10411049
testcases_all = testcases
10421050

0 commit comments

Comments
 (0)