[英]Limit CPU cores available to `scipy` when interpolating?
When using scipy
RBF interpolation routines it seems that all the cores are used by default.使用
scipy
RBF 插值例程时,似乎默认使用所有内核。 This is ideal to speed up the computation but not ideal on machines where there are other jobs running and the resources are shared.这对于加快计算速度是理想的,但在有其他作业正在运行且资源共享的机器上并不理想。
Is there any way to limit the number of CPU cores available to scipy for computation when interpolating?插值时有什么方法可以限制 scipy 可用于计算的 CPU 内核数量?
Ok, as suggested doing好的,按照建议做
os.environ["OPENBLAS_NUM_THREADS"] = "4"
before importing anything else related to numpy
or scipy
fixed the issue在导入与
numpy
或scipy
相关的任何其他内容之前修复了该问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.