Factors Influencing NEURON Simulation Run Time Beyond Total Compartment Count?

Anything that doesn't fit elsewhere.
Post Reply
jeongjumoon
Posts: 1
Joined: Thu Dec 05, 2024 5:16 am

Factors Influencing NEURON Simulation Run Time Beyond Total Compartment Count?

Post by jeongjumoon »

Hi everyone,

I'm running neural stimulation simulations in Python using the NEURON simulator with Blue Brain Project neuron models. I have encountered a significant difference in simulation times between two cases:

[Modified Model]
Morphology: Simplified (axon, basal dendrite, and apical dendrite each have only one branch, with straight-line geometry)
Total nseg: 283
Simulation Time: ~130 seconds


[Unmodified Model]
Morphology: Complex with many branches and detailed geometry
Total nseg: 1131
Simulation Time: ~840 seconds


Since the only modifications between the two cases are related to morphology and segmentation, I’m wondering if there are factors other than the total number of compartments that contribute to the simulation cost. For example, does a higher branch count or increased complexity in branching lead to longer simulation times?

Any insights or suggestions on what might be influencing the simulation run time would be greatly appreciated!

Thanks in advance.
ted
Site Admin
Posts: 6381
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Factors Influencing NEURON Simulation Run Time Beyond Total Compartment Count?

Post by ted »

Runtime depends on model complexity. A crude but effective measure of complexity is the total number of ODEs. For every segment there is one ODE for the cable equation, plus one ODE for each state variable of every mechanism associated with that segment that requires numerical integration. This includes not only density (AKA distributed) mechanisms (NEURON block of its NMODL code declares SUFFIX mechanismname) but also certain point processes (e.g. ExpSyn which has 1 ODE, Exp2Syn which has 2 ODEs). And extracellular adds two ODEs per segment (assuming NEURON was compiled with nlayer == 2). If you use the rxd module, each rxd compartment will have its own ODEs for the various rxd states that require numerical integration).

But runtime also depends on other factors, such as efficient use of cache. Simulation of the simpler model might run faster because there is less cache swapping than when the larger model is simulated. That could happen if more of the smaller model fits into cache (which seems likely), or the model's equations aren't well organized in computer memory for some reason so that cache swapping happens more than necessary. What happens if you run your simulations with cache_efficient enabled? (see the Python or hoc documentation of CVode.cache_efficient at nrn.readthedocs.io)
Post Reply