Skip to content
Snippets Groups Projects
Commit d5d550d2 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[backend] Improved scheduling and current load calculation

parent 77caca35
No related branches found
No related tags found
1 merge request!194Scheduler
...@@ -176,6 +176,11 @@ def schedule(): ...@@ -176,6 +176,11 @@ def schedule():
(taking into consideration blocking as executed on step 3) and leave the (taking into consideration blocking as executed on step 3) and leave the
job split on the list if there is a free slot, otherwise remove it. job split on the list if there is a free slot, otherwise remove it.
Returns:
list: The list of splits assigned at this scheduling iteration
''' '''
# updates jobs with split errors, cancel experiments if problems occur # updates jobs with split errors, cancel experiments if problems occur
...@@ -201,6 +206,8 @@ def schedule(): ...@@ -201,6 +206,8 @@ def schedule():
if availability <= 0: continue if availability <= 0: continue
whitelist[worker] = availability whitelist[worker] = availability
assigned_splits = []
for batch in splits_to_consider: for batch in splits_to_consider:
if not batch: continue #empty list if not batch: continue #empty list
...@@ -217,6 +224,7 @@ def schedule(): ...@@ -217,6 +224,7 @@ def schedule():
if avail >= required_cores: if avail >= required_cores:
logger.info("Assigning `%s' to worker `%s'", split, c) logger.info("Assigning `%s' to worker `%s'", split, c)
split.schedule(c) #assign job split to worker split.schedule(c) #assign job split to worker
assigned_splits.append(split)
whitelist[c] -= required_cores whitelist[c] -= required_cores
logger.debug("`%s' cores available: %d", c, whitelist[c]) logger.debug("`%s' cores available: %d", c, whitelist[c])
assigned = True assigned = True
...@@ -231,6 +239,8 @@ def schedule(): ...@@ -231,6 +239,8 @@ def schedule():
job, c0) job, c0)
del whitelist[c0] del whitelist[c0]
return assigned_splits
def process(split, environments, cpulimit=None): def process(split, environments, cpulimit=None):
'''Process assigned job splits using beat.core '''Process assigned job splits using beat.core
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment