Skip to content

Rerunnable code in matlab #7

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

Open
jpalmer opened this issue Jul 5, 2016 · 0 comments
Open

Rerunnable code in matlab #7

jpalmer opened this issue Jul 5, 2016 · 0 comments

Comments

@jpalmer
Copy link
Collaborator

jpalmer commented Jul 5, 2016

Summary

At the moment, if you try and restart the code within matlab - for example running run_model twice, matlab will segfault.

The segfault is caused by an issue with the arguments to the first call but this isn't the real problem - we need a way to call the init functions again.

The problem is that we only have a single entry point from matlab which does make things a little more difficult.

detail

the code in the run_model script
does something like:

[V,outputs]=conductance('dummy',output);

this is because we don't know how big the voltage array needs to be
(on the matlab side).

So then in the C code, since the setup has been called, it tries to
use dummy as an input voltage matrix which obviously fails.

My suggestion: in mexfunction in src/conductance.c add some check on
the input arguments and then use that to set setup_done to 0 -
basically you want to do:

if input[0]=='dummy' then setup_done=0

obviously, not quite this simple, but that is the rough idea

Brandon is currently working on this

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

1 participant