Actually, NEURON can be used for three different styles of parallel simulation. The first question is which of these is most appropriate for the particular modeling project.
1. Multithreaded simulation. This is most suitable for complex models of individual cells--where there are at least several thousand states that need to be integrated. It's very easy to implement, since the only requirement is that biophysical mechanisms be "thread safe". Basically this means avoiding situations in which code in different threads tries to write to the same global variable. In most cases the user's original code can be used without having to make any changes at all; in those occasions when changes are necessary, it is often sufficient to simply insert the directive
THREADSAFE
in the NEURON block of one or more NMODL files, then recompile them. Works with the GUI, so very convenient for use on a single PC or Mac. Speedup tends to be sublinear with the number of processors, and there is usually little benefit to having more than a 12-16 threads.
2. "Bulletin board style." This is for embarrassingly parallel problems, that is, problems that require many runs of serial code. Examples include parameter space exploration. In "bulletin board style" parallel simulation, one processor is the "master" processor, and the other processors are "worker" processors. The master processor does this:
Code: Select all
REPEAT
post a "job" to the "bulletin board"
UNTIL all jobs have been posted
REPEAT
if a result has been posted to the bulletin board, take it from the board
else
take a "job" from the bulletin board
execute the job
post the result to the bulletin board
UNTIL there are no more jobs or results on the bulletin board
"Worker" processors do this:
Code: Select all
REPEAT
take a job from the bulletin board
execute it
post the result back to the bulletin board
UNTIL no more jobs remain to be done
Speedup is proportional to the number of processors as long as there are enough jobs to keep all processors busy. Requres some reorganization of the user's model code (change it so that one makes a function call to launch a simulation run, and the value returned by the function is the result of the run). This can be done purely with hoc, but Python is better if the simulation results are anything other than purely numerical values since Python can return anything that is pickleable. Requires MPI. Read about the ParallelContext class in the Programmer's Reference
http://www.neuron.yale.edu/neuron/stati ... arcon.html
3. Simulation of a model that is distributed over multiple processors. The model can be of a single cell or of a network. If a network model, coupling between cells can be via spikes and/or gap junctions. Balance is essential for good performance. If necessary, one or more cells can be split into multiple pieces and distributed over 2 or more processors to achieve balance. Requires MPI. Read about ParallelContext (see above) and also see these papers which are available from
http://www.neuron.yale.edu/neuron/nrnpubs:
Migliore, M, Cannia, C., Lytton, W.W., Markram, H. and Hines, M.L. Parallel network simulations with NEURON. Journal of Computational Neuroscience 21:119-129, 2006.
Brette, R., Rudolph, M., Carnevale, T., Hines, M., Beeman, D., Bower, J.M., Diesmann, M., Goodman, P.H., Harris, F.C.J., Zirpe, M., Natschläger, T., Pecevski, D., Ermentrout, B., Djurfeldt, M., Lansner, A., Rochel, O., Vieville, T., Muller, E., Davison, A., El Boustani, S., and Destexhe, A. Simulation of networks of spiking neurons: a review of tools and strategies. J. Comput. Neurosci. 23:349-398, 2007.
Hines, M.L. and Carnevale, N.T. Translating network models to parallel hardware in NEURON. J. Neurosci. Methods 169:425-455, 2008.
Hines, M.L., Eichner, H. and Schuermann, F. Neuron splitting in compute-bound parallel network simulations enables runtime scaling with twice as many processors. Journal of Computational Neuroscience 25:203-210, 2008.
Hines, M.L., Markram, H. and Schuermann, F. Fully implicit parallel simulation of single neurons. Journal of Computational Neuroscience 25:439-448, 2008.