Git Product home page Git Product logo

bluebrain / nmodl Goto Github PK

View Code? Open in Web Editor NEW
51.0 15.0 15.0 124.71 MB

Code Generation Framework For NEURON MODeling Language

Home Page: https://bluebrain.github.io/nmodl/

License: Apache License 2.0

CMake 3.33% C++ 79.60% C 0.03% Python 6.54% LLVM 2.82% Lex 0.19% Yacc 5.52% CSS 0.03% HTML 0.02% JavaScript 0.40% Dockerfile 0.05% Shell 0.15% Pascal 0.01% NMODL 1.31%
neuron-simulator hpc compilers code-generation neuroscience dsl nmodl

nmodl's Introduction

The NMODL Framework

github workflow Build Status codecov CII Best Practices

The NMODL Framework is a code generation engine for NEURON MODeling Language (NMODL). It is designed with modern compiler and code generation techniques to:

  • Provide modular tools for parsing, analysing and transforming NMODL
  • Provide easy to use, high level Python API
  • Generate optimised code for modern compute architectures including CPUs, GPUs
  • Flexibility to implement new simulator backends
  • Support for full NMODL specification

About NMODL

Simulators like NEURON use NMODL as a domain specific language (DSL) to describe a wide range of membrane and intracellular submodels. Here is an example of exponential synapse specified in NMODL:

NEURON {
    POINT_PROCESS ExpSyn
    RANGE tau, e, i
    NONSPECIFIC_CURRENT i
}
UNITS {
    (nA) = (nanoamp)
    (mV) = (millivolt)
    (uS) = (microsiemens)
}
PARAMETER {
    tau = 0.1 (ms) <1e-9,1e9>
    e = 0 (mV)
}
ASSIGNED {
    v (mV)
    i (nA)
}
STATE {
    g (uS)
}
INITIAL {
    g = 0
}
BREAKPOINT {
    SOLVE state METHOD cnexp
    i = g*(v - e)
}
DERIVATIVE state {
    g' = -g/tau
}
NET_RECEIVE(weight (uS)) {
    g = g + weight
}

Installation

See INSTALL.rst for detailed instructions to build the NMODL from source.

Try NMODL with Docker

To quickly test the NMODL Framework’s analysis capabilities we provide a docker image, which includes the NMODL Framework python library and a fully functional Jupyter notebook environment. After installing docker and docker-compose you can pull and run the NMODL image from your terminal.

To try Python interface directly from CLI, you can run docker image as:

docker run -it --entrypoint=/bin/sh bluebrain/nmodl

And try NMODL Python API discussed later in this README as:

$ python3
Python 3.6.8 (default, Apr  8 2019, 18:17:52)
>>> from nmodl import dsl
>>> import os
>>> examples = dsl.list_examples()
>>> nmodl_string = dsl.load_example(examples[-1])
...

To try Jupyter notebooks you can download docker compose file and run it as:

wget "https://raw.githubusercontent.com/BlueBrain/nmodl/master/docker/docker-compose.yml"
DUID=$(id -u) DGID=$(id -g) HOSTNAME=$(hostname) docker-compose up

If all goes well you should see at the end status messages similar to these:

[I 09:49:53.923 NotebookApp] The Jupyter Notebook is running at:
[I 09:49:53.923 NotebookApp] http://(4c8edabe52e1 or 127.0.0.1):8888/?token=a7902983bad430a11935
[I 09:49:53.923 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-1-open.html
    Or copy and paste one of these URLs:
        http://(4c8edabe52e1 or 127.0.0.1):8888/?token=a7902983bad430a11935

Based on the example above you should then open your browser and navigate to the URL http://127.0.0.1:8888/?token=a7902983bad430a11935.

You can open and run all example notebooks provided in the examples folder. You can also create new notebooks in my_notebooks, which will be stored in a subfolder notebooks at your current working directory.

Using the Python API

Once the NMODL Framework is installed, you can use the Python parsing API to load NMOD file as:

from nmodl import dsl

examples = dsl.list_examples()
nmodl_string = dsl.load_example(examples[-1])
driver = dsl.NmodlDriver()
modast = driver.parse_string(nmodl_string)

The parse_file API returns Abstract Syntax Tree (AST) representation of input NMODL file. One can look at the AST by converting to JSON form as:

>>> print (dsl.to_json(modast))
{
  "Program": [
    {
      "NeuronBlock": [
        {
          "StatementBlock": [
            {
              "Suffix": [
                {
                  "Name": [
                    {
                      "String": [
                        {
                          "name": "POINT_PROCESS"
                        }
                    ...

Every key in the JSON form represent a node in the AST. You can also use visualization API to look at the details of AST as:

from nmodl import ast
ast.view(modast)

which will open AST view in web browser:

ast_viz

Vizualisation of the AST in the NMODL Framework

The central Program node represents the whole MOD file and each of it’s children represent the block in the input NMODL file. Note that this requires X-forwarding if you are using the Docker image.

Once the AST is created, one can use exisiting visitors to perform various analysis/optimisations. One can also easily write his own custom visitor using Python Visitor API. See Python API tutorial for details.

The NMODL Framework also allows us to transform the AST representation back to NMODL form as:

>>> print (dsl.to_nmodl(modast))
NEURON {
    POINT_PROCESS ExpSyn
    RANGE tau, e, i
    NONSPECIFIC_CURRENT i
}

UNITS {
    (nA) = (nanoamp)
    (mV) = (millivolt)
    (uS) = (microsiemens)
}

PARAMETER {
    tau = 0.1 (ms) <1e-09,1000000000>
    e = 0 (mV)
}
...

High Level Analysis and Code Generation

The NMODL Framework provides rich model introspection and analysis capabilities using various visitors. Here is an example of theoretical performance characterisation of channels and synapses from rat neocortical column microcircuit published in 2015:

nmodl-perf-stats

Performance results of the NMODL Framework

To understand how you can write your own introspection and analysis tool, see this tutorial.

Once analysis and optimization passes are performed, the NMODL Framework can generate optimised code for modern compute architectures including CPUs (Intel, AMD, ARM) and GPUs (NVIDIA, AMD) platforms. For example, C++, OpenACC and OpenMP backends are implemented and one can choose these backends on command line as:

$ nmodl expsyn.mod sympy --analytic

To know more about code generation backends, see here. NMODL Framework provides number of options (for code generation, optimization passes and ODE solver) which can be listed as:

$ nmodl -H
NMODL : Source-to-Source Code Generation Framework [version]
Usage: /path/<>/nmodl [OPTIONS] file... [SUBCOMMAND]

Positionals:
  file TEXT:FILE ... REQUIRED           One or more MOD files to process

Options:
  -h,--help                             Print this help message and exit
  -H,--help-all                         Print this help message including all sub-commands
  --verbose=info                        Verbose logger output (trace, debug, info, warning, error, critical, off)
  -o,--output TEXT=.                    Directory for backend code output
  --scratch TEXT=tmp                    Directory for intermediate code output
  --units TEXT=/path/<>/nrnunits.lib
                                        Directory of units lib file

Subcommands:
host
  HOST/CPU code backends
  Options:
    --c                                   C/C++ backend (true)

acc
  Accelerator code backends
  Options:
    --oacc                                C/C++ backend with OpenACC (false)

sympy
  SymPy based analysis and optimizations
  Options:
    --analytic                            Solve ODEs using SymPy analytic integration (false)
    --pade                                Pade approximation in SymPy analytic integration (false)
    --cse                                 CSE (Common Subexpression Elimination) in SymPy analytic integration (false)
    --conductance                         Add CONDUCTANCE keyword in BREAKPOINT (false)

passes
  Analyse/Optimization passes
  Options:
    --inline                              Perform inlining at NMODL level (false)
    --unroll                              Perform loop unroll at NMODL level (false)
    --const-folding                       Perform constant folding at NMODL level (false)
    --localize                            Convert RANGE variables to LOCAL (false)
    --global-to-range                     Convert GLOBAL variables to RANGE (false)
    --localize-verbatim                   Convert RANGE variables to LOCAL even if verbatim block exist (false)
    --local-rename                        Rename LOCAL variable if variable of same name exist in global scope (false)
    --verbatim-inline                     Inline even if verbatim block exist (false)
    --verbatim-rename                     Rename variables in verbatim block (true)
    --json-ast                            Write AST to JSON file (false)
    --nmodl-ast                           Write AST to NMODL file (false)
    --json-perf                           Write performance statistics to JSON file (false)
    --show-symtab                         Write symbol table to stdout (false)

codegen
  Code generation options
  Options:
    --layout TEXT:{aos,soa}=soa           Memory layout for code generation
    --datatype TEXT:{float,double}=soa    Data type for floating point variables
    --force                               Force code generation even if there is any incompatibility
    --only-check-compatibility            Check compatibility and return without generating code
    --opt-ionvar-copy                     Optimize copies of ion variables (false)

Documentation

We are working on user documentation, you can find current drafts of :

Citation

If you would like to know more about the the NMODL Framework, see following paper:

  • Pramod Kumbhar, Omar Awile, Liam Keegan, Jorge Alonso, James King, Michael Hines and Felix Schürmann. 2019. An optimizing multi-platform source-to-source compiler framework for the NEURON MODeling Language. In Eprint : arXiv:1905.02241

Support / Contribuition

If you see any issue, feel free to raise a ticket. If you would like to improve this framework, see open issues and contribution guidelines.

Examples / Benchmarks

The benchmarks used to test the performance and parsing capabilities of NMODL Framework are currently being migrated to GitHub. These benchmarks will be published soon in following repositories:

Funding & Acknowledgment

The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology. In addition, the development was supported by funding from the National Institutes of Health (NIH) under the Grant Number R01NS11613 (Yale University) and the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 785907 (Human Brain Project SGA2).

Copyright © 2017-2023 Blue Brain Project, EPFL

nmodl's People

Contributors

1uc avatar alexsavulescu avatar alkino avatar bbpgithubaudit avatar cattabiani avatar ctrl-z-9000-times avatar ferdonline avatar fouriaux avatar heerener avatar iomaganaris avatar jcgoran avatar jorblancoa avatar kotsaloscv avatar lkeegan avatar matz-e avatar mgeplf avatar nileshpatra avatar nrnhines avatar ohm314 avatar olupton avatar pramodk avatar sergiorg-hpc avatar sharkovsky avatar st4rl3ss avatar tristan0x avatar weinaji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmodl's Issues

Eigen and CUDA compatibility

This ticket is track discussion related to CUDA compatibility of codegen passes especially Eigen library.

Based on this stackoverflow question, we don't need to do anything extra to get kernels compatible with CUDA backend.

Documentation setup and integration

We need setup documentation for NMODL. Possible option is Doxygen + Sphinx + Breathe + exhale.

@tristan0x has created sphinx-doc branch in basalt repository. The documentation has been pushed to the gh-pages branch of the basalt repository to host it with GitHub (can be accessed here). To generate the documentation to ./build/sphinx/html/ in basalt repository :

	python setup.py test
	python setup.py build_sphinx

SympyConductance python exception from GluSynapse.mod

Might be unrelated to this but when I test GluSynapse.mod I see:

± |inline_euler → ./bin/nmodl ~/workarena/repos/bbp/neurodamus/lib/modlib/GluSynapse.mod --enable-sympy
[NMODL] [info] :: Processing /Users/kumbhar/workarena/repos/bbp/neurodamus/lib/modlib/GluSynapse.mod
[NMODL] [warning] :: SympyConductance :: python exception: 'Integer' object is not callable
[NMODL] [warning] :: SympyConductance :: analytic differentiation of ionic current not possible
[NMODL] [warning] :: SympyConductance :: python exception: 'Integer' object is not callable
[NMODL] [warning] :: SympyConductance :: analytic differentiation of ionic current not possible

Is 'Integer' object is not callable something that can be fixed?

Originally posted by @pramodk in #25 (comment)

parser error on numbers with leading "+"

./bin/nmodl_parser <(echo "PARAMETER { x = +5 }")
gives the error

[NMODL] [info] :: Processing file : /proc/self/fd/12
terminate called after throwing an instance of 'std::runtime_error'
  what():  NMODL Parser Error : syntax error, unexpected +, expecting REAL or INTEGER or DEFINEDVAR or - [Location : 1.17]
[1]    22042 abort      ./bin/nmodl_parser <(echo "PARAMETER { x = +5 }")

Is this the expected behaviour?

A minus sign, or no sign both work fine:
./bin/nmodl_parser <(echo "PARAMETER { x = -5 }")
./bin/nmodl_parser <(echo "PARAMETER { x = 5 }")

Issue with standalone lexer : fails to run simple mod file

Recent changes to lexer return types (see bb64950) has introduced following regression :

→ ~/nmodl/bin/lexer/nmodl_lexer --file coreneuron/hh.mod

 NMODL Lexer : Processing file : coreneuron/hh.mod
          TITLE at [1.1-5] type 258
 hh.mod   squid sodium, potassium, and leak channels
....
          UNITS at [16.1-5] type 328
              { at [16.7] type 368
              ( at [17.9] type 370
Assertion failed: (*yytypeid_ == typeid (T)), function as, file /Users/kumbhar/workarena/repos/bbp/incubator/nocmodl/cmake-build-debug/src/parser/nmodl/nmodl_parser.hpp, line 372.
Abort trap: 6

CMake doesn't update nmodl folder in build directory when it changes

Currently the nmodl directory is copied post build, but if it changes later then it is not updated:

relevant part from pybind/CMakeLists.txt:

add_custom_command(TARGET _nmodl POST_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/nmodl
                           ${CMAKE_BINARY_DIR}/nmodl
                   COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:_nmodl>
                           ${CMAKE_BINARY_DIR}/nmodl)

Issues with derivimplicit method from code generation

If we use mod file with derivimplicit method we get:

Scanning dependencies of target coreneuron
[ 19%] Building CXX object coreneuron/CMakeFiles/coreneuron.dir/expsyn.cpp.o
[ 20%] Building CXX object coreneuron/CMakeFiles/coreneuron.dir/exp2syn.cpp.o
[ 21%] Building CXX object coreneuron/CMakeFiles/coreneuron.dir/hh.cpp.o
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:343:37: error: use of undeclared identifier
      'nrn_cons_newtonspace'
            *newtonspace1(thread) = nrn_cons_newtonspace(3, pnodecount);
                                    ^
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:425:73: error: use of undeclared identifier
      'derivimplicit_states_hh'
        int reset = nrn_newton_thread(*newtonspace1(thread), 3, slist2, derivimplicit_states_hh, dlist2, id, pno...
                                                                        ^
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:436:40: error: use of undeclared identifier
      'ionvar'
        rates_hh(id, pnodecount, inst, ionvar, data, indexes, thread, nt, v, v);
                                       ^
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:470:73: error: use of undeclared identifier
      'derivimplicit_states_hh'
            derivimplicit_thread(3, hh_global.slist1, hh_global.dlist1, derivimplicit_states_hh, id, pnodecount...
                                                                        ^
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:490:9: error: use of undeclared identifier
      'thread_mem_init'; did you mean 'Memb_func::thread_mem_init_'?
        thread_mem_init(hh_global.ext_call_thread);
        ^~~~~~~~~~~~~~~
        Memb_func::thread_mem_init_
/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/nrnoc/membfunc.h:56:12: note: 'Memb_func::thread_mem_init_'
      declared here
    void (*thread_mem_init_)(ThreadDatum*); /* after Memb_list._thread is allocated */
           ^
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:490:9: error: invalid use of non-static data
      member 'thread_mem_init_'
        thread_mem_init(hh_global.ext_call_thread);
        ^~~~~~~~~~~~~~~
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl/coreneuron/hh.cpp:491:9: error: use of undeclared identifier
      'thread_data_in_use'
        thread_data_in_use = 0;
        ^
7 errors generated.
make[2]: *** [coreneuron/CMakeFiles/coreneuron.dir/hh.cpp.o] Error 1
make[1]: *** [coreneuron/CMakeFiles/coreneuron.dir/all] Error 2
make: *** [all] Error 2

newton_numerical_diff numeric constants

if in the future a float version is needed of the newton_numerical_diff solver, the ULP-related constants

constexpr double SQUARE_ROOT_ULP = 1e-7;
constexpr double CUBIC_ROOT_ULP = 1e-5;

should be changed appropriately, e.g.

constexpr float SQUARE_ROOT_ULP = 1e-4;
constexpr float CUBIC_ROOT_ULP = 1e-3;

with the caveat that numerical differentiation in single precision will be less accurate and the solver will be more likely to fail to converge.

Analyse mod files from NEURON distribution, BBP and HBP Models

To make sure SymPy solvers cover existing use cases from important models, analyse mod files from :

  • neuron repository
  • BBP models - neocortex, thalamus, mousify
  • HBP models : hippocampus
  • coreneuron perf models : nrntraub, reduced_dentate, tqperf, ringtest, brettetest
  • coreneuron test : testcorenrn repository

Blocks to introspect :

  • STEPPED
  • DERIVATIVE
  • LINEAR
  • NONLINEAR
  • DISCRETE
  • PARTIAL
  • FUNCTION_TABLE
  • KINETIC
  • MATCH
  • NET_RECEIVE
  • STEP

Implement visitor for variable renaming / SSA (Single-Static-Assignment) form

To facilitate SymPy analysis after loop unroll (#74) we have to make statements independent from another :

DERIVATIVE state {
    LOCAL a, b, c
    b = DFree*frat[1]*1(um)
    c = (1+beta)*diam*diam*vol[0]*1(um)
    a = PI*diam*1(um)*10000*frat[0]/(2*FARADAY)
    ca'[0] = (b*ca[1]-b*ca[0]+c2*pumpca-c1*pump*ca[0]-a*(ica-ica_pmp_last))/c

    FROM i = 1 TO 8 {
        a = DFree*frat[i]*1(um)
        b = DFree*frat[i+1]*1(um)
        c = (1+beta)*diam*diam*vol[i]*1(um)
        ca'[i] = (a*ca[i-1]+b*ca[i+1]-(a+b)*ca[i])/c
    }

to

DERIVATIVE state {
    LOCAL a, b, c
    b = DFree*frat[1]*1(um)
    c = (1+beta)*diam*diam*vol[0]*1(um)
    a = PI*diam*1(um)*10000*frat[0]/(2*FARADAY)
    ca'[0] = (b*ca[1]-b*ca[0]+c2*pumpca-c1*pump*ca[0]-a*(ica-ica_pmp_last))/c

    FROM i = 1 TO 8 {
        aXi = DFree*frat[i]*1(um)
        bXi = DFree*frat[i+1]*1(um)
        cXi = (1+beta)*diam*diam*vol[i]*1(um)
        ca'[i] = (aXi*ca[i-1]+bXi*ca[i+1]-(aXi+bXi)*ca[i])/cXi
    }

This is basically SSA form.

Split visitor tests

Currently visitors tests are growing and take long time to execute. Split into different sections :

  • visitors/optimization
  • visitors/solver
  • visitors/analysis
    etc...

ISPC Codegen fixes needed to test/benchmark BBP models

I am trying to build blue brain models with ISPC backend and encountering following errors :

  • How to reproduced ?

Use neurodamus master branch and compile coreneuron with additional mod files:

 cmake .. \
-DADDITIONAL_MECHPATH=/Users/kumbhar/workarena/repos/bbp/neurodamus/lib/modlib \
-DADDITIONAL_MECHS=/Users/kumbhar/workarena/repos/bbp/neurodamus/lib/modlib/coreneuron_modlist.txt \
-DNMODL_EXTRA_FLAGS="sympy --analytic --conductance --pade --cse passes --inline --localize --verbatim-rename" \
-DNMODL_ROOT=/Users/kumbhar/nmodl/ -DENABLE_NMODL=ON \
-DENABLE_ISPC_TARGET=ON \
-DCMAKE_ISPC_COMPILER=/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc
  • First failure is with GluSynapse mod file :
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && env MODLUNIT=/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/external/mod2c/share/nrnunits.lib /Users/kumbhar/nmodl/bin/nmodl GluSynapse.mod -o /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron host --ispc sympy --analytic --conductance --pade --cse passes --inline --localize --verbatim-rename
[NMODL] [info] :: Processing GluSynapse.mod
[NMODL] [info] :: Running symtab visitor
[NMODL] [info] :: Running verbatim rename visitor
[NMODL] [info] :: Running KINETIC block visitor
[NMODL] [info] :: Running nmodl inline visitor
[NMODL] [info] :: Running localize visitor
[NMODL] [info] :: Running sympy conductance visitor
[NMODL] [warning] :: SympyConductance :: Unsafe to insert CONDUCTANCE statement
[NMODL] [info] :: Running sympy solve visitor
[NMODL] [info] :: Running cnexp visitor
[NMODL] [info] :: Running ISPC backend code generator
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: compute_method_name not implemented
/bin/sh: line 1: 37517 Abort trap: 6           env MODLUNIT=/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/external/mod2c/share/nrnunits.lib /Users/kumbhar/nmodl/bin/nmodl GluSynapse.mod -o /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron host --ispc sympy --analytic --conductance --pade --cse passes --inline --localize --verbatim-rename
make[2]: *** [coreneuron/GluSynapse.ispc] Error 134
make[2]: *** Deleting file `coreneuron/GluSynapse.ispc'
make[1]: *** [coreneuron/CMakeFiles/kinderiv.dir/all] Error 2
  • CaDynamics_E2.mod CaDynamics_DC0.mod is special in the sense that it used nrn_wrote_conc function which is defined in coreneuron in initial block. Also FARADAY unit factor is not printed :
[ 53%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/CaDynamics_E2.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc -o CMakeFiles/corenrnmech.dir/CaDynamics_E2.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:73:9: Error: Undeclared symbol "nrn_wrote_conc".
        nrn_wrote_conc(ca_type, &(inst->ion_cai[indexes[1*pnodecount+id]]), 1, inst->style_ca[2], nrn_ion_global_map, celsius, nt->_ml_list[ca_type]->_nodecount_padded);
        ^^^^^^^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:73:99: Error: Undeclared symbol "nrn_ion_global_map".
        nrn_wrote_conc(ca_type, &(inst->ion_cai[indexes[1*pnodecount+id]]), 1, inst->style_ca[2], nrn_ion_global_map, celsius, nt->_ml_list[ca_type]->_nodecount_padded);
                                                                                                  ^^^^^^^^^^^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:73:119: Error: Undeclared symbol "celsius".
        nrn_wrote_conc(ca_type, &(inst->ion_cai[indexes[1*pnodecount+id]]), 1, inst->style_ca[2], nrn_ion_global_map, celsius, nt->_ml_list[ca_type]->_nodecount_padded);
                                                                                                                      ^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:95:28: Error: Undeclared symbol "FARADAY".
        ionvar.cai = (2.0d*FARADAY*ionvar.cai*inst->decay[id]*inst->depth[id]-FARADAY*ionvar.cai*inst->depth[id]*nt->_dt+2.0d*FARADAY*inst->depth[id]*nt->_dt*inst->minCai[id]-10000.0d*inst->decay[id]*nt->_dt*inst->gamma[id]*inst->ion_ica[indexes[0*pnodecount+id]])/(FARADAY*inst->depth[id]*(2.0d*inst->decay[id]+nt->_dt));
                           ^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:95:79: Error: Undeclared symbol "FARADAY".
        ionvar.cai = (2.0d*FARADAY*ionvar.cai*inst->decay[id]*inst->depth[id]-FARADAY*ionvar.cai*inst->depth[id]*nt->_dt+2.0d*FARADAY*inst->depth[id]*nt->_dt*inst->minCai[id]-10000.0d*inst->decay[id]*nt->_dt*inst->gamma[id]*inst->ion_ica[indexes[0*pnodecount+id]])/(FARADAY*inst->depth[id]*(2.0d*inst->decay[id]+nt->_dt));
                                                                              ^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:95:127: Error: Undeclared symbol "FARADAY".
        ionvar.cai = (2.0d*FARADAY*ionvar.cai*inst->decay[id]*inst->depth[id]-FARADAY*ionvar.cai*inst->depth[id]*nt->_dt+2.0d*FARADAY*inst->depth[id]*nt->_dt*inst->minCai[id]-10000.0d*inst->decay[id]*nt->_dt*inst->gamma[id]*inst->ion_ica[indexes[0*pnodecount+id]])/(FARADAY*inst->depth[id]*(2.0d*inst->decay[id]+nt->_dt));
                                                                                                                              ^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/CaDynamics_E2.ispc:95:267: Error: Undeclared symbol "FARADAY".
        ionvar.cai = (2.0d*FARADAY*ionvar.cai*inst->decay[id]*inst->depth[id]-FARADAY*ionvar.cai*inst->depth[id]*nt->_dt+2.0d*FARADAY*inst->depth[id]*nt->_dt*inst->minCai[id]-10000.0d*inst->decay[id]*nt->_dt*inst->gamma[id]*inst->ion_ica[indexes[0*pnodecount+id]])/(FARADAY*inst->depth[id]*(2.0d*inst->decay[id]+nt->_dt));
  • Ca_LVAst.mod
[ 53%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/Ca_LVAst.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Ca_LVAst.ispc -o CMakeFiles/corenrnmech.dir/Ca_LVAst.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Ca_LVAst.ispc:82:42: Error: syntax error, unexpected float constant, expecting
        ')' or ','.
            qt = pow(2.300000d,((34.0d-21.0d)/10.0d));
                                         ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Ca_LVAst.ispc:85:32: Error: syntax error, unexpected float constant, expecting
        ')' or ','.
            mTau_r_1 = (5.0d+20.0d/(1.0d+vexp((v- -25.0d)/5.0d)))/qt;
                               ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Ca_LVAst.ispc:85:63: Error: syntax error, unexpected ')', expecting ',' or
        ';'.
  • Im.mod , Nap_Et2.mod, NaTa_t.mod, NaTs2_t.mod, NaTg.mod
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Im.ispc -o CMakeFiles/corenrnmech.dir/Im.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Im.ispc:78:42: Error: syntax error, unexpected float constant, expecting ')' or
        ','.
            qt = pow(2.300000d,((34.0d-21.0d)/10.0d));
                                         ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/Im.ispc:139:42: Error: syntax error, unexpected float constant, expecting ')' or
        ','.
            qt = pow(2.300000d,((34.0d-21.0d)/10.0d));
  • KdShu2007.mod
[ 59%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/KdShu2007.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/KdShu2007.ispc -o CMakeFiles/corenrnmech.dir/KdShu2007.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/KdShu2007.ispc:87:30: Error: syntax error, unexpected float constant, expecting
        ',' or ';'.
            minf_r_0 = 1.0d-1.0d/(1.0d+vexp((v_in_0-KdShu2007_global.vhalfm)/KdShu2007_global.km));
                             ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/KdShu2007.ispc:150:30: Error: syntax error, unexpected float constant, expecting
        ',' or ';'.
            minf_r_1 = 1.0d-1.0d/(1.0d+vexp((v_in_1-KdShu2007_global.vhalfm)/KdShu2007_global.km));
  • K_Pst.mod, K_Tst.mod
[ 57%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/K_Pst.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc -o CMakeFiles/corenrnmech.dir/K_Pst.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:82:42: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
            qt = pow(2.300000d,((34.0d-21.0d)/10.0d));
                                         ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:86:42: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
                mTau_r_1 = (1.250000d+175.030000d*vexp( -v* -0.026000d))/qt;
                                         ^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:88:42: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
                mTau_r_1 = ((1.250000d+13.0d*vexp( -v*0.026000d)))/qt;
                                         ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:91:43: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
            hTau_r_1 = (360.0d+(1010.0d+24.0d*(v+55.0d))*vexp( -pow(((v+75.0d)/48.0d),2.0d)))/qt;
                                          ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:91:93: Error: syntax error, unexpected ')', expecting ',' or ';'.
            hTau_r_1 = (360.0d+(1010.0d+24.0d*(v+55.0d))*vexp( -pow(((v+75.0d)/48.0d),2.0d)))/qt;
                                                                                            ^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:150:42: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
            qt = pow(2.300000d,((34.0d-21.0d)/10.0d));
                                         ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:154:42: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
                mTau_r_0 = (1.250000d+175.030000d*vexp( -v* -0.026000d))/qt;
                                         ^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:156:42: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
                mTau_r_0 = ((1.250000d+13.0d*vexp( -v*0.026000d)))/qt;
                                         ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:159:43: Error: syntax error, unexpected float constant, expecting ')'
        or ','.
            hTau_r_0 = (360.0d+(1010.0d+24.0d*(v+55.0d))*vexp( -pow(((v+75.0d)/48.0d),2.0d)))/qt;
                                          ^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/K_Pst.ispc:159:93: Error: syntax error, unexpected ')', expecting ',' or ';'.
            hTau_r_0 = (360.0d+(1010.0d+24.0d*(v+55.0d))*vexp( -pow(((v+75.0d)/48.0d),2.0d)))/qt;
  • ProbAMPANMDA_EMS.mod , ProbGABAAB_EMS.mod, StochKv2/3.mod has verbatim blocks in net_receive blocks:
[ 61%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/ProbAMPANMDA_EMS.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ProbAMPANMDA_EMS.ispc -o CMakeFiles/corenrnmech.dir/ProbAMPANMDA_EMS.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ProbAMPANMDA_EMS.ispc:93:13: Error: Undeclared symbol
        "nrn_get_random_sequence".
            long nrn_get_random_sequence(void* r);
            ^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ProbAMPANMDA_EMS.ispc:93:18: Error: syntax error, unexpected identifier,
        expecting ',' or ';'.
            long nrn_get_random_sequence(void* r);
                 ^^^^^^^^^^^^^^^^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ProbAMPANMDA_EMS.ispc:107:25: Error: Undeclared symbol "seq". Did you mean
        "sin"?
                        uint32_t seq;
                        ^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ProbAMPANMDA_EMS.ispc:107:34: Error: syntax error, unexpected identifier,
        expecting ',' or ';'.
                        uint32_t seq;
  • TTXDynamicsSwitch.mod :
[ 67%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/TTXDynamicsSwitch.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/TTXDynamicsSwitch.ispc -o CMakeFiles/corenrnmech.dir/TTXDynamicsSwitch.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/TTXDynamicsSwitch.ispc:73:9: Error: Undeclared symbol "nrn_wrote_conc".
        nrn_wrote_conc(ttx_type, &(inst->ion_ttxi[indexes[1*pnodecount+id]]), 1, inst->style_ttx[2], nrn_ion_global_map, celsius, nt->_ml_list[ttx_type]->_nodecount_padded);
        ^^^^^^^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/TTXDynamicsSwitch.ispc:73:102: Error: Undeclared symbol "nrn_ion_global_map".
        nrn_wrote_conc(ttx_type, &(inst->ion_ttxi[indexes[1*pnodecount+id]]), 1, inst->style_ttx[2], nrn_ion_global_map, celsius, nt->_ml_list[ttx_type]->_nodecount_padded);
                                                                                                     ^^^^^^^^^^^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/TTXDynamicsSwitch.ispc:73:122: Error: Undeclared symbol "celsius".
        nrn_wrote_conc(ttx_type, &(inst->ion_ttxi[indexes[1*pnodecount+id]]), 1, inst->style_ttx[2], nrn_ion_global_map, celsius, nt->_ml_list[ttx_type]->_nodecount_padded);
  • BinReportHelper.mod BinReports.mod :
[ 68%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/BinReports.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/BinReports.ispc -o CMakeFiles/corenrnmech.dir/BinReports.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/BinReports.ispc:47:6: Error: Undeclared symbol "Data". Did you mean "data"?
    	Data** tempdata = (Data**)(&(inst->ptr[indexes[2*pnodecount+id]]));
     ^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/BinReports.ispc:47:13: Error: Undeclared symbol "tempdata".
    	Data** tempdata = (Data**)(&(inst->ptr[indexes[2*pnodecount+id]]));
            ^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/BinReports.ispc:47:22: Error: syntax error, unexpected '=', expecting ',' or
        ';'.
    	Data** tempdata = (Data**)(&(inst->ptr[indexes[2*pnodecount+id]]));
  • ALU.mod
[ 70%] Building ISPC object coreneuron/CMakeFiles/corenrnmech.dir/ALU.ispc.obj
cd /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron && /Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-8.2.0/ispc-1.10.0-zwjir4zol2zzufymp5nxebrbkapyu6g2/bin/ispc  -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/nmodl/include -I/Users/kumbhar/workarena/software/sources/spack/opt/spack/darwin-mojave-x86_64/gcc-4.9.4/caliper-master-fqqkraajrv742d6hibdr4l3j6nvzjvvs/include -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron/utils/randoms -I/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron -I/Users/kumbhar/workarena/repos/bbp/coreneuron/coreneuron  /Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ALU.ispc -o CMakeFiles/corenrnmech.dir/ALU.ispc.obj
Warning: No --target specified on command-line. Using default system target "avx2-i32x8".
/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ALU.ispc:46:9: Error: Undeclared symbol "INFOCAST".
        INFOCAST;
        ^^^^^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ALU.ispc:47:9: Error: Undeclared symbol "Info". Did you mean "inf"?
        Info* info = *ip;
        ^^^^

/Users/kumbhar/workarena/repos/bbp/coreneuron/build_nmodl_ispc/coreneuron/ALU.ispc:47:15: Error: Undeclared symbol "info". Did you mean "inf"?
        Info* info = *ip;
              ^^^^

CMake should raises an error if submodules are absent

I didn't update submodules of my working copy since eigen has been added. As a result, I experience weird compilation issues. Instead, I would have liked a nice error message "Error: eigen submodule is missing".

This check could be made at CMake time. CMake would raise an error if a submodule is missing. The message could also provide the git submodule update --recursive command to execute.

Improvements for KINETIC block parser (especially array and flux variables)

#59 supports kinetic block parsing but following improvements can be done:

  • correctly parse array variables
  • correctly substitute for fflux/bflux variable use inside mod file (have to parse other statements for this)
  • LONGITUDINAL DIFFUSION statement

Not priority :

  • implement CONSERVE statements (compiler hint: not high priority)
  • check for loops, verbatim, etc & if found abort

Handle variable conflict from newton solver with derivimplicit method

See #48 : the SympyVisitor adds solution block declaring Eigen matrix variable X. If there is already user defined variable X then we need to run rename visitor. Sample example :

            NEURON {
                RANGE X
            }
            BREAKPOINT  {
                SOLVE states METHOD derivimplicit
            }
            DERIVATIVE states {
                m' =  (minf-m)/mtau - 3*h*X
                h' = (hinf-h)/htau + m*m
            }

Incorrect ODE replacement when if-else block exists with derivimplicit method

If we have derivative block with derivimplicit method like :

DERIVATIVE states {
    IF (tau_m<taumin) {
        tau_m = taumin
    }
    m' = (m_inf-m)/tau_m
}

The SympySolver generates :

DERIVATIVE states {
    IF (tau_m<taumin) {
        LOCAL tmp_m_old
        tau_m = taumin
        {
            X[0] = m
        }{
            tmp_m_old = m
            m = (dt*m_inf+tau_m*tmp_m_old)/(dt+tau_m)
        }{
            m = X[0]
        }
    }
    m' = (m_inf-m)/tau_m
}

This is because I thought it's good idea to track last statement block and then inset statement there. But as we can see, it fails in above case as if's statement block gets used.

Implement loop unroll visitor pass

KINETIC blocks can have reaction statements with the for loop :

KINETIC state {
	COMPARTMENT i, (1+beta)*diam*diam*vol[i]*1(um) {ca}
	COMPARTMENT (1e10)*area1 {pump pumpca}
	COMPARTMENT volo*(1e15) {cao}

	~ pumpca <-> pump + cao		(c3, c4)
	ica_pmp = (1e-4)*2*FARADAY*(f_flux - b_flux)/area1
	~ ca[0] << (-(ica-ica_pmp_last)*PI*diam*1(um)*(1e4)*frat[0]/(2*FARADAY))

	FROM i=0 TO NANN-2 {
		~ ca[i] <-> ca[i+1] (DFree*frat[i+1]*1(um), DFree*frat[i+1]*1(um))
	}

	~ ca[0] + pump <-> pumpca	(c1, c2)
	cai = ca[0] : this assignment statement is used specially by cvode
}

Hand-made DERIVATIVE block for this looks like :

DERIVATIVE state {
	LOCAL a, b, c

	pump' = ((c3 + c2)*pumpca - c4*pump*cao - c1*pump*ca[0])/((1e10)*area1)
	pumpca' = (-(c3 + c2)*pumpca + c4*pump*cao + c1*pump*ca[0])/((1e10)*area1)

	b = DFree*frat[1]*1(um)
	c = (1+beta)*diam*diam*vol[0]*1(um)
	a = PI*diam*1(um)*(1e4)*frat[0]/(2*FARADAY)

	ca'[0] = (b*ca[1] - b*ca[0] + c2*pumpca - c1*pump*ca[0] - a*(ica - ica_pmp_last))/c
	ica_pmp = (1e-4)*2*FARADAY*(c3*pumpca - c1*pump*cao)/area1

	FROM i=1 TO NANN-2 {
		a = DFree*frat[i]*1(um)
		b = DFree*frat[i+1]*1(um)
		c = (1+beta)*diam*diam*vol[i]*1(um)
		ca'[i] = (a*ca[i-1] + b*ca[i+1] - (a+b)*ca[i])/c
	}

	a = DFree*frat[NANN-1]*1(um)
	c = (1+beta)*diam*diam*vol[NANN-1]*1(um)
	ca'[NANN-1] = (a*ca[NANN-2] - a*ca[NANN-1])/c

	cai = ca[0] : this assignment statement is used specially by cvode
}

In order to perform such transformation and then to use SymPy, we need to :

  • unroll original loop
  • each unrolled loop iteration is independent of others
    • requires variable renaming

Disable auto-selection of solver from SymPy passes

Sympy pass should prefer the solve method specify by user in the MOD file. Currently if ODEs are linear then sympy doesn't use derivimplicit method specified by user.

In this case emit warning/info to user but use solve method specified in the MOD file.

Code generation support for multiple SOLVE blocks

Solver now supports multiple solve blocks (see #48) but code generation holds pointer to single solve block. It should be straightforward to fix this in code generation backends.

There are no mod files in BBP model with multiple solver blocks but there are some in ModelDB database.

Link time warning with pybind11

When we compile on OS-X with clang compiler we get following warning :

ld: warning: URGENT: building for OSX, but linking against dylib (/usr/lib/libSystem.dylib) built for (unknown). Note: This will be an error in the future.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::UnitState::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::BABlockType::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::QueueExpressionType::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::FirstLastTypeIndex::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::ReactionOperator::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::UnaryOperator::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::BinaryOperator::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::Boolean::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::Double::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::Float::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'init_ast_module(pybind11::module&)' from file 'CMakeFiles/_nmodl.dir/pyast.cpp.o' to global weak symbol 'ast::Integer::eval()' from file '../visitors/CMakeFiles/visitor_obj.dir/json_visitor.cpp.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
................................

Improve Eigen solver node in the ast to allow local variables and conditional expressions

We have mod files with derivative block and derivimplicit method :

DERIVATIVE state {
    LOCAL minf_VDCC, hinf_VDCC
    minf_VDCC = 1/(1+exp(((vhm_VDCC-ljp_VDCC)-v)/km_VDCC))
    hinf_VDCC = 1/(1+exp(((vhh_VDCC-ljp_VDCC)-v)/kh_VDCC))
    A_AMPA' = -A_AMPA/tau_r_AMPA
    B_AMPA' = -B_AMPA/tau_d_AMPA
    A_NMDA' = -A_NMDA/tau_r_NMDA
    B_NMDA' = -B_NMDA/tau_d_NMDA
    m_VDCC' = (minf_VDCC-m_VDCC)/mtau_VDCC
    h_VDCC' = (hinf_VDCC-h_VDCC)/htau_VDCC
    cai_CR' = -(1e-09)*(ica_NMDA+ica_VDCC)*gamma_ca_CR/((1e-15)*volume_CR*2*FARADAY)-(cai_CR-min_ca_CR)/tau_ca_CR
    effcai_GB' = -effcai_GB/tau_effca_GB+(cai_CR-min_ca_CR)
    Rho_GB' = (-Rho_GB*(1-Rho_GB)*(rho_star_GB-Rho_GB)+potentiate_GB*gamma_p_GB*(1-Rho_GB)-depress_GB*gamma_d_GB*Rho_GB)/((1000)*tau_GB)
    Use_GB' = (Use_d_GB+Rho_GB*(Use_p_GB-Use_d_GB)-Use_GB)/((1000)*tau_Use_GB)
    min_ca_CR = Use_GB
}

The current code generation will produce :

    void nrn_state_GluSynapse(NrnThread* nt, Memb_list* ml, int type) {
        int nodecount = ml->nodecount;
        int pnodecount = ml->_nodecount_padded;
        const int* __restrict__ node_index = ml->nodeindices;
        double* __restrict__ data = ml->data;
        const double* __restrict__ voltage = nt->_actual_v;
        Datum* __restrict__ indexes = ml->pdata;
        ThreadDatum* __restrict__ thread = ml->_thread;
        GluSynapse_Instance* __restrict__ inst = (GluSynapse_Instance*) ml->instance;

        int start = 0;
        int end = nodecount;
        #pragma ivdep
        for (int id = start; id < end; id++)  {
            int node_id = node_index[id];
            double v = voltage[node_id];
            double minf_VDCC, hinf_VDCC;
            minf_VDCC = 1.0/(1.0+exp(((GluSynapse_global.vhm_VDCC-GluSynapse_global.ljp_VDCC)-v)/GluSynapse_global.km_VDCC));
            hinf_VDCC = 1.0/(1.0+exp(((GluSynapse_global.vhh_VDCC-GluSynapse_global.ljp_VDCC)-v)/GluSynapse_global.kh_VDCC));
            minf_VDCC = inst->Use_GB[id];

            Eigen::Matrix<double, 10, 1> X;
            X[0] = inst->A_AMPA[id];
            X[1] = inst->B_AMPA[id];
            X[2] = inst->A_NMDA[id];
            X[3] = inst->B_NMDA[id];
            X[4] = inst->m_VDCC[id];
            X[5] = inst->h_VDCC[id];
            X[6] = inst->cai_CR[id];
            X[7] = inst->effcai_GB[id];
            X[8] = inst->Rho_GB[id];
            X[9] = inst->Use_GB[id];
            struct functor {
                NrnThread* nt;
                GluSynapse_Instance* inst;
                int id;
                functor(NrnThread* nt, GluSynapse_Instance* inst, int id) : nt(nt), inst(inst), id(id) {}
                void operator()(const Eigen::Matrix<double, 10, 1>& X, Eigen::Matrix<double, 10, 1>& F, Eigen::Matrix<double, 10, 10>& Jm)  const{
                    double* J = Jm.data();
                    F[0] =  -inst->A_AMPA[id]+X[0]*nt->_dt/GluSynapse_global.tau_r_AMPA+X[0];
                    F[1] =  -inst->B_AMPA[id]+X[1]*nt->_dt/inst->tau_d_AMPA[id]+X[1];
                    F[2] =  -inst->A_NMDA[id]+X[2]*nt->_dt/GluSynapse_global.tau_r_NMDA+X[2];
                    F[3] =  -inst->B_NMDA[id]+X[3]*nt->_dt/GluSynapse_global.tau_d_NMDA+X[3];
                    F[4] = (nt->_dt*(X[4]-minf_VDCC)+GluSynapse_global.mtau_VDCC*(X[4]-inst->m_VDCC[id]))/GluSynapse_global.mtau_VDCC;
                    F[5] = (nt->_dt*(X[5]-hinf_VDCC)+GluSynapse_global.htau_VDCC*(X[5]-inst->h_VDCC[id]))/GluSynapse_global.htau_VDCC;
                    F[6] = (FARADAY*GluSynapse_global.tau_ca_CR*inst->volume_CR[id]*(X[6]-inst->cai_CR[id])+nt->_dt*(FARADAY*inst-          >volume_CR[id]*(X[6]-GluSynapse_global.min_ca_CR)+499999.9999999999*GluSynapse_global.gamma_ca_CR*GluSynapse_global.tau_ca_CR*(inst-        >ica_NMDA[id]+inst->ica_VDCC[id])))/(FARADAY*GluSynapse_global.tau_ca_CR*inst->volume_CR[id]);
                    F[7] = (nt->_dt*(X[7]+GluSynapse_global.tau_effca_GB*( -X[6]+GluSynapse_global.min_ca_CR))+GluSynapse_global.           tau_effca_GB*(X[7]-inst->effcai_GB[id]))/GluSynapse_global.tau_effca_GB;
                    F[8] = (0.001*nt->_dt*(X[8]*inst->depress_GB[id]*GluSynapse_global.gamma_d_GB+X[8]*(X[8]-1.0)*(X[8]-GluSynapse_global.  rho_star_GB)+GluSynapse_global.gamma_p_GB*inst->potentiate_GB[id]*(X[8]-1.0))+GluSynapse_global.tau_GB*( -inst->Rho_GB[id]+X[8]))/          GluSynapse_global.tau_GB;
                    F[9] = (0.001*nt->_dt*( -inst->Use_d_GB[id]+X[8]*(inst->Use_d_GB[id]-inst->Use_p_GB[id])+X[9])+GluSynapse_global.       tau_Use_GB*( -inst->Use_GB[id]+X[9]))/GluSynapse_global.tau_Use_GB;
                    J[0] = nt->_dt/GluSynapse_global.tau_r_AMPA+1.0;
                    J[10] = 0.0;
                    J[20] = 0.0;
                    J[30] = 0.0;

In this case functor doesn't have access to :

            double minf_VDCC, hinf_VDCC;

Issue warning for empty units during semantic analysis

Empty unit name declaration is valid according to the original implementation in NEURON:

i.e.

UNITS 
{
                   () = (millivolt)
}

is accepted now. Note the empty bracket on the left where there should be a name. Similarly, function declarations like the below are now also accepted:

FUNCTION ssCB(kdf(), kds()) (mM) 
{
}

Above behaviour was implemented in #3 in order to pass the fail existing ModelDB files.

When we will have semantic analysis pass for error checking, we can add a check to see if there is an empty unit definition like above and then error / throw exception. This way, parsing will be successful but the semantic analysis will be a "proper" place to do such checking.

SympyConductance visitor and IF ELSE blocks

IF { a } ELSE { b } blocks are not parsed by the SympyConductance visitor, it just collects all the statements in the breakpoint block.

So currently if the breakpoint contains conflicting current statements inside IF and ELSE blocks, the resulting CONDUCTANCE statements may be incorrect.

Maybe the solution is to identify such (rare) situations and then not attempt to generate CONDUCTANCE statements

sparse solver not very safe/robust for large numbers of state vars

Currently the sparse solver uses Gaussian elimination to solve the linear system that results from implicit Euler integration. Doing this symbolically allows us to do this at compile time - but for large, not-so-sparse matrices this may not give a numerically stable solution at run time.

It would be safer to construct the linear system to solve as an Eigen matrix, then solve it with Eigen - as is done inside (a single iteration of) the Newton solver. For small matrices the Eigen routines should have similar performance to our current hard coded solution, and for larger matrices it will be much more numerically robust.

solve coupled linear ODEs at compile time

When the set of ODEs are coupled but linear, the resulting implicit Euler timestep involves solving a linear system. As the structure is fixed, and only the values of the coefficients change at run-time, the system can be solved symbolically by gaussian elimination using SymPy at compile time.

Symtabvisitor try to dereference nullptr token

If we add new global block in the AST without token and then run symtab visitor then we get segfault from:

void SymtabVisitor::add_model_symbol_with_property(ast::Node* node, NmodlType property) {
    auto token = node->get_token();   => nullptr !
    auto name = node->get_node_name();
    auto symbol = std::make_shared<Symbol>(name, node, *token);

Define EIGEN_DEFAULT_DENSE_INDEX_TYPE to int and EIGEN_DONT_PARALLELIZE in global header

As mentioned in #45 and in the documentation here, we should EIGEN_DEFAULT_DENSE_INDEX_TYPE to int:

Known issues:

nvcc with MS Visual Studio does not work (patch welcome)
nvcc with clang does not work (patch welcome)
nvcc 5.5 with gcc-4.7 (or greater) has issues with the standard <limits> header file. To workaround this, you can add the following before including any other files:
// workaround issue between gcc >= 4.7 and cuda 5.5
#if (defined __GNUC__) && (__GNUC__>4 || __GNUC_MINOR__>=7)
  #undef _GLIBCXX_ATOMIC_BUILTINS
  #undef _GLIBCXX_USE_INT128
#endif
On 64bits system Eigen uses long int as the default type for indexes and sizes. On CUDA device, it would make sense to default to 32 bits int. However, to keep host and CUDA code compatible, this cannot be done automatically by Eigen, and the user is thus required to define EIGEN_DEFAULT_DENSE_INDEX_TYPE to int throughout his code (or only for CUDA code if there is no interaction between host and CUDA code through Eigen's object).

Also EIGEN_DONT_PARALLELIZE to avoid threading from Eigen as mentioned here.

Support LINEAR / NONLINEAR block

  • user can ask for a set of simultaneous equations to be solved

  • if LINEAR, construct matrix, solve using sparse solver

  • if NONLINEAR, construct matrix, solve using derivimplicit

  • should parse these blocks in SymPy, similarly to what is done for ODEs

Parsing issue for to_nmodl_for_sympy() method ?

Was trying to test the example of Kinetic scheme from this, page 28 :

STATE { mc m }

KINETIC scheme1 {
  ~ mc <-> m (a(v), b(v))
}

is equivalent to

DERIVATIVE scheme1 {
  mc' = -a(v)*mc + b(v)*m
  m' = a(v)*mc - b(v)*m
}

This gives:

....
vim [NMODL] [debug] :: SympySolverVisitor :: -> declaring new local variable: tmp_mc_old
[NMODL] [debug] :: SympySolverVisitor :: -> declaring new local variable: tmp_m_old
-------------------------------
tmp_mc_old = mc
tmp_m_old = m
mc = // Not supported in C:
// a
// b
(dt*tmp_m_old*b(v) + dt*tmp_mc_old*b(v) + tmp_mc_old)/(dt*a(v) + dt*b(v) + 1.0)
m = // Not supported in C:
// a
// b
(dt*tmp_m_old*a(v) + dt*tmp_mc_old*a(v) + tmp_m_old)/(dt*a(v) + dt*b(v) + 1.0)

This is because a(v) is being parsed as function call instead of a followed by unit:

                                    {
                                      "WrappedExpression": [
                                        {
                                          "FunctionCall": [
                                            {
                                              "Name": [
                                                {
                                                  "String": [
                                                    {
                                                      "name": "a"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "VarName": [
                                                {
                                                  "Name": [
                                                    {
                                                      "String": [
                                                        {
                                                          "name": "v"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {

derivimplicit/sparse solvers: order of statements in derivative block

Derivimplicit/sparse solvers solve a coupled set of ODEs.

However, in the derivative block the ODE statements are done separately for each variable, and other statements can be inserted between these statements.

A simple example:

STATE {
        m
        h
}
DERIVATIVE states {
        m' =  a
        a = a + 1
        h' = a
}

For derivimplicit/sparse, we currently first apply all non-derivative statements in order, i.e. a = a+1, then solve the ODE system, so this would be like solving

DERIVATIVE states {
        m' = a+1
        h' = a+1
}

So the first equation is incorrect

Simplest solution:

  • require that derivimplicit/sparse derivative blocks have ODEs at bottom of the block with no other statements mixed between them

or:

  • require that derivimplicit/sparse derivative blocks do not mix statements and ODE's, i.e. first statements, followed by the ODE's, possibly followed by more statements
  • insert ODE solution between these two sets of statements in the codegen

or (complicated):

  • keep track of all intermediate statements, recursively substitute them into subsequent ODE statements before solving system

Add parent pointer into AST nodes

As a first step to simplifying some of the AST operations I think it would be useful to give each AST node a parent member, which is a pointer to an AST node (its parent or nullptr). This should be a shared_ptr and the pointer shoudl be set trhough a set_parent() method when the child is added into its parent (e.g. when the child is passed to the parent in the constructor or in one of the add_statement / update methods.

visitor pass to remove units

It would be useful to have a visitor or routine that removes the units from the AST (or a block, or a statement), as they tend to confuse the SymPy parser in SympySolver and SympyConductance visitors.

e.g. transform NMODL statements like:

x = 4(mM) --> x = 4
gca_bar_VDCC = 0.0372 (nS/um2) --> gca_bar_VDCC = 0.0372

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.