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
When I create a SDEProblem from a SDEFunction I built via a SDESystem I get sefault when trying to solve an EnsembleProblem for large enough trajectories. Bug does not happen if I build the SDEProblem directly from a SDESystem or ReactionSystem.
Expected behavior
I should not get a segfault.
Minimal Reproducible Example 👇
using Catalyst, StochasticDiffEq, ModelingToolkit, SciMLBase
using ModelingToolkit: t_nounits as t, D_nounits as D
@parameters c1 c2
@variablesX(t) Y(t)
eqs = [D(X) ~-c1*X + c2*Y,
D(Y) ~ c1*X - c2*Y]
noiseeqs = [-sqrt(abs(c1*X)) sqrt(abs(c2*Y));
sqrt(abs(c1*X)) -sqrt(abs(c2*Y))]
@named sdesys =SDESystem(eqs, noiseeqs, t, [X, Y], [c1, c2]; tspan = (0, 1000.0))
sdesys =complete(sdesys)
# SDESystem via Catalyst
rn =@reaction_networkbegin@speciesX(t)=50.0Y(t)=100.0
c1, X --> Y
c2, Y --> X
end
u0 = [X =>50.0, Y =>100.0]
ps = [c1 =>0.5, c2 =>1.0]
sdefun =SDEFunction(sdesys, first.(u0), first.(ps))
sdefun =SDEFunction(sdesys, first.(u0), first.(ps))
sprob_fun =SDEProblem(sdefun, last.(u0), [0.0, 10.0], last.(ps))
sprob_sys =SDEProblem(rn, u0, [0.0, 10.0], ps)
sprob_rn =SDEProblem(sdesys, u0, [0.0, 10.0], ps)
#=This section works as expectedeprob = EnsembleProblem(sprob_sys)sol = solve(eprob, EM(), EnsembleSerial(), trajectories = 1000, saveat = 1:10, dt = 1e-3)eprob = EnsembleProblem(sprob_rn)sol = solve(eprob, EM(), EnsembleSerial(), trajectories = 1000, saveat = 1:10, dt = 1e-3)=#
eprob =EnsembleProblem(sprob_fun)
sol =solve(eprob, EM(), EnsembleSerial(), trajectories =10000, saveat =1:10, dt =1e-3)
Error & Stacktrace ⚠️
[14149] signal 11 (128): Segmentation fault
in expression starting at /home/perssos/Dropbox/PhD/tmp/test_fail/MVE.jl:37
gc_mark_outrefs at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:2784 [inlined]
gc_mark_loop_serial_ at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:2946
gc_mark_loop_serial at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:2969
gc_mark_loop at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:3151 [inlined]
_jl_gc_collect at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:3540
ijl_gc_collect at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:3901
maybe_collect at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:922 [inlined]
jl_gc_pool_alloc_inner at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:1327
jl_gc_pool_alloc_noinline at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:1394 [inlined]
jl_gc_alloc_ at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/julia_internal.h:523 [inlined]
jl_gc_alloc at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/gc.c:3954
_new_genericmemory_ at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/genericmemory.c:56
jl_genericmemory_copy_slice at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/genericmemory.c:350
copy at ./array.jl:350 [inlined]
safecopy at /home/perssos/.julia/packages/ResettableStacks/lP2VI/src/core.jl:27 [inlined]
_broadcast_getindex_evalf at ./broadcast.jl:678 [inlined]
_broadcast_getindex at ./broadcast.jl:651 [inlined]
#17 at ./broadcast.jl:1102 [inlined]
ntuple at ./ntuple.jl:50 [inlined]
copy at ./broadcast.jl:1102 [inlined]
materialize at ./broadcast.jl:872 [inlined]
copyat_or_push! at /home/perssos/.julia/packages/ResettableStacks/lP2VI/src/core.jl:35
setup_next_step! at /home/perssos/.julia/packages/DiffEqNoiseProcess/Moaax/src/noise_interfaces/noise_process_interface.jl:174 [inlined]
setup_next_step! at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/integrators/integrator_utils.jl:2 [inlined]
#__init#108 at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:682
__init at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:18 [inlined]
__init at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:18 [inlined]
#__solve#107 at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:6
__solve at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:1 [inlined]
__solve at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:1 [inlined]
__solve at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:1 [inlined]
__solve at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:1 [inlined]
__solve at /home/perssos/.julia/packages/StochasticDiffEq/OmgKe/src/solve.jl:1 [inlined]
#solve_call#35 at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:635
solve_call at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:592 [inlined]
#solve_up#44 at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:1142 [inlined]
solve_up at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:1120 [inlined]
#solve#42 at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:1057 [inlined]
solve at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:1047 [inlined]
#batch_func#681 at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:193 [inlined]
batch_func at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:180 [inlined]
#690 at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:252
unknown function(ip: 0x77f5cab7e0ac)
responsible_map at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:245
#solve_batch#689 at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:251 [inlined]
solve_batch at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:250 [inlined]
macro expansion at ./timing.jl:421 [inlined]
#679 at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:146
with_logstate at ./logging/logging.jl:522
with_logger at ./logging/logging.jl:632 [inlined]
#__solve#678 at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:130
__solve at /home/perssos/.julia/packages/SciMLBase/elLNZ/src/ensemble/basic_ensemble_solve.jl:122 [inlined]
#solve#46 at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:1158 [inlined]
solve at /home/perssos/.julia/packages/DiffEqBase/HyX7M/src/solve.jl:1155
unknown function(ip: 0x77f5cab603a2)
jl_apply at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
do_call at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/interpreter.c:126
eval_value at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/interpreter.c:223
eval_stmt_value at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/interpreter.c:174 [inlined]
eval_body at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/interpreter.c:666
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/interpreter.c:824
jl_toplevel_eval_flex at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/toplevel.c:943
jl_toplevel_eval_flex at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/toplevel.c:886
ijl_toplevel_eval_in at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/toplevel.c:994
eval at ./boot.jl:430 [inlined]
include_string at ./loading.jl:2734
_include at ./loading.jl:2794
include at ./Base.jl:557
jfptr_include_46865.1 at /home/perssos/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
exec_options at ./client.jl:323
_start at ./client.jl:531
jfptr__start_73560.1 at /home/perssos/.julia/juliaup/julia-1.11.4+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
true_main at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/jlapi.c:900
jl_repl_entrypoint at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/src/jlapi.c:1059
main at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-11/cli/loader_exe.c:58
unknown function(ip: 0x77f62b42a1c9)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function(ip: 0x4010b8)
Allocations: 65015280 (Pool: 65013556; Big: 1724); GC: 30
Segmentation fault (core dumped)
Environment (please complete the following information):
Describe the bug 🐞
When I create a
SDEProblem
from aSDEFunction
I built via aSDESystem
I get sefault when trying to solve anEnsembleProblem
for large enoughtrajectories
. Bug does not happen if I build theSDEProblem
directly from aSDESystem
orReactionSystem
.Expected behavior
I should not get a segfault.
Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
The crash happens only if I simulate many trajectories (
trajectories >= 10000
).The text was updated successfully, but these errors were encountered: