Skip to content
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
6 changes: 4 additions & 2 deletions reframe/core/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ def _merge_files(self, job):
os_ext.concat_files(job.stderr, *err_glob, overwrite=True)

def filternodes(self, job, nodes):
# Collect options that restrict node selection
options = job.sched_access + job.options
# Collect options that restrict node selection, but we need to first
# create a mutable list out of the immutable SequenceView that
# sched_access is
options = list(job.sched_access + job.options)
if job.sched_partition:
options.append('--partition=%s' % job.sched_partition)

Expand Down
12 changes: 12 additions & 0 deletions unittests/test_schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,18 @@ def test_sched_access_idle(self):
self.prepare_job()
assert self.testjob.num_tasks == 8

def test_sched_access_idle_sequence_view(self):
from reframe.utility import SequenceView

self.testjob._sched_flex_alloc_nodes = 'idle'

# Here simulate passing a readonly 'sched_access' as returned
# by a 'SystemPartition' instance.
self.testjob._sched_access = SequenceView(['--constraint=f3'])
self.testjob._sched_partition = 'p3'
self.prepare_job()
assert self.testjob.num_tasks == 4

def test_sched_access_constraint_partition(self):
self.testjob._sched_flex_alloc_nodes = 'all'
self.testjob._sched_access = ['--constraint=f1', '--partition=p2']
Expand Down