Question: bplapply, MulticoreParam and messages
0
gravatar for Michael Love
4.1 years ago by
Michael Love24k
United States
Michael Love24k wrote:

I'm wondering what the intended behavior is for the example below (for the development branch of BiocParallel).

I'm not specifying logdir so was expecting messages to print to stdout, given the description in ?MulticoreParam.

Setting a logdir makes more sense perhaps, I'm just curious if the below behavior is intended (printing to stdout worked in Bioc 2.14 I think).

thanks!

Mike

> register(SerialParam())
> res <- bplapply(1:4, function(i) message("foo ", i))
foo 1
foo 2
foo 3
foo 4
> register(MulticoreParam(2))
> res <- bplapply(1:4, function(i) message("foo ", i))
> sessionInfo()
R Under development (unstable) (2015-06-21 r68565)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: Ubuntu 15.04

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] BiocParallel_1.3.31  testthat_0.10.0      devtools_1.8.0       knitr_1.10.5        
[5] BiocInstaller_1.19.8

loaded via a namespace (and not attached):
 [1] Rcpp_0.11.6          digest_0.6.8         crayon_1.3.0         futile.options_1.0.0
 [5] git2r_0.10.1         curl_0.9             xml2_0.1.1           futile.logger_1.4.1 
 [9] lambda.r_1.1.7       tools_3.3.0          rversions_1.0.1      memoise_0.2.1  ​​
biocparallel • 554 views
ADD COMMENTlink modified 4.1 years ago by Valerie Obenchain6.7k • written 4.1 years ago by Michael Love24k
Answer: bplapply, MulticoreParam and messages
0
gravatar for Valerie Obenchain
4.1 years ago by
United States
Valerie Obenchain6.7k wrote:

Hi Mike,

MulticoreParam() probably did return stdout and stderr when it was still using mclapply. Early this year, before the release, I changed it over to use makeCluster(type = "FORK") at which point we lost that behavior and I forgot to check it.

I agree that if log = FALSE the messages should just print to the workspace. This is fixed in 1.3.34.

fun <- function(i) message("foo ", i)
> bplapply(1:3, fun, BPPARAM = MulticoreParam(2))
foo 1 
foo 2
foo 3 
[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

Thanks for catching (and reporting) this.

Val

ADD COMMENTlink written 4.1 years ago by Valerie Obenchain6.7k

thanks for the quick fix

ADD REPLYlink written 4.1 years ago by Michael Love24k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 144 users visited in the last hour