# Debugging computer crash during ODE solve

**URL:** https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009
**Category:** Modelling & Simulations
**Created:** [November 9, 2022, 10:21pm UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009 "2022-11-09T22:21:08Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [November 16, 2022, 3:18pm UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009/21 "2022-11-16T15:18:29Z")

</div>

The workaround is just to do `sparse=true` without `jac=true`. We need to change that codegen. We just haven’t yet.

---

<div class="post-metadata">

### Author: ![johnb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnb/32/44115_2.png) [@johnb](https://discourse.julialang.org/u/johnb)
#### Post date: [November 16, 2022, 7:32pm UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009/22 "2022-11-16T19:32:27Z")

</div>

Hi Chris, at least in my case, it seems like ` sparse = true` gives the same crashing issues as before. With no kwargs, my problem takes ~24 seconds to solve, and with `sparse=true`, it crashes my laptop and takes ~1500 seconds on my desktop.  
A pass through structural simplify takes just slightly less time than just `sparse=true`, and running with just `jac=true` takes at least an hour on my system, with crazy ram usage. I ended the task at that point.

Since I can get a solution without using typical acceleration techniques in a reasonable amount of time, I will just do that for now. 24 seconds is fast enough to get things done. Just figured I’d let you know that the sparsity detection seems to have an issue as well.

Edit: after updating to MTK 8.33.1, no-kwarg solve crashes my laptop and takes \>1000 seconds on my desktop.

---

<div class="post-metadata">

### Author: ![xtalax](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xtalax/32/35293_2.png) [@xtalax](https://discourse.julialang.org/u/xtalax)
#### Post date: [November 16, 2022, 11:53pm UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009/23 "2022-11-16T23:53:37Z")

</div>

Ouch, can you confirm which previous version of MTK did not have this regression?

---

<div class="post-metadata">

### Author: ![johnb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnb/32/44115_2.png) [@johnb](https://discourse.julialang.org/u/johnb)
#### Post date: [November 17, 2022, 1:00am UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009/24 "2022-11-17T01:00:41Z")

</div>

I apologize for not being able to be more helpful, things seem to be very inconsistent. Code will sometimes run properly, and sometimes not run properly with different versions of MTK going back to 8.22.1. In a .jl script file, the no-kwarg solve consistently does not work, even after reverting the MTK version, but in a notebook .ipynb file, it seems to work much more consistently, and even the `jac=true, sparse=true` solves seem to work sometimes.

I will continue to test and try to figure out what is causing issues, but right now it seems almost random, except that jupyter notebooks work better than .jl files.

---

<div class="post-metadata">

### Author: ![xtalax](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xtalax/32/35293_2.png) [@xtalax](https://discourse.julialang.org/u/xtalax)
#### Post date: [November 17, 2022, 12:54pm UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009/25 "2022-11-17T12:54:36Z")

</div>

That is very strange, perhaps it is related to what is compiled first?

---

<div class="post-metadata">

### Author: ![johnb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnb/32/44115_2.png) [@johnb](https://discourse.julialang.org/u/johnb)
#### Post date: [November 17, 2022, 2:43pm UTC](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009/26 "2022-11-17T14:43:26Z")

</div>

I’m not sure. The issues persist through restarts of the computer, and the code is exactly the same, but I don’t know whether notebook code blocks are compiled all at once rather than line by line. My solution for now is to use the notebook and not update any packages. I am curious about whether there are operating system differences, so I’ll also try to run my code in WSL to see if things work differently there.

[Previous page](https://discourse.julialang.org/t/debugging-computer-crash-during-ode-solve/90009.md?page=1)
