【发布时间】:2017-08-08 08:06:22
【问题描述】:
我有一个函数,我想在主函数中调用它。所有参数都是sharedArray,我们有一个变量是type。当我想运行程序时出现错误。
@everywhere type dty{T <: Real}
...... (some variable)
end
@everywhere function func2!(v::dty,
out::SharedArray,
out2::SharedArray)
........
end
function func1()
...
out = SharedArray{Float64,2}(n,m)
out2 = SharedArray{Float64,2}(n,m)
......
func2!(v , out, out2)
end
错误:
MethodError: no method matching func2!(::dty{Float64}, ::Array{Float64,2}, ::SharedArray{Float64,2}, ::SharedArray{Float64,2})
Closest candidates are:
func2!(::dty, ::SharedArray, ::SharedArray) at In[3]:64
【问题讨论】: