# How to change code on workers - Revise.jl not able

**URL:** <https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847>\
**Category:** Julia at Scale\
**Created:** [February 5, 2018, 10:06pm UTC](https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847 "2018-02-05T22:06:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)\
**Post date:** [February 5, 2018, 10:06pm UTC](https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847/1 "2018-02-05T22:06:00Z")

</div>

I have a custom package that runs on multiple processes. If I `addprocs(n); using Mypkg` it will load the code to each worker (I can tell because of the annoying Nullable warnings).

Now when I edit the source code, my Revise.jl will change the code on my REPL, worker 1, but not on the parallel workers. The only way I have found to fix this is to remove the workers, add them and re-use:

```julia
map(rmprocs, workers())
addprocs(n)
using Mypkg

```

This takes a long time, but beats restarting. It seems to me that an `@everywhere clever-revise-command` would do the trick. Anyone have a clever way to do this?

Separately, I noticed that Revise.jl doesn’t revise when you start with `julia -p n` I [submitted an issue for that](https://github.com/timholy/Revise.jl/issues/82).

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)\
**Post date:** [February 5, 2018, 10:15pm UTC](https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847/2 "2018-02-05T22:15:03Z")

</div>

I just read the Revise.jl code. The only thing exposed is `revise()` and just tried this to no avail. The below code runs without error, but does not update the packages loaded on the workers.

```julia
@everywhere using Revise
@everywhere revise()

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 6, 2018, 7:05am UTC](https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847/3 "2018-02-06T07:05:22Z")

</div>

try

```julia
revise(module_name)

```

---

<div class="post-metadata">

**Author:** ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)\
**Post date:** [February 6, 2018, 7:24am UTC](https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847/4 "2018-02-06T07:24:01Z")

</div>

That’s getting closer - when I run `@everywhere revise(Mypkg)` it generates lots of warnings about methods being overwritten (a sign that Revise is working). I think it’s possible that those messages are all from worker 1 in the REPL.

But, the updated worker code `info("Thank you Tamas!")` does not appear in worker output until I do the worker remove/add/refresh. So close!

---

<div class="post-metadata">

**Author:** ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)\
**Post date:** [February 6, 2018, 3:19pm UTC](https://discourse.julialang.org/t/how-to-change-code-on-workers-revise-jl-not-able/8847/5 "2018-02-06T15:19:27Z")

</div>

@tim.holy is amazing! He patched Revise.jl so to [enable the code updates on remote workers](https://github.com/timholy/Revise.jl/pull/85). It’s only on 0.7 right now, but it’s nice to know it’s fixed, and maybe I’ll patch 0.6 with bits of that code.
