Skip to content

Knowledge Base

macOS

sudo with Touch ID

Read markdown on command line with mdless

HPC

Exceeding the Rlimit

Contribution by David Heesterbeek

When running Python code on multiple cores issues can occur. You might encounter the following error message (numerical values will most like vary):

OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 36: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 1024 current, 1032808 max`

This means the total amount of processes that a user can run is exceeded. When the total process count is larger than the RLIMIT_NPROC value, the error above is outputted and the task is shut down.

Multiple threads can accelerate the program but too many threads for small tasks can cause problems. The amount of threats can be controlled by using:

$ export OPENBLAS_NUM_THREADS=1

If your task benefits from more threads you might want to try to change the 1 to the following numerical values: 1, 4, 8, 16, 31, 32, 60-64. Depending on the architecture of the used CPU’s, these will provide the optimal speed for your program.

For more information: