# Share an already defined variable to all processes

**URL:** https://discourse.julialang.org/t/share-an-already-defined-variable-to-all-processes/13421
**Category:** Julia at Scale
**Tags:** question
**Created:** [August 14, 2018, 8:34am UTC](https://discourse.julialang.org/t/share-an-already-defined-variable-to-all-processes/13421 "2018-08-14T08:34:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [August 14, 2018, 8:34am UTC](https://discourse.julialang.org/t/share-an-already-defined-variable-to-all-processes/13421/1 "2018-08-14T08:34:21Z")

</div>

If I have a variable already defined in one process, how can I share it with all the other processes? `@everywhere foo=1` does this for a new definition of `foo`. But suppose I already assigned `foo` to a value in the current process. Now I would like to use this same variable name to access this value in all processes. What’s the correct way to do it?

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [August 14, 2018, 8:39am UTC](https://discourse.julialang.org/t/share-an-already-defined-variable-to-all-processes/13421/2 "2018-08-14T08:39:41Z")

</div>

I think I figured it out. In Julia 0.6.4:

```julia
@eval @everywhere foo=$foo;

```

In Julia 1.0 I think it’s the same except that the `@eval` is not required.

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [August 14, 2018, 11:41am UTC](https://discourse.julialang.org/t/share-an-already-defined-variable-to-all-processes/13421/3 "2018-08-14T11:41:00Z")

</div>

See [https://github.com/ChrisRackauckas/ParallelDataTransfer.jl](https://github.com/ChrisRackauckas/ParallelDataTransfer.jl) that’s built to solve that exact problem.

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [August 14, 2018, 5:20pm UTC](https://discourse.julialang.org/t/share-an-already-defined-variable-to-all-processes/13421/4 "2018-08-14T17:20:55Z")

</div>

It doesn’t seem to support Julia 1.0 yet.
