-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.R
More file actions
31 lines (23 loc) · 739 Bytes
/
Copy pathtests.R
File metadata and controls
31 lines (23 loc) · 739 Bytes
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
26
27
28
29
30
31
library(parallel)
library(BiocParallel)
source("helpers.R")
clObj <- parallel::makeCluster(2L)
# platform
cat("\n\nplatform: ", .Platform$OS.type, "\n")
# digest clObj
clparam <- getListOfBiocParallelParam2(clObj = clObj)
cat("\n\nclparam:\n")
print(clparam)
nworkers <- unlist(lapply(clparam, BiocParallel::bpworkers))
cat("\n\nnworkers: ", nworkers, "\n")
# will use only one layer of parallelization, select best
clsel <- which.max(nworkers)
cat("\n\nclsel: ", clsel, "\n")
# use it in bplapply
ret <- BiocParallel::bplapply(seq.int(nworkers[clsel]),
function(i) i,
BPPARAM = clparam[[clsel]])
cat("\n\ntraceback:\n")
traceback()
cat("\n\nbplapply ret:\n")
print(ret)