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
Thomas Lavocat
yggdrasil
Commits
21ff939c
Commit
21ff939c
authored
Dec 06, 2017
by
Thomas Lavocat
Browse files
Add exec rank for ventilator
parent
a693596c
Changes
1
Hide whitespace changes
Inline
Side-by-side
yggdrasil/task_lib/ventilator.py
View file @
21ff939c
...
...
@@ -7,9 +7,10 @@ from .numbered_group import NumberedGroup
class
Ventilator
(
Executor
):
def
__init__
(
self
,
name
,
commands
,
group
,
end
=
False
,
timeout
=-
1
,
fail_threshold
=
0
,
encoding
=
consts
.
encoding
)
:
fail_threshold
=
0
,
encoding
=
consts
.
encoding
,
exec_rank
=
""
)
:
Executor
.
__init__
(
self
,
group
,
end
,
name
,
timeout
,
encoding
)
self
.
commands
=
commands
self
.
exec_rank
=
exec_rank
self
.
to_exec
=
len
(
commands
)
self
.
busy_map
=
dict
()
self
.
nbfail
=
0
...
...
@@ -19,8 +20,11 @@ class Ventilator(Executor):
def
got_spawn_list
(
data
)
:
decoded_data
=
json
.
loads
(
data
)
spawn_list
=
decoded_data
[
consts
.
DATA
]
for
spawn
in
spawn_list
:
self
.
busy_map
[
spawn
]
=
[]
if
self
.
exec_rank
==
""
:
for
spawn
in
spawn_list
:
self
.
busy_map
[
spawn
]
=
[]
else
:
self
.
busy_map
[
self
.
exec_rank
]
=
[]
while
self
.
assign_a_task
()
:
pass
self
.
framework
.
acquire_spawn_list
(
self
.
group
.
ID
,
self
.
group
.
root_r
,
...
...
Write
Preview
Supports
Markdown
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