Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ERROR: cannot serialize a pointer" with @async and @sync #8

Closed
andreasnoack opened this issue Oct 1, 2015 · 4 comments
Closed

"ERROR: cannot serialize a pointer" with @async and @sync #8

andreasnoack opened this issue Oct 1, 2015 · 4 comments

Comments

@andreasnoack
Copy link
Member

With the latest changes I've just pushed to master I can copy a DArray into DistMatrix on the MPI workers and get the RemoteRefs back. E.g.

julia> using MPI

julia> man = MPIManager(np = 2);

julia> addprocs(man);

julia> using DistributedArrays

julia> using Elemental

julia> A = drandn(100,100);

julia> tmp = Elemental.toback(A)
1x2 Array{Any,2}:
 RemoteRef{Channel{Any}}(2,1,16)  RemoteRef{Channel{Any}}(3,1,17)

and then I can compute the singular values with

julia> for r in tmp
       remotecall(() -> println(svdvals(fetch(r))), r.where)
       end

julia>  From worker 3:  [19.928126878869584
    From worker 2:  [19.928126878869584
    From worker 3:   19.248234662565334
    From worker 2:   19.248234662565334
    From worker 2:   18.378572289263257
    From worker 3:   18.378572289263257
    From worker 2:   18.271178929809935

which is fine and I will start wrapping this array of RemoteRefs in some type representing the remote DistMatrix. However, I'd like to use the @sync for ... @async remotecall_wait as well, but if I try

julia> @time @sync for r in tmp
       @async remotecall_fetch(() -> svdvals(fetch(r)), r.where)
       end
    From worker 3:  fatal error on 3: ERROR: cannot serialize a pointer
    From worker 2:  fatal error on 2: ERROR: cannot serialize a pointer
    From worker 3:   in serialize at serialize.jl:418 (repeats 2 times)
    From worker 2:   in serialize at serialize.jl:418 (repeats 2 times)

cc: @jakebolewski

@andreasnoack
Copy link
Member Author

See JuliaLang/julia#13190

@JeffBezanson
Copy link

Does this use case require serializing pointers bit-for-bit, or would it be enough to deserialize them as NULL?

@andreasnoack
Copy link
Member Author

I'm pretty sure that NULL is fine. I shoud be able to avoid serializing pointers, but the main problem is when developing, I sometimes accidentially fetch a pointer and all my workers crash.

@andreasnoack
Copy link
Member Author

Fixed by JuliaLang/julia@77b2527 and JuliaLang/julia@aa1076d. Now we only have to wait on 0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants