Page 1 of 1

Parallelization of a single cell

Posted: Mon Sep 04, 2017 10:22 pm
by nikkip
Hi Ted and Mike,

I was wondering if it's possible to parallelize an unbranched single cell (with many compartments).

If yes, I assume it involves using multisplit: https://www.neuron.yale.edu/neuron/stat ... multisplit.

Is there a simple example showing usage of this function?

Thanks so much,

Nikki

Re: Parallelization of a single cell

Posted: Tue Sep 05, 2017 11:33 am
by ted
Yes it is possible, and yes it would involve multisplit; see
Hines, M.L., Markram, H. and Schuermann, F.
Fully implicit parallel simulation of single neurons.
Journal of Computational Neuroscience 25:439-448, 2008.
which is available from a link at http://www.neuron.yale.edu/neuron/nrnpubs; you'll find its source code in ModelDB.

The real question is whether it would be worth the effort--programmer time is far more expensive than computer time. Have you tried multithreaded execution? That's doable with almost no effort if the NMODL-specified mechanisms are threadsafe. And, with very few exceptions, only minor revisions are required to make most non-threadsafe NMODL-specified mechanisms threadsafe--see this post in the NEURON Forum
viewtopic.php?f=22&t=1476
starting from the header Parallel Computing tool

Re: Parallelization of a single cell

Posted: Tue Sep 05, 2017 6:52 pm
by nikkip
Thanks for the quick reply!!

Good question. I have not tried multithreaded, although I don't grasp the pros/cons/implications of multithreading vs using multisplit.

To provide some more context about my task: We currently use a bash script to post a large number of independent NEURON jobs on a computer cluster. Each job is simulating a single cell with many sections (potentially many segments per section), but no branching. We're using the extracellular mechanism.

It will be worth our time given our project plans if we can parallelize each of those cells/jobs.

Is there a simple way in which multithreading can be used to parallelize each cell on a computer cluster? Or should I start playing around with getting multisplit integrated into our model and MPI working with NEURON on the cluster (although that may already be in place)?

Thanks again,

Nikki

Re: Parallelization of a single cell

Posted: Wed Sep 06, 2017 1:24 pm
by ted
Unfortunately extracellular is incompatible with multithreaded execution. You're stuck with doing what you're already doing, or installing MPI so you can
1. do essentially what you're already doing, but accomplishing it via NEURON's bulletin-board style approach for embarassingly parallel problems
or
2. resort to parallel simulation of individual cell models via multisplit
or
3. a combination of 1 and 2.

Of these 3 alternatives, 1 is the easiest because it requires the least modification of your code.

Re: Parallelization of a single cell

Posted: Wed Sep 06, 2017 1:57 pm
by nikkip
Thanks Ted. I'm already doing #1, so looking to add on #2. I'll work from Hines 2008 & associated ModelDB entry.

Thanks,

Nikki

Re: Parallelization of a single cell

Posted: Thu Sep 07, 2017 8:44 pm
by nikkip
Hi again,

In looking more carefully at the multisplit documentation, it says that it cannot be used with the extracellular mechanism. Is that correct? In which case there's no way to split a single cell across multiple processors if using extracellular?

https://www.neuron.yale.edu/neuron/stat ... multisplit

Thanks,

Nikki

Re: Parallelization of a single cell

Posted: Fri Sep 08, 2017 11:37 am
by hines
It is not possible to combine multisplit and extracellular. Multisplit is limited to tree topology matrices. In principle the implementation could
be generalized to handle extracellular but it would require a complete rewriting with no guarantee of significant performance gains.
I presume your model substantively requires extracellular and not just for the side effect of i_membrane computation (to help compute a local field potential).
In the latter case one can replace extracellular with cvode.use_fast_imem(1) in which case one can use parallel cvode and multisplit.

Re: Parallelization of a single cell

Posted: Mon Sep 11, 2017 9:02 am
by nikkip
Hi Mike,

I do need to use the extracellular method. Thanks for clarifying.

Nikki