-
Notifications
You must be signed in to change notification settings - Fork 16
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
Review complexity of sympy generated (scary?) code for KINETIC block #930
Comments
I do not see the problem. We have a matrix represented as a vector and we are filling it with the values. It is scary because it is ~20x20 (afaik). With 20 different variables the problem is deemed to be complex. |
I was also gonna say, this looks fine to me? One potential improvement could be to first initialize all with 0 (when allocating) and then only set the non-zero values. |
More easily visible link to the mod file: |
The generated code will inhibit the compiler from optimizing. For example the assembly of the following lines doesn't extract any common subexpressions:
This is due to the indirection in the terms, e.g. Despite this, the runtime of this MOD file is dominated by the Newton solver which calls this function; the overall improvement to runtime is very small for this MOD file. |
The details of how KINETIC blocks work have changed enough to turn this issue stale. |
While fixing the issues in #888, I came across glia__dbbs_mod_collection__cdp5__CR.mod file (use attached version!). By using following nmodl command:
./bin/nmodl glia__dbbs_mod_collection__cdp5__CR.mod host --c passes --inline sympy --analytic
The generated code from sympy for KINETIC block looks like:
The text was updated successfully, but these errors were encountered: