tests/bpvec.R

source("incl/start.R")
strategies <- all_strategies(excl = "multiprocess")

message("*** bpvec() w/ FutureParam ...")

## Serial version of pvec()
svec <- function(...) {
  parallel::pvec(..., mc.cores = 1L)
}


for (strategy in strategies) {
  message(sprintf("- plan('%s') ...", strategy))
  plan(strategy)

  message("  - sqrt()")
  a <- 1:10
  expected <- svec(a, FUN = sqrt)
  current <- bpvec(a, FUN = sqrt)
  stopifnot(identical(expected, current))

  message(sprintf("- plan('%s') ... DONE", strategy))
} ## for (strategy ...)

message("*** bpvec() w/ FutureParam ... DONE")

source("incl/end.R")
HenrikBengtsson/BiocParallel.FutureParam documentation built on July 10, 2017, 6:41 p.m.