This model does the integration in the run control of each timestep. From what I understand, this won't work in parallel simulations.
I am trying to instead use vectors. I am currently using the following method:
I create a vector for each segment of each section of each cell that records er_xtra, and then sum them all together at the end of the simulation. This works, but is obviously memory inefficient.
Code: Select all
114│ def _set_rec_vectors(self):
115│ self.rec_vectors = []
116│ for cell in self.cells:
117│ for sec in cell.all:
118│ if h.ismembrane('xtra'):
119│ for i in np.arange(sec.nseg+2)[1:-1]/float(sec.nseg+1):
120│ vec = h.Vector()
121│ vec.record(sec(i)._ref_er_xtra)
122│ self.rec_vectors.append(vec)
Code: Select all
124│ def _set_v_rec(self):
125│ self.v_rec = h.Vector()
126│ for cell in self.cells:
127│ for sec in cell.all:
128│ if h.ismembrane('xtra'):
129│ for i in np.arange(sec.nseg+2)[1:-1]/float(sec.nseg+1):
130│ temp = h.Vector()
131│ temp.record(sec(i)._ref_er_xtra)
132│ self.v_rec += temp
Code: Select all
self.v_rec = self.v_rec.add(temp)