Python 3.X 多处理提升 Python 失败

Python 3.X Multiprocessing Boost Python Failed

我正在尝试使用多处理将 Boost 包装函数映射到多个内核。这在 python 2.7 中工作正常,但在 python 3.8 中失败。我知道显而易见的答案:如果 python 2.7 可行,你为什么不直接使用它呢?嗯,问题是这个软件的当前版本只包装了 python 3.X。有谁知道 python 3 中 boost-wrapped 代码的酸洗错误的解决方法?

multiprocessing.pool.MaybeEncodingError: Error sending result: 
'<multiprocessing.pool.ExceptionWithTraceback object at 0x7ff19e308f40>'. Reason: 
'PicklingError("Can't pickle <class 'Boost.Python.ArgumentError'>: import of module 'Boost.Python' failed")'

这个错误没有提供信息。在 python 2.7 中,它自动将 float 对象转换为 int 对象,但在 python 3.8 中,multiprocessing 模块中的这种自动转换不会发生。因此传递给 boost-wrapped c++ 代码的参数类型错误。将它们更改为正确的类型修复了此错误。