Page **1** of **1**

### summation of matrix on different computer nodes

Posted: **Sun Nov 19, 2017 3:27 am**

by **breakwave922**

Hi,

I have a big network NEURON model, which is computed in parallel environment on superclusters. For each cell, I generated a matrix to save it's membrane voltages of all compartments, so these matrix should be on different computer nodes. I need to sum-up all the matrix from all cells.

Since those matrix should be local on each computer, not sure is it possible to sum them up and save the results into one file?

Any help is of course very much appreciated.

### Re: summation of matrix on different computer nodes

Posted: **Wed Nov 29, 2017 10:27 am**

by **ted**

Do you want to add up all the elements of the matrices? That doesn't seem like a useful thing to do--it would produce a single number on each host. Or do you just want to write the time course of each cell's membrane potential, in each compartment, to one or more files? That doesn't seem very practical, if your model cells have more than a few compartments or if run times are long.

You might find some useful ideas in this thread

**Regarding saving data from parallel simulations**
viewtopic.php?f=31&t=1987
especially the idea of using recorded spike times to recreate a cell's synaptic milieu (so you can examine the detailed time course of any of that cell's variables). This involves the use of an artificial spiking cell class called PatternStim, which is distributed with NEURON. I don't see much about PatternStim in the Programmer's Reference, but it is discussed in

Hines M, Eichner H, Schuermann F (2008) Neuron splitting in compute-bound parallel network simulations enables runtime scaling with twice as many processors J Comput Neurosci 25:203-210

which has a preprint you can get from here

https://neuron.yale.edu/neuron/static/p ... itcell.pdf
and an entry in ModelDB

https://senselab.med.yale.edu/ModelDB/s ... odel=97917

### Re: summation of matrix on different computer nodes

Posted: **Wed Nov 29, 2017 10:37 pm**

by **breakwave922**

Ted,

Thanks for the reply and information.

Actually, I saved each cell's membrane potential into a vector, cell by cell. Those cells are distributed among different cores, in paralleled environment. I can use .add(vec1) to sum them up, but this sum-up only applicable to cells on the same core. I wanted to ask how to sum up vectors among different cores. Then I found pc.allreduce(src_dest_vector, type=1) can realize it.

I testified with a simple paralleled code, and it works as I want.