Bioconductor / BiocParallel

Bioconductor facilities for parallel evaluation
https://bioconductor.org/packages/BiocParallel
65 stars 29 forks source link

MulticoreParam bplapply unable to restart upon interrupt #243

Closed gdagstn closed 1 year ago

gdagstn commented 1 year ago

Hello, coming from this issue, I have experienced in many instances - beyond that package - an odd behaviour.

Upon killing a function call that makes use of bplapply with MulticoreParam() I am no longer able to run the function again, as it throws the following error:

Error in d$value$value : $ operator is invalid for atomic vectors

I think a reproducible example could be running the code below and killing it with Ctrl-C, then trying to run it again:

a = BiocParallel::bplapply(seq_len(100), function(x) rnorm(x * 10^6, 0, 1), 
                                            BPPARAM = BiocParallel::MulticoreParam(workers = 2, progressbar = TRUE))

I need to restart the R session in order to use it. This happens both in RStudio and on the terminal, and it does not happen using SnowParam().

Should I specify additional parameters to the bplapply call with MulticoreParam() to avoid this behaviour?

System and BiocParallel version R version 4.2.1 (2022-06-23) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Monterey 12.5.1 BiocParallel_1.32.5
mtmorgan commented 1 year ago

This should be fixed in Bioconductor release (BiocParallel version 1.32.6) and devel (version 1.33.10) when the BiocParallel package builds and propagates, some time in the next several days. Thanks for the clear bug report!