没有找到并行计算的键SymPy



我将为并行计算工作?

@everywhere using SymPy
using LinearAlgebra
using SharedArrays, Distributed
julia> xx = Sym[]
julia> @syms x
julia> @sync @distributed for i = 1:3
xx = [xx, x]
end

Unhandled Task ERROR: On worker 3:KeyError: key SymPy [24249f21-da20-56a4-8eb1-6a02cf4ae2e6] not found

https://github.com/JuliaPy/SymPy.jl/issues/483

Distributed用于多进程(而不是多线程)并行。可以把它看作同时运行多个独立的Julia会话。这意味着你需要在所有工人上声明你的导入——@everywhere宏在这里是你的朋友。

@everywhere using SymPy

将在所有worker上导入包,然后允许您在分布式工作负载中跨所有worker使用它的功能。

最新更新