【发布时间】:2017-01-18 05:24:37
【问题描述】:
我正在使用distributed,这是一个允许并行计算的框架。在这方面,我的主要用例是 NumPy。当我包含依赖于np.linalg 的 NumPy 代码时,我收到与OMP_NUM_THREADS 相关的错误,这与OpenMP library 有关。
一个最小的例子:
from distributed import Executor
import numpy as np
e = Executor('144.92.142.192:8786')
def f(x, m=200, n=1000):
A = np.random.randn(m, n)
x = np.random.randn(n)
# return np.fft.fft(x) # tested; no errors
# return np.random.randn(n) # tested; no errors
return A.dot(y).sum() # tested; throws error below
s = [e.submit(f, x) for x in [1, 2, 3, 4]]
s = e.gather(s)
当我使用 linalg 测试进行测试时,e.gather 失败,因为每个作业都会引发以下错误:
OMP: Error #34: System unable to allocate necessary resources for OMP thread:
OMP: System error #11: Resource temporarily unavailable
OMP: Hint: Try decreasing the value of OMP_NUM_THREADS.
我应该将OMP_NUM_THREADS 设置为什么?
【问题讨论】:
标签: python numpy cluster-computing dask