I am trying to execute a script using MPI
Code: Select all
mpiexec -n 2 nrniv -nogui -mpi -python run_model_to_steady_state.py
Code: Select all
Python not available
When I try to run it directly from python
Code: Select all
mpiexec -n 2 python run_model_to_steady_state.py
I am using Red Hat Enterprise Linux Server release 7.9 (Maipo) with a Python 3.9.15 virtualenv with the following packages installed via pip:
Code: Select all
$ pip freeze
lazyarray==0.5.2
mpi4py==3.1.4
neo==0.11.1
NEURON==8.0.0
nrnutils==0.2.0
numpy==1.23.1
packaging==21.3
PyNN==0.10.0
pyparsing==3.0.9
quantities==0.13.0
scipy==1.9.0
I can run
nrniv
nrniv -nopython
without any issues.
My NRN_PYTHONHOME is set to the value reported by nrnpyenv.sh and Python lib directory is added to LD_LIBRARY_PATH. PYTHONPATH and PYTHONHOME are unset.
Is there anything I can try without compiling NEURON from scratch?
EDIT:
Found the solution, thanks everyone!
- Make sure your Python is built with a shared library
- export NRN_PYTHONHOME=/path/to/python
- export NRN_PYLIB=/path/to/your/shared/libpython3.so