kernel dying in unusual circumstances

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
radger
Posts: 1
Joined: Thu Jan 30, 2025 6:07 am

kernel dying in unusual circumstances

Post by radger »

Hello,
I have a problem with my model written using NEURON. I have a model that runs, but doesn't work properly, so I wanted to brake it up into parts to be able to diagnose the exact issue. However, when trying to isolate only the interneuron (the whole model consists of 1 interneuron and 4 pyrams), it seems that jupyter notebook kernel dies every time I try to run h.continuerun(). After looking into it, I managed to discover that the radial_diffusion function is crucial for the model to run, however in order to run the function I need to create pyramidal cells earlier and that's exactly what I don't want to do. The code looks like this:

Code: Select all

def radial_diffusion1(pyrams: List[Pyramidal], isoma: InterNeuron):
    thisPyram = pyrams[0]
    soma2 = pyrams[1].soma
    dend2 = pyrams[1].dend
    for sec in thisPyram.pyram:
        for seg in sec:
            x = seg.x
            if x != 0 and x != 1:
                # setpointer soma1.ko2_saccum1(x), soma2.ko(x)
                h.setpointer(soma2(x)._ref_ko, "ko2", thisPyram._saccum_x(x))
                h.setpointer(dend2(x)._ref_ko, "ko2", thisPyram._daccum_x(x))
                h.setpointer(soma2(x)._ref_nao, "nao2", thisPyram._saccum_x(x))
                h.setpointer(dend2(x)._ref_nao, "nao2", thisPyram._daccum_x(x))
saccum and daccum are soma and dendrite accumulation, where ion concentrations are calculated. I feel like this is a problem with neuron trying to calculate some concentrations that are nonexistent and this causes a problem. How can I solve this issue?
ted
Site Admin
Posts: 6383
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: kernel dying in unusual circumstances

Post by ted »

To provide specific advice, I will have to know what you're trying to do. All that is clear from the example code is that
1. it assumes that soma2 and dend2 have the same nseg value. This is unlikely to be true.
2. it assumes that this nseg value changes on every pass through the "for seg in sec" loop. This is probably not what you want to happen.
3. as a consequence of 1 and 2, every pass through that for loop discards at least some of the pointers that were set up on the previous pass. This is also probably not what you want.
4. each pass through that loop first points _saccum_x(x) to soma2(x).ko and _daccum_x(x) to dend2(x).ko, and then replaces those pointers with pointers to soma2(x).nao and dend2(x).nao, respectively. Probably another undesired outcome.

Some of these problems may arise from trying to do too many things at one time. Instead of trying to fix this code, it might be better to start over, but before you do that, you should write a description, in human-readable pseudocode, of what you are trying to do.

By the way, starting with NEURON 7.8 a much simpler syntax for setting up pointers has been available. But whether pointers are even relevant to the task you want to accomplish with _saccum_ and _daccum_ depends on what that task is.
Post Reply