Hi Michael @nrnhines:
I realised that if one makes a call to
CVode(cvode mem, tout, yout, &tret, itask);
and tout (the target time instant) and t0 (the current time instant) are too close, the following error message will show up:
[CV_TOO_CLOSE]
tout too close to t0 to start integration.
This will fail from stepping, and if called inside a while (t<tout) loop, it will hang the execution indefinitely. This issue is hard to reproduce and occurred to me only on very large networks, above 32K neurons.
A quick fix is to enforce an initial minimum step size, e.g. a call to:
CVodeSetInitStep(cvode_mem_f, step_size);
for having a larger first step, or ideally
CVodeSetMinStep(cvode_mem_f, step_size);
to guarantee that state is always advanced by some minimum timestep value. However, if step_size is too large, then the following error may occur:
[CV_CONV_FAILURE]
the corrector convergence failed repeatedly or with |h| = hmin.
So the trick is to pick a step size big enough to advance the state, while being small enough to make the solver converge within the tolerance values provided. From my testing, 1e-5 is a good value.
This ticket requests the default minimum or initial variable step size in NEURON to be increased from the actual value of 0, to avoid CV_TOO_CLOSE errors.
Hi Michael @nrnhines:
I realised that if one makes a call to
and
tout(the target time instant) andt0(the current time instant) are too close, the following error message will show up:This will fail from stepping, and if called inside a
while (t<tout)loop, it will hang the execution indefinitely. This issue is hard to reproduce and occurred to me only on very large networks, above 32K neurons.A quick fix is to enforce an initial minimum step size, e.g. a call to:
for having a larger first step, or ideally
to guarantee that state is always advanced by some minimum timestep value. However, if
step_sizeis too large, then the following error may occur:So the trick is to pick a step size big enough to advance the state, while being small enough to make the solver converge within the tolerance values provided. From my testing,
1e-5is a good value.This ticket requests the default minimum or initial variable step size in NEURON to be increased from the actual value of 0, to avoid
CV_TOO_CLOSEerrors.