CoreNeuron icon indicating copy to clipboard operation
CoreNeuron copied to clipboard

Ion related initial values set in the NEURON parser not passed to CoreNEURON

Open iomaganaris opened this issue 2 years ago • 2 comments

Some scripts in NEURON when instantiating the cells might define the initial value of ion variables like:

ko0_k_ion = 3.82   //mM
ki0_k_ion = 140    //mM

These variables (from my understanding) seem that when CoreNEURON gets executed in file mode (using its coredat files) are not passed to CoreNEURON to set them when it registers the ions in https://github.com/BlueBrain/CoreNeuron/blob/c1093ba9b327ec360068bc868c98ec1016cc6f0a/coreneuron/mechanism/eion.cpp#L63 The default values come from: https://github.com/BlueBrain/CoreNeuron/blob/master/coreneuron/membrane_definitions.h The ion registration and calculation is done correctly in direct mode, when CoreNEURON is launched from NEURON.

To Reproduce I was only able to reproduce this with a NetPyNE closed source simulation. I can provide more details if needed.

Expected behavior I suppose that those variables should be passed to the coredat files, so that they can be read by CoreNEURON?

Logs NEURON values:

nrn_init_ion 15 conci 10.000000 conco 140.000000 charge 1.000000 celsius 34.000000
nrn_init_ion 16 conci 140.000000 conco 3.820000 charge 1.000000 celsius 34.000000
nrn_init_ion 25 conci 0.000050 conco 2.000000 charge 2.000000 celsius 34.000000
nrn_init_ion 49 conci 1.000000 conco 1.000000 charge 1.000000 celsius 34.000000

CoreNEURON values:

nrn_init_ion 15 na_ion conci 10.000000 conco 140.000000 charge 1.000000 celsius 34.000000
nrn_init_ion 16 k_ion conci 54.400000 conco 2.500000 charge 1.000000 celsius 34.000000
nrn_init_ion 25 ca_ion conci 0.000050 conco 2.000000 charge 2.000000 celsius 34.000000
nrn_init_ion 49 hi_ion conci 1.000000 conco 1.000000 charge 1.000000 celsius 34.000000

System (please complete the following information)

  • OS: Ubuntu 20.04
  • Compiler: GCC
  • Version: NEURON master branch, CoreNEURON magkanar/fix_pdata branch
  • Backend: CPU

cc: @pramodk @nrnhines This issue is a bit related to the issue we were debugging together in the past with NetPyNE simulations however the issue we were seeing then is fixed from this PR https://github.com/BlueBrain/CoreNeuron/pull/775

iomaganaris avatar Feb 21 '22 19:02 iomaganaris

Edit: These values exist in the globals.dat file from the coredat files but for some reason are not set properly in CoreNEURON

iomaganaris avatar Feb 21 '22 19:02 iomaganaris

It seems like this issue doesn't influence the spikes of the simulation tested with small circuits of the M1 and S1 NetPyNE models. Still I have created a draft PR to solve this issue here: https://github.com/BlueBrain/CoreNeuron/pull/780

iomaganaris avatar Feb 22 '22 15:02 iomaganaris