Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

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

Merged
pramodk merged 4 commits into
masterfrom
pramodk/derivative-procedure-with-table
Sep 7, 2022
Merged

Codegen fixes for Eigen solvers with use of PROCEDURE using TABLE statement#925
pramodk merged 4 commits into
masterfrom
pramodk/derivative-procedure-with-table

Conversation

@pramodk

@pramodk pramodk commented Sep 6, 2022

Copy link
Copy Markdown
Contributor
  • 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
Copy Markdown
Collaborator

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

Status and direct links:

@iomaganaris iomaganaris left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
JCGoran pushed a commit to neuronsimulator/nrn that referenced this pull request Mar 12, 2025
…tement (BlueBrain/nmodl#925)

* 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 BlueBrain/nmodl#888

NMODL Repo SHA: BlueBrain/nmodl@c7813f8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants