Distributed.RemoteException key error

Hi, I am new to Julia and this forum too. I am using the distributed computing facility in JuliaBox and I seem to encounter the following error while using the fetch() function. Can someone guide me with the issue here?

using  Distributed
addprocs(6)

r = @spawnat 4 rand(4,4)
Future(4, 1, 8, nothing)

fetch(r)
output:
Distributed.RemoteException(4, CapturedException(KeyError(Distributed [top-level]), Any[(getindex at dict.jl:477 [inlined], 1), (root_module at loading.jl:962 [inlined], 1), (deserialize_module at Serialization.jl:894, 1), (handle_deserialize at Serialization.jl:799, 1), (deserialize at Serialization.jl:722, 1), (deserialize_datatype at Serialization.jl:1192, 1), (handle_deserialize at Serialization.jl:775, 1), (deserialize at Serialization.jl:722, 1), (handle_deserialize at Serialization.jl:782, 1), (deserialize at Serialization.jl:722 [inlined], 1), (deserialize_msg at messages.jl:99, 1), (#invokelatest#1 at essentials.jl:709 [inlined], 1), (invokelatest at essentials.jl:708 [inlined], 1), (message_handler_loop at process_messages.jl:185, 1), (process_tcp_streams at process_messages.jl:142, 1), (#101 at task.jl:333, 1)]))
'''

You might need to load the Distributed package on the workers after you add them. Try running

addprocs(6)
@everywhere using Distributed

and then your code

1 Like