# @everywhere and Dictionaries

**URL:** <https://discourse.julialang.org/t/everywhere-and-dictionaries/52880>\
**Category:** General Usage\
**Tags:** parallel, distributed\
**Created:** [January 5, 2021, 2:33pm UTC](https://discourse.julialang.org/t/everywhere-and-dictionaries/52880 "2021-01-05T14:33:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 5, 2021, 2:49pm UTC](https://discourse.julialang.org/t/everywhere-and-dictionaries/52880/2 "2021-01-05T14:49:12Z")

</div>

You deleted important parts of the error message, so I can only guess, that you encounter this error or similar:

```julia
julia> using Distributed

julia> addprocs(2)
2-element Array{Int64,1}:
 26
 27

julia> par1=1
1

julia> par2=2
2

julia> @everywhere mod_pars = Dict("par1"=>par1,"par2"=>par2);
ERROR: On worker 2:
UndefVarError: par1 not defined
top-level scope at none:1

```

If I am correct, than you are correct, you need `@everywhere` on `par1` and `par2` as those are unknown at the workers. Or you can interpolate, like:

```julia
@everywhere mod_pars = Dict("par1"=>$par1,"par2"=>$par2);

```

Both ways may be not appropriate for your real problem, so it would be best to provide a [MWE](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

---

_[View the full topic](https://discourse.julialang.org/t/everywhere-and-dictionaries/52880)._
