fixup! Fix load explosion: use subprocess for binary data plots to avoid thread conflict
* Seems we don't have to set so many variables, `OMP_NUM_THREADS` is enough. Test: Annotate the code for setting other environment variables. It runs normally.
This commit is contained in:
@@ -8,16 +8,12 @@
|
||||
##
|
||||
#################################################
|
||||
|
||||
## Restrict BLAS/OpenMP to one thread per process so that running
|
||||
## Restrict OpenMP to one thread per process so that running
|
||||
## many workers in parallel does not create an O(workers * BLAS_threads)
|
||||
## thread explosion. These variables MUST be set before numpy/scipy
|
||||
## thread explosion. The variable MUST be set before numpy/scipy
|
||||
## are imported, because the BLAS library reads them only at load time.
|
||||
import os
|
||||
os.environ.setdefault("OMP_NUM_THREADS", "1")
|
||||
os.environ.setdefault("OPENBLAS_NUM_THREADS", "1")
|
||||
os.environ.setdefault("MKL_NUM_THREADS", "1")
|
||||
os.environ.setdefault("VECLIB_MAXIMUM_THREADS", "1")
|
||||
os.environ.setdefault("NUMEXPR_NUM_THREADS", "1")
|
||||
|
||||
import numpy
|
||||
import scipy
|
||||
|
||||
Reference in New Issue
Block a user