Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AIG-public
Cobalt
Commits
2f850610
Commit
2f850610
authored
Jan 24, 2017
by
Paul Rich
Browse files
blocks with location set won't try to drain already draining blocks.
parent
f06b3995
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Components/bgq_base_system.py
View file @
2f850610
...
...
@@ -1185,14 +1185,24 @@ class BGBaseSystem (Component):
def
_find_drain_block
(
self
,
job
,
drain_blocks
):
'''find a block to drain. If there is a specified location for a job,
drain only on that location, otherwise, choose the block where we want
the job to eventually run.
'''
geometry
=
job
.
get
(
'geometry'
,
None
)
# if the user requested a particular block, we only try to drain that one
if
job
[
'attrs'
].
has_key
(
"location"
):
#don't drain a dead block
if
(
job
[
'attrs'
][
'location'
]
not
in
self
.
offline_blocks
and
set
(
job
[
'attrs'
][
'location'
]).
isdisjoint
(
drain_blocks
)):
set
(
job
[
'attrs'
][
'location'
]).
isdisjoint
(
set
([
name
for
name
in
drain_blocks
]))):
target_name
=
job
[
'attrs'
][
'location'
]
return
self
.
cached_blocks
.
get
(
target_name
,
None
)
target_block
=
self
.
cached_blocks
.
get
(
target_name
,
None
)
if
target_block
is
not
None
:
if
target_block
.
draining
:
return
None
return
target_block
else
:
#return this drain location or not at all for this job
return
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment