diff --git a/beat/web/backend/schedule.py b/beat/web/backend/schedule.py index dd3c0e0975e2831310890e4a71f419a7e1839c0f..dc0236d201e4e38826c92ef035aae65d837ba09b 100644 --- a/beat/web/backend/schedule.py +++ b/beat/web/backend/schedule.py @@ -176,6 +176,11 @@ def schedule(): (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. + + Returns: + + list: The list of splits assigned at this scheduling iteration + ''' # updates jobs with split errors, cancel experiments if problems occur @@ -201,6 +206,8 @@ def schedule(): if availability <= 0: continue whitelist[worker] = availability + assigned_splits = [] + for batch in splits_to_consider: if not batch: continue #empty list @@ -217,6 +224,7 @@ def schedule(): if avail >= required_cores: logger.info("Assigning `%s' to worker `%s'", split, c) split.schedule(c) #assign job split to worker + assigned_splits.append(split) whitelist[c] -= required_cores logger.debug("`%s' cores available: %d", c, whitelist[c]) assigned = True @@ -231,6 +239,8 @@ def schedule(): job, c0) del whitelist[c0] + return assigned_splits + def process(split, environments, cpulimit=None): '''Process assigned job splits using beat.core