I had similar code working on v0.4, but now fails on v0.5
module TestModule
export test1, test2, test3
test1(id) = remotecall_fetch(myid, id)
test2(id) = remotecall_fetch(()->VERSION, id)
test3(id) = remotecall_fetch(eval, id, :(Sys.CPU_CORES))
end
using TestModule
addprocs(2)
test1(2) # works
test2(2) # error
test3(2) # error
And here’s the output:
julia> test1(2)
2
julia> test2(2)
ERROR: On worker 2:
UndefVarError: TestModule not defined
in deserialize at .\serialize.jl:602
in handle_deserialize at .\serialize.jl:581
in deserialize at .\serialize.jl:541
in deserialize_datatype at .\serialize.jl:822
in handle_deserialize at .\serialize.jl:571
in deserialize_msg at .\multi.jl:120
in message_handler_loop at .\multi.jl:1317
in process_tcp_streams at .\multi.jl:1276
in #620 at .\event.jl:68
in #remotecall_fetch#608(::Array{Any,1}, ::Function, ::Function, ::Base.Worker) at .\multi.jl:1070
in remotecall_fetch(::Function, ::Base.Worker) at .\multi.jl:1062
in #remotecall_fetch#611(::Array{Any,1}, ::Function, ::Function, ::Int64) at .\multi.jl:1080
in test2(::Int64) at .\REPL[1]:4
julia> test3(2)
ERROR: On worker 2:
UndefVarError: ##1#2 not defined
in deserialize_datatype at .\serialize.jl:823
in handle_deserialize at .\serialize.jl:571
in deserialize_msg at .\multi.jl:120
in message_handler_loop at .\multi.jl:1317
in process_tcp_streams at .\multi.jl:1276
in #620 at .\event.jl:68
in #remotecall_fetch#608(::Array{Any,1}, ::Function, ::Function, ::Base.Worker) at .\multi.jl:1070
in remotecall_fetch(::Function, ::Base.Worker) at .\multi.jl:1062
in #remotecall_fetch#611(::Array{Any,1}, ::Function, ::Function, ::Int64) at .\multi.jl:1080
in test3(::Int64) at .\REPL[1]:5
Why is it failing?