Ejemplo n.º 1
0
def splitcell(graph, sim):
    pc = h.ParallelContext()  # object to access MPI methods
    MPI_size = int(pc.nhost())
    MPI_rank = int(pc.id())

    h.load_file("netparmpi.hoc")
    pnm = h.ParallelNetManager(1)

    cells = graph.get_local_cells()
    cell = cells[list(cells.keys())[0]]

    if MPI_rank == 0:
        pnm.splitcell(0, 1, sec=cell.hobj.apic[50])
        # cells = graph.get_local_cells()
        # cell = cells[list(cells.keys())[0]]
        # import pdb; pdb.set_trace()
    else:
        pnm.splitcell(1, 0, sec=cell.hobj.apic[50])
Ejemplo n.º 2
0
from neuron import h, gui
h.tstop = 100

h.load_file('netparmpi.hoc')
ncell = 128
pnm = h.ParallelNetManager(ncell)
pc = pnm.pc

# try with multiple threads
pnm.pc.nthread(32)

pnm.round_robin()

for i in range(ncell):
    if pnm.gid_exists(i):
        pnm.register_cell(i, h.IntFire1())

for i in range(ncell):
    pnm.nc_append(i, (i + 1) % ncell, -1, 1.1, 2)

# stimulate
if pnm.gid_exists(4):
    stim = h.NetStim(.5)
    ncstim = h.NetCon(stim, pnm.pc.gid2obj(4))
    ncstim.weight[0] = 1.1
    ncstim.delay = 1
    stim.number = 1
    stim.start = 1

pnm.set_maxstep(100)  # will end up being 2
Ejemplo n.º 3
0
poplist.append(CellPop(num=1, order=4, popname="OLMCell", classtype="OLMCell", isart=0))
poplist.append(CellPop(num=100*network_scale, order=5, popname="CA3Cell", classtype="StimCell", isart=1))
poplist.append(CellPop(num=20*network_scale, order=6, popname="ECCell", classtype="StimCell", isart=1))
poplist.append(CellPop(num=10*network_scale, order=7, popname="SEPCell", classtype="BurstCell", isart=1))

ncell = 0
for p in poplist:
    ncell += p.num
# creates the cells and appends them to a List called cells
cells = []
ranlist = []
nclist = []
h('{load_file("ranstream.hoc")}')  # to give each cell its own sequence generator
h('{load_file("netparmpi.hoc")}')  # to give each cell its own sequence generator

pnm = h.ParallelNetManager(ncell)	# Set up a parallel net manager for all the cells
pc = pnm.pc # Even if running serially, we can create and use this
                         # in serial, pc.nhost == 1
pnm.round_robin()					#Incorporate all processors - cells 0 through ncell-1


if (pc.id()==0 and printflag>0):
    print("simname = {} will run for {} ms, results will be in {}/*.dat".format(simname, SIMDUR, fstem))

# Set GID ranges of cells and Load Cell Class definitions
pop_by_name={}
st=0
i=0
pcst = pc.id()
core_i = 0
newcell = None