Skip to content

Commit

Permalink
Merge pull request #713 from kraushm/bugfix/improper-scontrol-output-…
Browse files Browse the repository at this point in the history
…handling

[bugfix] Fix Slurm backend failures when trying node lists with inexistent nodes
  • Loading branch information
vkarak committed Mar 14, 2019
2 parents 3868fd6 + 8e7fb55 commit 70d3dff
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions reframe/core/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,17 @@ def _get_reservation_nodes(self, reservation):
return {SlurmNode(descr) for descr in node_descriptions}

def _get_nodes_by_name(self, nodespec):
try:
completed = _run_strict('scontrol -a show -o node %s' % nodespec)
except SpawnedProcessError as e:
raise JobError('could not retrieve the node description '
'of nodes: %s' % nodespec) from e

completed = os_ext.run_command('scontrol -a show -o node %s' %
nodespec)
node_descriptions = completed.stdout.splitlines()
return {SlurmNode(descr) for descr in node_descriptions}
nodes_avail = set()
for descr in node_descriptions:
try:
nodes_avail.add(SlurmNode(descr))
except JobError:
pass

return nodes_avail

def _set_nodelist(self, nodespec):
if self._nodelist is not None:
Expand Down

0 comments on commit 70d3dff

Please sign in to comment.