From e880dc71983b5633f6c2fb7fb25bc5b82f6d231a Mon Sep 17 00:00:00 2001 From: emilyhunt Date: Mon, 19 Apr 2021 14:48:19 +0200 Subject: [PATCH] New config setting for whether or not to choose the next task randomly (should help first-fit packing to be more efficient). --- _sphandler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_sphandler.py b/_sphandler.py index d875a73..ca772c8 100644 --- a/_sphandler.py +++ b/_sphandler.py @@ -338,9 +338,8 @@ class SubprocessHandler: break else: - # If we're yet to do a fit then we pick a task at random; otherwise, we pick the first available - # valid task. - if self._have_done_a_fit is False: + # Pick a task at random from everything we could try! + if self._have_done_a_fit is False or self.config['random_task_order']: task_index = valid_tasks[valid_tasks].sample().index[0] else: task_index = valid_tasks.idxmax() -- 2.54.0