/usr/lib/R/site-library/BiocParallel/unitTests/test_bpvectorize.R is in r-bioc-biocparallel 1.4.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(doParallel)
test_bpvectorize_Params <- function()
{
registerDoParallel(2)
params <- list(serial=SerialParam(),
snow=SnowParam(2),
batchjobs=BatchJobsParam(workers=2),
dopar=DoparParam())
if (.Platform$OS.type != "windows")
params$mc <- MulticoreParam(2)
x <- 1:10
expected <- sqrt(x)
for (param in names(params)) {
psqrt <- bpvectorize(sqrt, BPPARAM=params[[param]])
checkIdentical(expected, psqrt(x))
}
## clean up
env <- foreach:::.foreachGlobals
rm(list=ls(name=env), pos=env)
closeAllConnections()
TRUE
}
|