Commit 21ff939c authored by Thomas Lavocat's avatar Thomas Lavocat
Browse files

Add exec rank for ventilator

parent a693596c
...@@ -7,9 +7,10 @@ from .numbered_group import NumberedGroup ...@@ -7,9 +7,10 @@ from .numbered_group import NumberedGroup
class Ventilator(Executor): class Ventilator(Executor):
def __init__(self, name, commands, group, end=False, timeout=-1, 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) Executor.__init__(self, group, end, name, timeout, encoding)
self.commands = commands self.commands = commands
self.exec_rank= exec_rank
self.to_exec = len(commands) self.to_exec = len(commands)
self.busy_map = dict() self.busy_map = dict()
self.nbfail = 0 self.nbfail = 0
...@@ -19,8 +20,11 @@ class Ventilator(Executor): ...@@ -19,8 +20,11 @@ class Ventilator(Executor):
def got_spawn_list(data) : def got_spawn_list(data) :
decoded_data = json.loads(data) decoded_data = json.loads(data)
spawn_list = decoded_data[consts.DATA] spawn_list = decoded_data[consts.DATA]
for spawn in spawn_list : if self.exec_rank == "" :
self.busy_map[spawn] = [] for spawn in spawn_list :
self.busy_map[spawn] = []
else :
self.busy_map[self.exec_rank] = []
while self.assign_a_task() : while self.assign_a_task() :
pass pass
self.framework.acquire_spawn_list(self.group.ID,self.group.root_r, self.framework.acquire_spawn_list(self.group.ID,self.group.root_r,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment