You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've ran into errors (including seg faults) when using substitute in a multi-threaded for loop, see e.g.
using Catalyst
t = default_t()
species_vec = @species X1(t) X2(t) X3(t)
@parameters k[1:6]
x_pairs = [(xa, xb) for xa in species_vec, xb in species_vec if xa !== xb]
rx_vec = [
Reaction(kval, [xa], [xb]) for ((xa, xb), kval) in zip(x_pairs, k)
]
@Threads.threads for _ in 1:1000
rates = substitute.(oderatelaw.(rx_vec), Ref([k => ones(length(k))]));
# other code using `rates` omitted
end
As someone who isn't familiar with the internals of Symbolics.jl, my guess is that this is due to the use of parallelism in Symbolics.jl. Is there some way to 'disable' parallelism, or other ways to make this code thread-safe?
I've ran into errors (including seg faults) when using
substitute
in a multi-threaded for loop, see e.g.As someone who isn't familiar with the internals of
Symbolics.jl
, my guess is that this is due to the use of parallelism inSymbolics.jl
. Is there some way to 'disable' parallelism, or other ways to make this code thread-safe?Trace:
The text was updated successfully, but these errors were encountered: