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

isolate_protocols=True causing NEURON to reset dt #424

Closed
wthun opened this issue Nov 20, 2022 · 8 comments
Closed

isolate_protocols=True causing NEURON to reset dt #424

wthun opened this issue Nov 20, 2022 · 8 comments
Assignees

Comments

@wthun
Copy link

wthun commented Nov 20, 2022

When passing a simulator with a fixed, non-standard time step to ephys.evaluators.CellEvaluator, I receive:

Exception: NrnSimulator: Some process has changed the time step dt of Neuron since the creation of this NrnSimulator object. Not sure this is intended:
current dt: 0.025
init dt: 0.1

This only happens when setting isolate_protocols to True, so I guess this happens due to the dt value not persisting when NEURON is imported onto new threads (i.e. around line 252 in protocols.py)?

I see the same behaviour in a minimal example.

@DrTaDa
Copy link
Contributor

DrTaDa commented Nov 21, 2022

Hello @wthun ,

Thank you for opening this issue.

The error is expected in this case. It happens because you ask both for cvode=True and a specific time step dt of 0.1. These two requirements are incompatible since cvode means varying time step. Therefore if you wish to use cvode you shouldn't pass a dt when initializing the simulator object.

The error message is not very explicit. We will work on it.

@wthun
Copy link
Author

wthun commented Nov 21, 2022

Hello,

I seem to get the same error when disabling cvode. There is an example attached in the original post, where passing
nrn = ephys.simulators.NrnSimulator(dt=dt, cvode_active=False) and then passing that simulator to the evaluator object results in the same error.

@DrTaDa
Copy link
Contributor

DrTaDa commented Nov 21, 2022

Indeed. I am sorry I misunderstood your example. We will fix that.

@wthun
Copy link
Author

wthun commented Nov 21, 2022

No worries and thanks for the help!

@AurelienJaquier
Copy link
Collaborator

Hi!
I can run your example without any error in linux, but the error shows up when I run under macos. Do you confirm @wthun that you also encountered this error on macos?

It looks like this is out of the scope of BluePyOpt, and should be solved at the NEURON level. I'll open an issue there first, and see if we have to change BluePyOpt once they have acted on it.

Thanks for raising this issue @wthun

@wthun
Copy link
Author

wthun commented Nov 21, 2022

Yes, but I originally encountered this on Linux. I receive the same error If I run the same example using Ipyparallel and passing lview.map_sync to the optimiser ((like this). In that case, isolate_protocols doesn't seem to help.

@AurelienJaquier
Copy link
Collaborator

Alright, the latest version of BluePyOpt should work fine with custom dt, both when isolate_protocols=True on macos, and when using ipyparallel.

@AurelienJaquier
Copy link
Collaborator

I'll close this issue. If you still have problems @wthun do not hesitate to re-open it.

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

No branches or pull requests

3 participants