我尝试在HPC中使用多处理来加速我的代码。它运行正常,但我添加了一些计算,突然它开始发布这个错误。我运行它没有多重处理,它很好。在
前20个函数的执行与多处理配合得很好,但之后就开始滚雪球了,这个错误越来越频繁地出现。在
在日志中写到“在某个点超过了步骤内存限制”和“原因:'RuntimeError('maximum recursion depth when calling a Python object',)'”
import os
from multiprocessing import Pool
def eigencen(filename):
--DO complicated stuff here--
for f in os.listdir(FOLDER):
list_fn.extend([f])
def evaluation(f_list):
return list(Pool(processes=28).map(eigencen, f_list))
evaluation(list_fn)
我能修好它吗?如果不进行多重处理,它将永远无法运行。在
尝试使用
concurrent.futures
模块:相关问题 更多 >
编程相关推荐