I expected the following to work:
using Distributed addprocs(4) d = Dict("a" => 1, "b" => 2) @sync @distributed for (k, v) in d println(k) end
But receive this error:
ERROR: On worker 2: KeyError: key 1:1 not found getindex at ./dict.jl:478 [inlined]
Iterating over a vector in parallel or iterating over the dict sequentially works fine.
Could someone explain what’s going on here?