Limit the number of nodes in DESeq2
1
1
Entering edit mode
Sebastian ▴ 10
@0ed48ed3
Last seen 17 months ago
Sweden

Hi!

I am using DESeq2 on an in-house server which is shared among a handful of users and has not a cueing system. I want to set a limit on the number of nodes DESeq2 uses, for which I used MulticoreParams as follows:


parallelParams <- MulticoreParam(workers = 4,progressbar = TRUE, log = TRUE)
register(parallelParams,default=TRUE)
parallelParams

Which prints the following:

class: MulticoreParam
  bpisup: FALSE; bpnworkers: 4; bptasks: 2147483647; bpjobname: BPJOB
  bplog: TRUE; bpthreshold: INFO; bpstopOnError: TRUE
  bpRNGseed: ; bptimeout: 2592000; bpprogressbar: TRUE
  bpexportglobals: TRUE; bpforceGC: TRUE
  bplogdir: NA
  bpresultdir: NA
  cluster type: FORK

However, when I run DESeq2 and inspect the CPU work using htop I see that it is using all of the available resources, not only the 4 nodes I asked for.

I have also tried the following mentioned on the DESeq2 vignette:

dds<-DESeq(dds,parallel=TRUE,BPPARAM=parallelParams)

but the result is the same.

I am running my code inside a singularity container pulled from docker biocontainers (tag 1.34.0--r41h399db7b_0). Running sessionInfo() inside the container prints:

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)

Matrix products: default
BLAS/LAPACK: /usr/local/lib/libopenblasp-r0.3.18.so

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

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

loaded via a namespace (and not attached):
[1] compiler_4.1.1

Thank you in advance,

Sebastian

DESeq2 BiocParallel • 663 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.0k
@atpoint-13662
Last seen 28 minutes ago
Germany

It’s not DESeq2/BiocParallel causing this but the multithreaded BLAS library. It is indeed an annoyance and I have always wondered why multithreading with all cores is a default in R. Anyway, you can use the RhpcBLASctl package to disable that multithreading. I always run this on top of any script:

RhpcBLASctl::omp_set_num_threads(1)
RhpcBLASctl::blas_set_num_threads(1)
ADD COMMENT

Login before adding your answer.

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