bcm-uga / pcadapt

Performing highly efficient genome scans for local adaptation with R package pcadapt v4
https://bcm-uga.github.io/pcadapt
37 stars 10 forks source link

pcadapt() grabbing too many cores #44

Closed standard-aaron closed 4 years ago

standard-aaron commented 4 years ago

I am running pcadapt() (the command) on our servers and (it looks like) it's trying to grab way too many cores simultaneously.

Is there any way to force down the max # of cores used by pcadapt?

Thanks, Aaron


My script:

#!/usr/bin/env Rscript
library(pcadapt)
filename <- read.pcadapt(path_to_file, type = "bed")
x <- pcadapt(input = filename, K = 20)
privefl commented 4 years ago

Package pcadapt does not use any parallel code. What version are you using?

standard-aaron commented 4 years ago

4.1.0

privefl commented 4 years ago

What is the output of system.time(x <- pcadapt(input = filename, K = 20))?

privefl commented 4 years ago

There might be some matrix computations that are run in parallel if you have some parallelized matrix library linked with R, but I'm not even sure there are in the code.

You can try to use RhpcBLASctl::blas_set_num_threads(1) before running pcadapt to use only one core for matrix computations.

standard-aaron commented 4 years ago

Yup, this solved the issue. I realize this is a pretty generic problem -- thanks so much for nonetheless helping solve it!