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

Codegen fixes for Eigen solvers with use of PROCEDURE using TABLE statement #925

Merged
merged 4 commits into from
Sep 7, 2022

Conversation

pramodk
Copy link
Contributor

@pramodk pramodk commented Sep 6, 2022

  • When we have TABLE statement used in a PROCEDURE and if such procedure
    is called from DERIVATIVE block then we end-up calling table statement
    related function from initialize() function:

          struct functor {
              NrnThread* nt;
              glia__dbbs_mod_collection__Ca__granule_cell_Instance* inst;
              int id, pnodecount;
              double v;
              Datum* indexes;
              double old_s, old_u;
    
              void initialize() {
                  rate_glia__dbbs_mod_collection__Ca__granule_cell(id, pnodecount, inst, data, indexes, thread, nt, v, v);
                  ...

    Here we are lacking data and thread variable as members in struct functor.

  • This happens with the glia__dbbs_mod_collection__Ca__granule_cell.mod in Testing & Fixing issues with DBBS-Lab's MOD file collection #888

* table statements can have array variables. Until now only
  scalar variables were supported in code generation.
* we can check symbol table to find out if the variable is
  an array and it's length.
* similar to mod2c implementation, generate code for array
  variable assignments:
     https://github.com/BlueBrain/mod2c/blob/469c74dc7d96bbc5a06a42696422154b4cd2ce28/src/mod2c_core/parsact.c#L942
* with this, `glia__dbbs_mod_collection__Cav2_3__0.mod` from #888
  compiles
…tement

* When we have TABLE statement used in a PROCEDURE and if such procedure
  is called from DERIVATIVE block then we end-up calling table statement
  related function from initialize() function:

  `c++

        struct functor {
            NrnThread* nt;
            glia__dbbs_mod_collection__Ca__granule_cell_Instance* inst;
            int id, pnodecount;
            double v;
            Datum* indexes;
            double old_s, old_u;

            void initialize() {
                rate_glia__dbbs_mod_collection__Ca__granule_cell(id, pnodecount, inst, data, indexes, thread, nt, v, v);
                ...
  `

  Here we are lacking data and thread variable as members in `struct functor`.

* This happens with the `glia__dbbs_mod_collection__Ca__granule_cell.mod` in #888
@bbpbuildbot
Copy link
Collaborator

Logfiles from GitLab pipeline #73298 (:white_check_mark:) have been uploaded here!

Status and direct links:

Copy link
Contributor

@iomaganaris iomaganaris left a comment

Choose a reason for hiding this comment

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

LGTM 👌

Base automatically changed from pramodk/table-var-as-array to master September 7, 2022 11:57
@bbpbuildbot
Copy link
Collaborator

Logfiles from GitLab pipeline #73496 (:white_check_mark:) have been uploaded here!

Status and direct links:

@pramodk pramodk merged commit c7813f8 into master Sep 7, 2022
@pramodk pramodk deleted the pramodk/derivative-procedure-with-table branch September 7, 2022 13:19
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

Successfully merging this pull request may close these issues.

3 participants