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

[backend] Fixes to the scheduling routines

parent 277755de
No related branches found
No related tags found
1 merge request!194Scheduler
......@@ -66,8 +66,8 @@ def _select_splits_for_queue(queue):
'''
splits = JobSplits.objects.filter(job__block__queue=queue,
job__split_error=0, status=Job.QUEUED).order_by('job__runnable_date')
splits = JobSplit.objects.filter(job__block__queue=queue,
job__split_errors=0, status=Job.QUEUED).order_by('job__runnable_date')
# lists of all users currently running
users = set(splits.values_list('job__block__experiment__author', flat=True))
......@@ -82,9 +82,9 @@ def _select_splits_for_queue(queue):
# limit runnable splits so we reach a maximum of allowed user slots
splits_to_consider = []
for s in splits:
author = j.job.block.experiment.author
author = s.job.block.experiment.author.id
if allowance[author] > 0:
splits_to_consider.append(j)
splits_to_consider.append(s)
allowance[author] -= 1
# TODO: Sort splits taking into consideration current user load
......@@ -190,7 +190,7 @@ def schedule():
','.join([k.name for k in sorted_queues]))
splits_to_consider = \
[self._select_splits_for_queue(q) for q in sorted_queues]
[_select_splits_for_queue(q) for q in sorted_queues]
# decides which split to run considering the 'on-the-fly' availability
......
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