eon._forksafe¶
Keep a process usable after it forks with an OpenBLAS pool running.
OpenBLAS 0.3.30 registers a pthread_atfork prepare handler that shuts the pool down and can leave server_lock held. The next factorization in the parent then waits inside blas_thread_init. sh launches eonclient with os.fork, and subprocess takes the same path when it cannot vfork, so both hit it. Drop to one thread before that handler runs, and put the previous count back in the parent. The child keeps one thread until it execs.
Module Contents¶
Functions¶
The OpenBLAS shared library this process can call, or None. |
|
Register the fork handlers once. A missing OpenBLAS is a no-op. |