Open aryaamgen opened 2 years ago
Thanks for the nice report. I’m able to reproduce the issue. Fix on the way.
Thanks for the nice report. I’m able to reproduce the issue. Fix on the way.
Wow that was quick. Thanks @yizhang-yiz What was going on under the hood?
My guess is it has something to do with mpi-dedicated solver but I haven't been able to look deeper. I was planning to fix it last week but obviously need more time.
Description
This bug tends to happen (but not always) when an infusion event (evid=1) has a rate that make it such that the infusion ends very close to the time of the next event. For example if amt=0.5 and rate=0.5 and the infusion starts at time=6 then it will end at time=7 and the bug will occur when you have another event that occurs close to time=7.
This only happens when I compile with MPI.
Specifically, the error I get is about an index being out of range somewhere:
Example
I tried to simplify the model and provide a few cases to best illustrate the bug. For some of these I don't get the error and for some I do. Below is the Stan model and the R code to run the different cases.
Simple Example Stan Model
Simple R Script illustrating
Expected Output
When it works the chains finish. Otherwise, I get the indexing error above.
Current Version:
Using the latest version of Torsten, v0.90.