From 69d878483a2a246541a2e7b4da943d3a60d10fb0 Mon Sep 17 00:00:00 2001 From: benedikt-voelkel Date: Tue, 27 Sep 2022 11:30:43 +0200 Subject: [PATCH] Align number of jobs and trials (#34) Co-authored-by: Benedikt Volkel --- src/o2tuner/optimise.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/o2tuner/optimise.py b/src/o2tuner/optimise.py index 3eadb98..f9d324d 100644 --- a/src/o2tuner/optimise.py +++ b/src/o2tuner/optimise.py @@ -52,6 +52,10 @@ def optimise(objective, optuna_config, *, work_dir="o2tuner_optimise", user_conf run_serial = True jobs = 1 + if trials < jobs: + LOG.info(f"Attempt to do {trials} trials, hence reducing the number of jobs from {jobs} to {trials}") + jobs = trials + trials_list = floor(trials / jobs) trials_list = [trials_list] * jobs # add the left-over trials simply to the last job for now