Skip to content

Performance optimizations for the compartmental feature (PR for merge) - #1388

Open
LeanderEwert wants to merge 554 commits into
nest:mainfrom
LeanderEwert:origin/LeanderEwert_cm_optimized_merge_prepare
Open

Performance optimizations for the compartmental feature (PR for merge)#1388
LeanderEwert wants to merge 554 commits into
nest:mainfrom
LeanderEwert:origin/LeanderEwert_cm_optimized_merge_prepare

Conversation

@LeanderEwert

Copy link
Copy Markdown
Collaborator

Various optimisations for the compartmental feature, including:

  • Optimised vectorisation
  • Common subexpression elimination
  • Optimised Hines implementation
  • Memory optimizations

This PR should be used for merging going forward. We kindly ask that PR #1319 not be touched until this one is merged, as it is referenced by paper code under review!

C.A.P. Linssen and others added 30 commits September 26, 2023 02:51
…tion

# Conflicts:
#	pynestml/cocos/co_cos_manager.py
#	pynestml/codegeneration/printers/nest_variable_printer.py
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_compartmentcurrents_@NEURON_NAME@.cpp.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_compartmentcurrents_@NEURON_NAME@.h.jinja2
#	pynestml/utils/ast_mechanism_information_collector.py
#	pynestml/utils/mechanism_processing.py
#	pynestml/utils/syns_info_enricher.py
…us input handler hijacked for testing. No extensive testing done.
Also consectutive area -wise processing implemented.
Modifications to main vector loop.
…anent zero output and added error message when passing a parameter to the compartment creation that doesn't exist in the model.
C.A.P. Linssen and others added 10 commits June 9, 2026 18:18
…m_optimized_merge_prepare

# Conflicts:
#	pynestml/codegeneration/nest_compartmental_code_generator.py
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_neuroncurrents_@NEURON_NAME@.cpp.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_neuroncurrents_@NEURON_NAME@.h.jinja2
#	pynestml/utils/mechs_info_enricher.py
# Conflicts:
#	pynestml/codegeneration/nest_compartmental_code_generator.py
#	pynestml/codegeneration/resources_nest/point_neuron/directives_cpp/FunctionDeclaration.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/@NEURON_NAME@.cpp.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/@NEURON_NAME@.h.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_directives_cpp/Declaration.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_directives_cpp/PredefinedFunction_emit_spike.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_neuroncurrents_@NEURON_NAME@.cpp.jinja2
#	pynestml/codegeneration/resources_nest_compartmental/cm_neuron/cm_neuroncurrents_@NEURON_NAME@.h.jinja2
#	pynestml/utils/ast_mechanism_information_collector.py
#	pynestml/utils/mechs_info_enricher.py
#	pynestml/utils/recs_info_enricher.py
#	pynestml/utils/syns_info_enricher.py
#	tests/nest_compartmental_tests/test__compartmental_stdp.py
@LeanderEwert
LeanderEwert requested review from clinssen and pnbabu June 29, 2026 17:48
Comment thread tests/nest_compartmental_tests/test__compartmental_multi_synapse_codegen.py Outdated
Comment thread pynestml/codegeneration/nest_compartmental_code_generator.py
Comment thread pynestml/codegeneration/nest_compartmental_code_generator.py
Comment thread pynestml/codegeneration/printers/cpp_expression_printer.py
Comment thread pynestml/codegeneration/printers/cpp_function_call_printer.py
__attribute__( ( always_inline ) ) inline float
cm_fast_propagator_exp( const float x )
{
// Degree-5 polynomial approximation of exp(x) on [-2, 0].

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.

Is there any attribution/citation available for this code?

Comment thread pynestml/frontend/pynestml_frontend.py Outdated
…o difference in results compared to nest standard models.
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