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

Why did I get IO errors when broadcasting higher precision (bits >= 98) ArbFloat variables to distributed workers? #74

Open
Edsnowden233 opened this issue Dec 21, 2024 · 6 comments

Comments

@Edsnowden233
Copy link

My test code:

using ArbNumerics, Distributed
rmprocs(workers())
addprocs(1)
@everywhere dn = 90
@everywhere using ArbNumerics
@everywhere setworkingprecision(ArbFloat,bits=dn)
@everywhere function check_data(x)
    println("Worker $(myid()): Data check: ", typeof(x), " with value: ", x)
end
for i = 1:10
    @everywhere setworkingprecision(ArbFloat,bits=dn+$i)
    a = ArbFloat(pi)
    try
        @everywhere check_data($a)
    catch e
        println("The error happened at bits = $(dn+i)! ",e)
    end
end

BigFloat has no such problem.

@JeffreySarnoff
Copy link
Owner

I have no experience with Distributed.jl.
Are you on the Julia Slack?

@Edsnowden233
Copy link
Author

Edsnowden233 commented Dec 21, 2024

I have no experience with Distributed.jl. Are you on the Julia Slack?

Thank you for replying. Did you reproduce the error? I am a freshman in Julia. Just create an account on Julia Slack as you mention it. What can I do?

@JeffreySarnoff
Copy link
Owner

JeffreySarnoff commented Dec 22, 2024 via email

@Edsnowden233
Copy link
Author

Ed, I added you the slack channel #distributed. On slack, click Channels > manage > browse > search for channel distributed and select Join (at right when you hover the mouse over the channel name). Your question is suited to the people there. [It is ok to include the fact that you asked me, and I suggested asking on that channel.] Best, Jeffrey

Thank you so much! I'll try.

@Edsnowden233
Copy link
Author

Ed, I added you the slack channel #distributed. On slack, click Channels > manage > browse > search for channel distributed and select Join (at right when you hover the mouse over the channel name). Your question is suited to the people there. [It is ok to include the fact that you asked me, and I suggested asking on that channel.] Best, Jeffrey

Hi Jeff,
I have discussed the problem with someone in the distributed channel. He said this is more likely related to compatibility and memory issues. Quote:

this is quite unlikely to be a Distributed issue, more like that the Distributed use just (vastly) increases chance that the bug is triggered

I'd say that libARB is not compatible (or is too old) for libGMP provided by julia

My code runs on a local single computer with multi-core so there should be no network issue. He suggested it might be related to lib Arb_jll and FLINT_jll.

I have used the gdb to test the code running on the distributed worker. Here is the message:

Thread 1 "julia" received signal SIGSEGV, Segmentation fault.
0x00007f890efe63e4 in ?? ()

Here is another error related to the previous ones:

From worker 3: Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
From worker 3: Exception: EXCEPTION_ACCESS_VIOLATION at 0x3b16c19 -- _arf_set_round_mpn at /workspace/srcdir/arb/arf\set_round_mpn.c:26
From worker 3: in expression starting at none:0
From worker 3: _arf_set_round_mpn at /workspace/srcdir/arb/arf\set_round_mpn.c:26
From worker 3: Allocations: 948387191 (Pool: 948386328; Big: 863); GC: 144

He also said this is very easy to fix:

should be a relatively easy fix, they need to add overloads for the Serialization routines for this
basically just something that is able to export the number to a form that can be carried over the network safely

My Julia version is 1.11.2

Best,
Ed

@stevengj
Copy link
Contributor

stevengj commented Dec 23, 2024

It looks like the problem is that you need to implement custom Serialization.serialize and Serialization.deserialize methods (#77), as a commented here. Otherwise you are relying on the fallback methods that just read and write the raw struct contents, which will fail for structs containing C pointers.

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

3 participants