bplapply - only SerialParam or single worker Multicore working on R/macos 10.14
1
0
Entering edit mode
geo.vogler ▴ 10
@geovogler-20208
Last seen 16 months ago
United States

Hi!

Trying to run the following command in R fails unless I use the SerialParam:

bplapply(1:6, sqrt, BPPARAM = SerialParam()) -> WORKS
bplapply(1:6, sqrt) -> FAILS (unresponsive)
bplapply(1:6, sqrt, BPPARAM = MulticoreParam(2)) -> FAILS (unresponsive)
bplapply(1:6, sqrt, BPPARAM = MulticoreParam(1)) -> WORKS

Any ideas what to do?

> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] BiocParallel_1.16.6

loaded via a namespace (and not attached):
[1] compiler_3.5.2 snow_0.4-3     parallel_3.5.2 tools_3.5.2    yaml_2.2.0 
BiocParallel mac R • 1.6k views
ADD COMMENT
0
Entering edit mode

I have posted various answers on Biostars about how to correctly use parallel processing enabled functions in R; however, I do not cover bplapply. On Windows, the equivalent to lapply is parLapply; on Mac/Linux, it is mclapply

The parallel function to use is usually system dependent.

ADD REPLY
1
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

These functions communicate via 'ports', and likely ports on your machine are not accessible. It might take some research to identify open ports, and then provide manager.port=... to the constructor.

You might also be interested in the LocalParam() type, available after

BiocManager::install("Bioconductor/BiocParallel", ref="LocalParam")
ADD COMMENT
1
Entering edit mode

Works!

register( BPPARAM = LocalParam(10))

bplapply(1:6, sqrt) -> WORKS

Many thanks - that was super helpful :-)

ADD REPLY

Login before adding your answer.

Traffic: 789 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6