IPC possible in NEURON?
IPC possible in NEURON?
In thinking about how to drive NEURON from an outside program, for example, MATLAB, it might be useful to open up interprocess communication (IPC) either between machines or between processes on a given machine. This way a low latency communication interface could be established that will enable for example passing of parameters to NEURON and/or outputs from NEURON to MATLAB, this would not require the writing/writing of intermediate files and would simplify some forms of parameter space searching. Is there a way in NEURON to open up an IPC port for reading or writing?
Re: IPC possible in NEURON?
I see that Python gives NEURON a plethora of IPC options:
http://docs.python.org/library/ipc.html .
A good test for NEURON as a worker using the hoc interpreter is
ssh localhost /path/to/nrniv -nogui -isatty files.hoc -
e.g:
The -isatty option prevents buffering so the stdout is flushed after every input command and the
oc> prompt is the last thing output so you know when nrniv is ready for the next command.
So matlab as the master can use this method using popen.
http://docs.python.org/library/ipc.html .
A good test for NEURON as a worker using the hoc interpreter is
ssh localhost /path/to/nrniv -nogui -isatty files.hoc -
e.g:
Code: Select all
[hines@hines490 ~]$ ssh localhost /home/hines/neuron/nrnmpi/x86_64/bin/nrniv -nogui -isatty -nobanner
/home/hines/.bashrc: line 33: nrnenv: command not found
oc>print "hello"
hello
oc>quit()
[hines@hines490 ~]$
oc> prompt is the last thing output so you know when nrniv is ready for the next command.
So matlab as the master can use this method using popen.