How to use arbor - 10 common examples

To help you get started, we’ve selected a few arbor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arbor-sim / arbor / python / example / ring.py View on Github external
hint.gpu_group_size = 1000
print(f'{hint}')

hints = dict([(arbor.cell_kind.cable, hint)])
decomp = arbor.partition_load_balance(recipe, context, hints)
print(f'{decomp}')

meters.checkpoint('load-balance', context)

sim = arbor.simulation(recipe, decomp, context)

meters.checkpoint('simulation-init', context)

spike_recorder = arbor.attach_spike_recorder(sim)

pid = arbor.cell_member(0,0) # cell 0, probe 0
# Attach a sampler to the voltage probe on cell 0.
# Sample rate of 1 sample every ms.
sampler = arbor.attach_sampler(sim, 1, pid)

sim.run(100)
print(f'{sim} finished')

meters.checkpoint('simulation-run', context)

print(f'{arbor.meter_report(meters, context)}')

for sp in spike_recorder.spikes:
    print(sp)

print('voltage samples for probe id ', end = '')
print(pid, end = '')
github arbor-sim / arbor / python / example / ring.py View on Github external
def connections_on(self, gid):
        src = (gid-1)%self.ncells
        w = 0.01
        d = 10
        return [arbor.connection(arbor.cell_member(src,0), arbor.cell_member(gid,0), w, d)]
github arbor-sim / arbor / python / example / ring.py View on Github external
def event_generators(self, gid):
        if gid==0:
            sched = arbor.explicit_schedule([1])
            return [arbor.event_generator(arbor.cell_member(0,0), 0.1, sched)]
        return []
github arbor-sim / arbor / python / example / ring.py View on Github external
def get_probe(self, id):
        loc = arbor.location(0, 0) # at the soma
        return arbor.cable_probe('voltage', id, loc)

context = arbor.context(threads=4, gpu_id=None)
print(context)

meters = arbor.meter_manager()
meters.start(context)

recipe = ring_recipe(10)
print(f'{recipe}')

meters.checkpoint('recipe-create', context)

decomp = arbor.partition_load_balance(recipe, context)
print(f'{decomp}')

hint = arbor.partition_hint()
hint.prefer_gpu = True
hint.gpu_group_size = 1000
print(f'{hint}')

hints = dict([(arbor.cell_kind.cable, hint)])
decomp = arbor.partition_load_balance(recipe, context, hints)
print(f'{decomp}')

meters.checkpoint('load-balance', context)

sim = arbor.simulation(recipe, decomp, context)

meters.checkpoint('simulation-init', context)
github arbor-sim / arbor / python / example / ring.py View on Github external
recipe = ring_recipe(10)
print(f'{recipe}')

meters.checkpoint('recipe-create', context)

decomp = arbor.partition_load_balance(recipe, context)
print(f'{decomp}')

hint = arbor.partition_hint()
hint.prefer_gpu = True
hint.gpu_group_size = 1000
print(f'{hint}')

hints = dict([(arbor.cell_kind.cable, hint)])
decomp = arbor.partition_load_balance(recipe, context, hints)
print(f'{decomp}')

meters.checkpoint('load-balance', context)

sim = arbor.simulation(recipe, decomp, context)

meters.checkpoint('simulation-init', context)

spike_recorder = arbor.attach_spike_recorder(sim)

pid = arbor.cell_member(0,0) # cell 0, probe 0
# Attach a sampler to the voltage probe on cell 0.
# Sample rate of 1 sample every ms.
sampler = arbor.attach_sampler(sim, 1, pid)

sim.run(100)
github arbor-sim / arbor / python / example / ring.py View on Github external
hints = dict([(arbor.cell_kind.cable, hint)])
decomp = arbor.partition_load_balance(recipe, context, hints)
print(f'{decomp}')

meters.checkpoint('load-balance', context)

sim = arbor.simulation(recipe, decomp, context)

meters.checkpoint('simulation-init', context)

spike_recorder = arbor.attach_spike_recorder(sim)

pid = arbor.cell_member(0,0) # cell 0, probe 0
# Attach a sampler to the voltage probe on cell 0.
# Sample rate of 1 sample every ms.
sampler = arbor.attach_sampler(sim, 1, pid)

sim.run(100)
print(f'{sim} finished')

meters.checkpoint('simulation-run', context)

print(f'{arbor.meter_report(meters, context)}')

for sp in spike_recorder.spikes:
    print(sp)

print('voltage samples for probe id ', end = '')
print(pid, end = '')
print(':')

time = []
github arbor-sim / arbor / python / example / ring.py View on Github external
hint = arbor.partition_hint()
hint.prefer_gpu = True
hint.gpu_group_size = 1000
print(f'{hint}')

hints = dict([(arbor.cell_kind.cable, hint)])
decomp = arbor.partition_load_balance(recipe, context, hints)
print(f'{decomp}')

meters.checkpoint('load-balance', context)

sim = arbor.simulation(recipe, decomp, context)

meters.checkpoint('simulation-init', context)

spike_recorder = arbor.attach_spike_recorder(sim)

pid = arbor.cell_member(0,0) # cell 0, probe 0
# Attach a sampler to the voltage probe on cell 0.
# Sample rate of 1 sample every ms.
sampler = arbor.attach_sampler(sim, 1, pid)

sim.run(100)
print(f'{sim} finished')

meters.checkpoint('simulation-run', context)

print(f'{arbor.meter_report(meters, context)}')

for sp in spike_recorder.spikes:
    print(sp)
github arbor-sim / arbor / python / example / ring.py View on Github external
def get_probe(self, id):
        loc = arbor.location(0, 0) # at the soma
        return arbor.cable_probe('voltage', id, loc)
github arbor-sim / arbor / python / example / ring.py View on Github external
def cell_kind(self, gid):
        return arbor.cell_kind.cable
github arbor-sim / arbor / python / example / ring.py View on Github external
meters.start(context)

recipe = ring_recipe(10)
print(f'{recipe}')

meters.checkpoint('recipe-create', context)

decomp = arbor.partition_load_balance(recipe, context)
print(f'{decomp}')

hint = arbor.partition_hint()
hint.prefer_gpu = True
hint.gpu_group_size = 1000
print(f'{hint}')

hints = dict([(arbor.cell_kind.cable, hint)])
decomp = arbor.partition_load_balance(recipe, context, hints)
print(f'{decomp}')

meters.checkpoint('load-balance', context)

sim = arbor.simulation(recipe, decomp, context)

meters.checkpoint('simulation-init', context)

spike_recorder = arbor.attach_spike_recorder(sim)

pid = arbor.cell_member(0,0) # cell 0, probe 0
# Attach a sampler to the voltage probe on cell 0.
# Sample rate of 1 sample every ms.
sampler = arbor.attach_sampler(sim, 1, pid)