Closed ramcdougal closed 1 month ago
I wonder if this is because this is a model that uses threads? If that is a problem, we should detect it and give a graceful, meaningful error message.
Quite by accident I didn't have a problem with
nrnivmodl mod_files
nrngui -python protocols/*.py
# stop the sim
# select NEURON/MainMenu/Tools/ModelView
But, yes, most things with 'from neuron import gui' gives me a problem.
$ git diff
diff --git a/protocols/01_PFAA.py b/protocols/01_PFAA.py
index 94e2fdc..c8f3042 100755
--- a/protocols/01_PFAA.py
+++ b/protocols/01_PFAA.py
@@ -1,9 +1,9 @@
+from neuron import h, gui
# 01 - Excitatory and inhibitory activity on Purkinje cell model
# Protocols to reproduce all the images based on the excitation/inhibition burst/pause behaviors
import matplotlib as mpl
mpl.use('tkagg')
from Purkinje_py3 import Purkinje_py3
-from neuron import h
import numpy as np
import multiprocessing
import matplotlib.pyplot as plt
hines@hines-T7500:~/Downloads/Purkinjecell_2017$ nrniv -python protocols/*.py
NEURON -- VERSION 8.0a-603-g078a7b12a master (078a7b12a) 2021-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits
loading membrane mechanisms from x86_64/.libs/libnrnmech.so
Additional mechanisms from files
"mod_files/Cav2_1.mod" "mod_files/Cav3_1.mod" "mod_files/Cav3_2.mod" "mod_files/Cav3_3.mod" "mod_files/cdp5.mod" "mod_files/HCN1_Angeloetal2007.mod" "mod_files/Kca11.mod" "mod_files/Kca22.mod" "mod_files/Kca31.mod" "mod_files/Kir23.mod" "mod_files/Kv11.mod" "mod_files/Kv15.mod" "mod_files/Kv33.mod" "mod_files/Kv34.mod" "mod_files/Kv43.mod" "mod_files/Leak.mod" "mod_files/Nav16.mod" "mod_files/PC_Gaba_det_vi_alfa1.mod" "mod_files/PURKINJE_Ampa_det_vi.mod" "mod_files/UBC_TRP.mod"
cores 8
1
len pf 100
len aa 0
len stl 25
>>> nrniv: Arg out of range in user function
near line 1
{forall SectionList[79].append()}
^
ModelViewSeclistAnalysis[1].Matrix(4.68326e-310, 4.68326e-310)
ModelViewSeclistAnalysis[1].MechanismStandard("Kv1_5", Matrix[603])
ModelViewSeclistAnalysis[1].mk_parm_subsets()
ModelViewSeclistAnalysis[1].analyse()
and others
*** longjmp causes uninitialized stack frame ***: nrniv terminated
Aborted (core dumped)
and
hines@hines-T7500:~/Downloads/Purkinjecell_2017$ python -i protocols/*.py
Traceback (most recent call last):
File "/home/hines/Downloads/Purkinjecell_2017/protocols/01_PFAA.py", line 6, in <module>
from Purkinje_py3 import Purkinje_py3
ModuleNotFoundError: No module named 'Purkinje_py3'
but the following also worked for me (with the import gui change above)
cp protocols/*.py temp.py
python -i temp.py
But seems brittle (but not always) in the sense of #1349 . I'm using
$ pyenv which python
/home/hines/.pyenv/versions/3.9.0/bin/python
I'm thinking there is indeed a thread problem but in the python from neuron import gui aspect.
I'm approaching this again with the latest master 9.0a-335-g1d812c87a and a clone of git@github.com:ModelDBRepository/239421.git on ubuntu 24.04
nrnivmodl mod_files
requires a minor tweak:
~/models/modeldb/239421$ git diff
diff --git a/mod_files/cdp5.mod b/mod_files/cdp5.mod
index 31d8e70..17c5905 100644
--- a/mod_files/cdp5.mod
+++ b/mod_files/cdp5.mod
@@ -99,10 +99,9 @@ ASSIGNED {
cai (mM)
mgi (mM)
vrat (1)
+ cao (mM)
}
-CONSTANT { cao = 2 (mM) }
-
STATE {
and nrngui -python protocols/01_PFAA.py
requires export PYTHONPATH=`pwd`:$PYTHONPATH
since apparently the working directory gets set to protocols so that otherwise
Traceback (most recent call last):
File "protocols/01_PFAA.py", line 5, in <module>
from Purkinje_py3 import Purkinje_py3
ModuleNotFoundError: No module named 'Purkinje_py3'
Anyway, after all this, modelview seems to work fine except for several ions with multiple styles not handled
messages. It appears that the cell is broken into about 49 pieces and I notice there is a
$ grep -r multisplit
readme.html:The model uses NEURON multisplit to distribute automatically the
protocols/01_PFAA.py:#this code discover the number of cores available in a CPU and activate the multisplit to use them all.
protocols/01_PFAA.py:p.multisplit(1)
The bottom line so far is that I'm not seeing an issue with modelview for version 9.0. I get same behavior on my Apple M1 Sonoma 14.6.1
@ramcdougal I'm closing this as it seems to be fixed for 9.0. Reopen if you think it needs to be looked into for 8.2.
Context
Overview of the issue
Attempting to use Model View for modeldb.yale.edu/239421 crashes. I wonder if this is related to the fact that the model uses threads.
Expected result/behavior
Not crashing. :)
NEURON setup
Minimal working example - MWE
Step 0: Download the model from https://modeldb.yale.edu/239421
step 1: compile mod files
step 2: start the simulation
step 3: stop the simulation
hit the stop button on the RunControl panel
step 4: display the main menu
step 5: attempt to open ModelView
Tools - ModelView
Logs
The exact error message varies, but here's one:
and another:
and another: