cultivarium / GenomeSPOT

Predict oxygen, temperature, salinity, and pH preferences of bacteria and archaea from a genome
https://cultivarium.org/
MIT License
27 stars 1 forks source link

Option to set number of threads - auto-cancel on HPC #9

Open jlw-ecoevo opened 2 weeks ago

jlw-ecoevo commented 2 weeks ago

Hi!

Very excited to try this out. FYI it would be very nice to have an option for the user to set the number of threads used by this program/dependencies. I was trying to test it on an HPC and it kept getting cancelled for trying to initiate multiple threads on the head node and it took me a while to figure out what was happening.

Adding this to the main script fixed it, though I imagine leads to slow overall performance:

import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'

Would be nice to be able to set this with a flag.

jlw-ecoevo commented 2 weeks ago

for the record, this was the StackOverflow thread that helped figure this out: https://stackoverflow.com/questions/52026652/openblas-blas-thread-init-pthread-create-resource-temporarily-unavailable