Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVode may select different timesteps for some models on Windows and Linux #1324

Open
nrnhines opened this issue Jun 7, 2021 · 0 comments
Open
Labels

Comments

@nrnhines
Copy link
Member

nrnhines commented Jun 7, 2021

Because exp(x) and pow(x,y) can generate slightly different results for some argument values on Linux and Windows,
round off error may eventuate in cvode selecting different values for a time step. After that the series of time steps may have
quite different values and numbers of time steps. This does not affect the accuracy of the simulation as all time steps obey the
absolute tolerance criteria selected by the user. For the specific model studied, it was helpful to use the digest-debug branch
which allowed a file to be generated that printed y, y' for every cvode f(y, t) (and jacobian M*x = b) calculation in whch the
SHA1 hash of the y and y' arrays made it easy to find a specific call in which the arrays were different on the different machines, and whether the fault was in the cvode code or the NEURON y' = f(y, t) evaluation. prcellstate with a precision of %.18g along with replacing GLOBAL with RANGE variables and mirroring LOCAL variables with RANGE variables, was helpful in isolating the issue to exp and pow. As cvode also makes use of pow, steering that to a hoc_pow and all exp in mod files to a hoc_Exp
function that rounds the mantissa of the exp and pow result to 32 bit mantissa accuracy gave simulations having identical results on Windows and Linux. It is presently not known how much of the 53 bit mantissa can be retained and still generate identical results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants