weizhouUMICH / SAIGE

GNU Lesser General Public License v3.0
187 stars 72 forks source link

Limit BLAS thread usage in Step2, fixing a repeatedly reported problem with resource usage. #381

Closed pettyalex closed 2 years ago

pettyalex commented 2 years ago

Some BLAS implementations will attempt to use as many threads as there are logical processors for BLAS operations even where that is not optimal. This change uses the library RhpcBLASctl to set the number of threads that BLAS will use to 1 before running Step2, and then reset it back to the value it was originally set to after the step has completed.

This PR updates install_packages.R to indicate that RhpcBLASctl, but doesn't update the Conda package or the Docker image, as I'm not entirely sure how they are installing dependencies. RhpcBLASctl is available from conda-forge, so I expect it could be easily added there.

This will solve the root cause of several reported user issues, including: https://github.com/weizhouUMICH/SAIGE/issues/380 https://github.com/weizhouUMICH/SAIGE/issues/313 https://github.com/weizhouUMICH/SAIGE/issues/341 https://github.com/weizhouUMICH/SAIGE/issues/102