From 7cd65437283d0c6a35c26d0036367b515bbb7117 Mon Sep 17 00:00:00 2001 From: be-marc Date: Sun, 29 Dec 2024 10:59:45 +0100 Subject: [PATCH] ... --- R/OptimizerAsync.R | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/R/OptimizerAsync.R b/R/OptimizerAsync.R index 7522c041..9863e6ac 100644 --- a/R/OptimizerAsync.R +++ b/R/OptimizerAsync.R @@ -79,7 +79,16 @@ optimize_async_default = function(instance, optimizer, design = NULL, n_workers # run .optimize() on workers rush = instance$rush - if (requireNamespace("mirai") && mirai::daemons()$connections) { + if (rush::rush_config()$worker_type == "script") { + # worker script + rush$worker_script( + worker_loop = bbotk_worker_loop, + packages = c(optimizer$packages, instance$objective$packages, "bbotk"), + optimizer = optimizer, + instance = instance) + + return(TRUE) + } else if (requireNamespace("mirai") && mirai::daemons()$connections) { # remote workers lg$info("Starting to optimize %i parameter(s) with '%s' and '%s' on %i remote worker(s)", instance$search_space$length,