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

Fixed addition of SOLVE block to kernel's FOR loop #636

Merged
merged 1 commit into from
May 11, 2021

Conversation

georgemitenkov
Copy link
Collaborator

@georgemitenkov georgemitenkov commented May 11, 2021

This is a small PR to fix append_statements_from_block function in LLVM helper visitor. Before, if nonspecific current was not specified, the whole BREAKPOINT block would be added to the kernel body. This led to cases when SOLVE block was together with the actual solution to DERIVATIVE:

VOID nrn_state_test(INSTANCE_STRUCT *mech){
    INTEGER id
    INTEGER node_id
    DOUBLE v
    for(id = 0; id<mech->node_count-1; id = id+2) {
        node_id = mech->node_index[id]
        v = mech->voltage[node_id]
        mech->m[id] = mech->m[id]+(1.0-exp(mech->dt*(1.0)))*(-(0.0)/(1.0)-mech->m[id])
        SOLVE states METHOD cnexp
        // Rest of BREAKPOINT code
    }
    // Rest of kernel
}

Now, a statement expression is checked before appending so that SOLVE block is not added.

@bbpbuildbot
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Contributor

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for the catch!

@pramodk pramodk merged commit 524b292 into llvm May 11, 2021
@pramodk pramodk deleted the georgemitenkov/llvm-solve-block-bug branch May 11, 2021 23:14
pramodk pushed a commit that referenced this pull request Mar 8, 2022
* Fix `append_statements_from_block` function in LLVM helper visitor.
* Before, if nonspecific current was not specified, the whole `BREAKPOINT`
   block would be added to the kernel body.
* This led to cases when `SOLVE` block was together with the actual
    solution to `DERIVATIVE`
iomaganaris pushed a commit that referenced this pull request May 10, 2022
* Fix `append_statements_from_block` function in LLVM helper visitor.
* Before, if nonspecific current was not specified, the whole `BREAKPOINT`
   block would be added to the kernel body.
* This led to cases when `SOLVE` block was together with the actual
    solution to `DERIVATIVE`
iomaganaris pushed a commit that referenced this pull request May 12, 2022
* Fix `append_statements_from_block` function in LLVM helper visitor.
* Before, if nonspecific current was not specified, the whole `BREAKPOINT`
   block would be added to the kernel body.
* This led to cases when `SOLVE` block was together with the actual
    solution to `DERIVATIVE`
iomaganaris pushed a commit that referenced this pull request Sep 15, 2022
* Fix `append_statements_from_block` function in LLVM helper visitor.
* Before, if nonspecific current was not specified, the whole `BREAKPOINT`
   block would be added to the kernel body.
* This led to cases when `SOLVE` block was together with the actual
    solution to `DERIVATIVE`
iomaganaris pushed a commit that referenced this pull request Sep 15, 2022
* Fix `append_statements_from_block` function in LLVM helper visitor.
* Before, if nonspecific current was not specified, the whole `BREAKPOINT`
   block would be added to the kernel body.
* This led to cases when `SOLVE` block was together with the actual
    solution to `DERIVATIVE`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants