Open WardBrian opened 9 months ago
Here's what gdb reports when chain 1 and 4 are stuck:
```
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7f54f8ea9740 (LWP 13426) "sir" 0x000055c3a6af4708 in cvStep ()
2 Thread 0x7f54f81fb640 (LWP 13427) "sir" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
3 Thread 0x7f54f7dfa640 (LWP 13428) "sir" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
4 Thread 0x7f54f79f9640 (LWP 13429) "sir" 0x000055c3a694c420 in operator new(unsigned long)@plt ()
(gdb) bt
#0 0x000055c3a6af4708 in cvStep ()
#1 0x000055c3a6afca60 in CVode ()
#2 0x000055c3a6984d9e in stan::math::cvodes_integrator<1, sir_model_namespace::sir_variadic2_functor__, Eigen::Map
Description
I have noticed some odd behavior using
ode_adams
andSTAN_THREADS
. This does not recur when usingode_bdf
orode_rk45
.Example
Using a simple SIR model, courtesy of @charlesm93:
data:
inits
When compiled via cmdstan with STAN_THREADS=1, I then run with
It seems to vary a bit between runs, but when run repeatedly the most common outcome is that two chains run/print their progress, until completion, and then the process hangs. I have recreated this on two separate linux systems.
strace
reports a lot of using ofsched_yield
fromtbb
, but otherwise there is nothing happening.gdb
seems to implicateset_zero_all_adjoints
in a backtrace, but not in any way I can track down.Expected Output
Expect all four chains to run simultaneously and the program to not hang.
Current Version:
v4.7.0