How do I make Revise.jl work in multiple workers environment?


I have a simple module file (MyMod.jl), say:

module MyMod
using Distributed
using Base.Threads

function func()
	println("calling func()")
	r = @spawn  sqrt(4)
end # MyMod

Now I do the following in REPL (or include(“mymain.jl”))

using Distributed
using Base.Threads

@everywhere push!(LOAD_PATH, @__DIR__)
@everywhere using MyMod: func


It succeeds at first time. However after any changes in func() and call func(), the code fails to run throwing some error message unless I restart Julia:

call func() 2
ERROR: On worker 3:
UndefVarError: ##5#6 not defined
deserialize_datatype at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Serialization\src\Serialization.jl:1186
handle_deserialize at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Serialization\src\Serialization.jl:775

Could anyone help me with this?

If you’re on Julia 1.3 and using Revise 2.3.2, this should now work.


Oh it is working very gracefully now. Thank you so much for your time and efforts. Julia without Revise is nothing! :slight_smile:

1 Like