Yes, this is an issue with how @paralell and zip is implemented.

As a temporary fix, you can use 

for (a1,a2) in collect(zip(B,B))
  a1+a2
end

or

for i in 1:min(length(B), length(B))
  a1, a2 = B[i], B[i]
  a1+a2
end


But I'm not sure how that will affect your parallelization efforts.

lørdag 7. mars 2015 00.56.07 UTC+1 skrev Júlio Hoffimann følgende:
>
> Consider this code:
>
> A = eye(3)
> B = {A,A,A}
>
> for (a1,a2) in zip(B,B)
>   a1+a2
> end
>
> It works fine. If I add @parallel (+) it fails with:
>
> exception on 1: ERROR: MethodError: `getindex` has no method matching 
> getindex(::Base.Zip2{Array{Any,1},Array{Any,1}}, ::Int64)
>  in anonymous at no file:1471
>  in anonymous at multi.jl:1320
>  in run_work_thunk at multi.jl:617
>  in run_work_thunk at multi.jl:626
>  in anonymous at task.jl:6
>
> Could you please confirm this is a bug?
>
> -Júlio
>

Reply via email to