Repository navigation
end simulation correction when simulation has callbacks - #815
rnwatanabe wants to merge 2 commits into
Conversation
|
Thanks for reporting the bug. I think that for backends that round The problem with your proposed solution is that it stops the callback loop up to a full timestep early, even in the normal on-grid case, so Could we instead use the same half-timestep tolerance already applied a few lines above (the This terminates the off-grid case (it stops once within half a timestep of the target, which is the grid-rounding tolerance) without stopping short or dropping the final-timestep callbacks. It'd also be worth adding a regression test that reproduces the hang. The existing |
|
Thanks again for reporting this. While testing, I found that stopping one time step early can end the run before |
NEURON stops at the last time step before an off-grid target time, so when `time_point` is off the time grid, `t` cannot reach it and the loop does not end. A callback asking for less than one time step ahead also stalls the loop. Reported in #815.
Sometimes with long simulations with callbacks, the simulation never ends. Here is a small correction in the run_until() method in the control.py file that eliminates this issue.