BiocParallel-1.4.0 bplapply bug when using nested lists and MulticoreParam
1
0
Entering edit mode
zigaavsec • 0
@zigaavsec-9294
Last seen 8.3 years ago
Germany

I just discovered a bug in BiocParallel +, version 1.4.0 when using nested lists and MulticoreParam (with BatchJobs it works fine): bplapply applies a function to each subelement of x elements:

library(BiocParallel)
param <- MulticoreParam(1)
register(param)

x <- list(a=list(1,2),b=list(3,5))

bplapply(x,I)
## $a
## [1] 1

## $b
## [1] 2

## $<NA>
## [1] 3

## $<NA>
## [1] 5

lapply(x,I)
## $a
## [[1]]
## [1] 1

## [[2]]
## [1] 2


## $b
## [[1]]
## [1] 3

## [[2]]
## [1] 5

My session info: 

> devtools::session_info()
Session info -------------------------------------------------------------------
setting  value                     
version  R version 3.2.2 (2015-08-14)
system   x86_64, linux-gnu         
ui       X11                       
language (EN)                      
collate  en_US.UTF-8               
tz       Europe/Berlin             
date     2015-12-01                  

Packages -----------------------------------------------------------------------
package        * version date       source      
BiocParallel   * 1.4.0   2015-11-18 Bioconductor
devtools         1.9.1   2015-09-11 CRAN (R 3.2.2)
digest           0.6.8   2014-12-31 CRAN (R 3.2.2)
futile.logger    1.4.1   2015-04-20 CRAN (R 3.2.2)
futile.options   1.0.0   2010-04-06 CRAN (R 3.2.2)
lambda.r         1.1.7   2015-03-20 CRAN (R 3.2.2)
memoise          0.2.1   2014-04-22 CRAN (R 3.2.2)

Is this a known error? Is it fixed in BiocParallel version 1.5.0?

Thanks!

 

 

biocparallel bug • 1.2k views
ADD COMMENT
0
Entering edit mode
@valerie-obenchain-4275
Last seen 2.2 years ago
United States

Thanks for reporting the bug and providing an example. This was a special case where number of workers = 1; so not really parallel at all. In this case, the method should dispatch to SerialParam() which is now does. You may have noticed the same code with workers > 1 gave the correct results. When no workers are specified they are auto-detected with multicoreWorkers():

> bplapply(x, I, BPPARAM=MulticoreParam())
$a
[[1]]
[1] 1

[[2]]
[1] 2


$b
[[1]]
[1] 3

[[2]]
[1] 5

This is fixed in BiocParallel 1.4.1 in release and 1.5.2 in devel. Both versions are available immediately in svn or with biocLite() tomorrow noon-ish PST.

Valerie

ADD COMMENT

Login before adding your answer.

Traffic: 670 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