stephenslab / susieR

R package for "sum of single effects" regression.
https://stephenslab.github.io/susieR
Other
176 stars 46 forks source link

About setting the threads #177

Closed Jesson-mark closed 1 year ago

Jesson-mark commented 1 year ago

Dear authors of susieR,

I'm running susieR to do fine-mapping of GWAS summary statistics and installed Rfast package as suggested by susieR. I found that it will use many threads (maybe all CPUs of my computer) than just one thread and I didn't found any parameters that can set number of threads. I wonder if this multi-processing phenomenon is based on something embedded in Rfast package or used internal of susieR. Could you give some suggestions about how to control the number of threads used by susieR?

I'm grateful for your help.

Jie Wang.

gaow commented 1 year ago

@Jesson-mark We dont have multi-threading code in susieR package ... what linear algebra library do you use? Apart from Rfast, I wonder if the linear algebra routine matters. You can use sessionInfo() in R to see it.

pcarbo commented 1 year ago

Some of the multithreaded operations might be due to your BLAS installation, or perhaps OpenMP, which is used by Rfast. So the multithreading can be controlled through the R or shell variables specific to these libraries.

Jesson-mark commented 1 year ago

@gaow @pcarbo Thanks for your prompt reply! I found the linear algebra used by R is BLAS/LAPACK which may be contained in MKL, so setting export MKL_NUM_THREADS=$threads can help. Thanks a lot!