Bioconductor / BiocParallel

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

`bpnworkers(SnowParam(x))` is not integer #232

Closed LTLA closed 1 year ago

LTLA commented 1 year ago

Seems odd to get back a non-integer from bpnworkers:

library(BiocParallel)
typeof(bpnworkers(SnowParam(3)))
## [1] "double"

bpnworkers(SnowParam(3.5)) # wow, half a worker!
## [1] 3.5

This is breaking the scuttle unit tests.

In contrast, MulticoreParam and SerialParam have no such problems:

typeof(bpnworkers(MulticoreParam(3)))
## [1] "integer"

typeof(bpnworkers(SerialParam()))
## [1] "integer"
Session information ``` R Under development (unstable) (2022-11-10 r83332) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.6 LTS Matrix products: default BLAS: /home/luna/Software/R/trunk/lib/libRblas.so LAPACK: /home/luna/Software/R/trunk/lib/libRlapack.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C time zone: America/Los_Angeles tzcode source: system (glibc) attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] BiocParallel_1.33.0 loaded via a namespace (and not attached): [1] compiler_4.3.0 parallel_4.3.0 codetools_0.2-18 ```