Skip to content

Commit

Permalink
use multicore for BiocParallel
Browse files Browse the repository at this point in the history
reason is to
(1) have real environment that we're exporting to
(2) previous test's register_dopar() is not unregistered, hence cmq
tries to use multicore that requires this option set
  • Loading branch information
mschubert committed Dec 15, 2023
1 parent 9f01bbc commit 2340ac1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/testthat/test-8-foreach.r
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ test_that("external worker", {
})

test_that("foreach works via BiocParallel", {
skip_on_os("windows")
skip_if_not_installed("BiocParallel")

old_sched = getOption("clustermq.scheduler")
on.exit(options(clustermq.scheduler = old_sched))
options(clustermq.scheduler = "multicore")

register_dopar_cmq(n_jobs=1)
BiocParallel::register(BiocParallel::DoparParam())
res = BiocParallel::bplapply(1:3, sqrt)
cmp = foreach(i=1:3) %do% sqrt(i)
Expand Down

0 comments on commit 2340ac1

Please sign in to comment.