Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Attach a generator to the first cell in the ring.
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 []
# Define one probe (for measuring voltage at the soma) on each cell.
def num_probes(self, gid):
return 1
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