BLAS(Basic Linear Algebra Subprograms)笙什,翻譯為基礎(chǔ)線性代數(shù)子程序庫西采,里面擁有大量已經(jīng)編寫好的關(guān)于線性代數(shù)運算的程序。OpenBLAS是其中一個實現(xiàn)了相關(guān)運算的開源程序庫,其他軟件在開發(fā)的時候就不需要額外造輪子矿咕,直接調(diào)用相關(guān)的API即可在讶。
之前在使用OrthoFinder遇到了類似的問題煞抬,見https://github.com/davidemms/OrthoFinder/issues/68,最近在使用SMC++
的時候也因為一樣的問題報錯
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 1024 current, 2583728 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 1024 current, 2583728 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 1024 current, 2583728 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 1024 current, 2583728 max
解決方法很簡單构哺,在運行代碼之前設(shè)置一個環(huán)境變量
export OPENBLAS_NUM_THREADS=1
問題的本質(zhì)是革答,如果你的Python Numpy使用OpenBLAS進行數(shù)值運算,那么他可能創(chuàng)建過多的線程曙强,超過了系統(tǒng)的限制残拐,因此將其限制為1即可。