Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Dec 29, 2024
1 parent d9d3f57 commit 7cd6543
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion R/OptimizerAsync.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7cd6543

Please sign in to comment.