network.t.record(neuron.h._ref_t) else: network.t = None ############################################################################ # run simulation, gather results across all RANKs ############################################################################ # Assert that connect routines has finished across RANKS before starting # main simulation procedure COMM.Barrier() if RANK == 0: print('running simulation....') if PSET.COMPUTE_LFP: SPIKES, SUMMED_OUTPUT, CURRENT_DIPOLE_MOMENT = network.simulate( electrode=electrode, rec_current_dipole_moment=PSET.COMPUTE_P, rec_pop_contributions=PSET.rec_pop_contributions, **PSET.NetworkSimulateArgs) else: SPIKES = network.simulate() # note: OUTPUT is a structured array if # PSET.COMPUTE_LFP = True and PSET.COMPUTE_P is False and # PSET.rec_pop_contributions is False. # If PSET.COMPUTE_P == True and/or PSET.rec_pop_contributions == True, # then output is a tuple (OUTPUT, current_dipole_moment) if RANK == 0: run_simulation_time = time() - tic print('Simulations finished in {} seconds'.format(run_simulation_time)) logfile.write('simulation {}\n'.format(run_simulation_time)) tic = time()
network.t = None ############################################################################ # run simulation, gather results across all RANKs ############################################################################ # Assert that connect routines has finished across RANKS before starting # main simulation procedure COMM.Barrier() if RANK == 0: print('running simulation....') if PSET.COMPUTE_LFP: SPIKES, SUMMED_OUTPUT, CURRENT_DIPOLE_MOMENT = network.simulate( electrode=electrode, rec_current_dipole_moment=PSET.COMPUTE_P, rec_pop_contributions=PSET.rec_pop_contributions, **PSET.NetworkSimulateArgs) else: SPIKES = network.simulate() # note: OUTPUT is a structured array if # PSET.COMPUTE_LFP = True and PSET.COMPUTE_P is False and # PSET.rec_pop_contributions is False. # If PSET.COMPUTE_P == True and/or PSET.rec_pop_contributions == True, # then output is a tuple (OUTPUT, current_dipole_moment) if RANK == 0: run_simulation_time = time() - tic print('Simulations finished in {} seconds'.format(run_simulation_time)) logfile.write('simulation {}\n'.format(run_simulation_time)) tic = time()
weightargs=weightArguments[i][j], minweight=minweight, delayfun=delayFunction, delayargs=delayArguments[i][j], mindelay=mindelay, multapsefun=multapseFunction, multapseargs=multapseArguments[i][j], syn_pos_args=synapsePositionArguments[i][j], ) # set up extracellular recording device: electrode = RecExtElectrode(**electrodeParameters) # run simulation: SPIKES, OUTPUT, DIPOLEMOMENT = network.simulate( electrode=electrode, **networkSimulationArguments ) # collect somatic potentials across all RANKs to RANK 0: if RANK == 0: somavs = [] for i, name in enumerate(population_names): somavs.append([]) somavs[i] += [cell.somav for cell in network.populations[name].cells] for j in range(1, SIZE): somavs[i] += COMM.recv(source=j, tag=15) else: somavs = None for name in population_names: COMM.send([cell.somav for cell in network.populations[name].cells],
if RANK == 0: network.t = neuron.h.Vector() network.t.record(neuron.h._ref_t) else: network.t = None ########################################################################## # run simulation, gather results across all RANKs ########################################################################## # Assert that connect routines has finished across RANKS before starting # main simulation procedure COMM.Barrier() if RANK == 0: print('running simulation....') SPIKES = network.simulate(probes=probes, rec_pop_contributions=PSET.rec_pop_contributions, **PSET.NetworkSimulateArgs) if RANK == 0: run_simulation_time = time() - tic print('Simulations finished in {} seconds'.format(run_simulation_time)) logfile.write('simulation {}\n'.format(run_simulation_time)) tic = time() ########################################################################## # save simulated output to file to allow for offline plotting ########################################################################## if RANK == 0: f = h5py.File( os.path.join(PSET.OUTPUTPATH,
multapseargs=multapseArguments[i][j], syn_pos_args=synapsePositionArguments[i][j], save_connections=False, ) # set up extracellular recording device. # Here `cell` is set to None as handles to cell geometry is handled # internally electrode = RecExtElectrode(cell=None, **electrodeParameters) # set up recording of current dipole moments. Ditto with regards to # `cell` being set to None current_dipole_moment = CurrentDipoleMoment(cell=None) # run simulation: SPIKES = network.simulate(probes=[electrode, current_dipole_moment], **networkSimulationArguments) # collect somatic potentials across all RANKs to RANK 0: if RANK == 0: somavs = [] for i, name in enumerate(population_names): somavs_pop = None # avoid undeclared variable for j, cell in enumerate(network.populations[name].cells): if j == 0: somavs_pop = cell.somav else: somavs_pop = np.vstack((somavs_pop, cell.somav)) if RANK == 0: for j in range(1, SIZE): recv = COMM.recv(source=j, tag=15) if somavs_pop is None:
delayfun=delayFunction, delayargs=delayArguments[i][j], mindelay=mindelay, multapsefun=multapseFunction, multapseargs=multapseArguments[i][j], syn_pos_args=synapsePositionArguments[i][j], save_connections=False, # Creates synapse_positions.h5 ) electrode = RecExtElectrode(**electrodeParameters) EEG_electrode_params = dict(x=0, y=0, z=90000., method="soma_as_point") EEG_electrode = RecExtElectrode(**EEG_electrode_params) # run simulation: SPIKES2, OUTPUT2, DIPOLEMOMENT2 = network.simulate( electrode=electrode, # electrode = EEG_electrode, **networkSimulationArguments, ) # collect somatic potentials across all RANKs to RANK 0: if RANK == 0: somavs = [] for i, name in enumerate(population_names): somavs.append([]) somavs[i] += [ cell.somav for cell in network.populations[name].cells ] for j in range(1, SIZE): somavs[i] += COMM.recv(source=j, tag=15) else: somavs = None