Julia 1.1版本,如下代码时会报错
using Distributed
using LinearAlgebra
addprocs(72)
@sync begin
@distributed for i = 1:0.001:10
T = [i i + 1; i + 2 i + 3];
V = eigvals(T);
end
end
ERROR: LoadError: On worker 2:
UndefVarError: eigvals not defined
去掉@sync begin
或者addprocs(1)
时运算正常。
谢谢!