-
Notifications
You must be signed in to change notification settings - Fork 0
Concurrent fit calls panic with RefCell already borrowed #120
Copy link
Copy link
Open
Description
Summary
Concurrent calls to SparseIR.fit from multiple Julia threads panic with RefCell borrow errors.
Minimal Reproducer
using SparseIR
using Random
using Base.Threads: @threads, nthreads
Random.seed!(1)
basis = SparseIR.FiniteTempBasis{Fermionic}(0.7, 8.0, 1e-2)
sampling = SparseIR.MatsubaraSampling(basis)
n = length(SparseIR.sampling_points(sampling))
values = ComplexF64.(randn(n, 8), randn(n, 8))
@threads for _ in 1:nthreads()
fit(sampling, values)
endHow To Run
Threaded (reproduces panic):
julia -t auto /path/to/reproducer.jlSingle-thread control (no panic):
julia -t 1 /path/to/reproducer.jlObserved Output
thread '<unnamed>' panicked at sparse-ir/src/fitters/complex.rs:634:23:
RefCell already borrowed
Environment
- Julia 1.12.5
- SparseIR.jl 2.1.1
- macOS arm64
I originally hit this in a larger solver stack, then reduced it to the snippet above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels