Hi!
I am trying to implement weight normalization (as you show in your documentation). It works well (see below code) when executed "normally" (or when using" mpirun -np 1"), but it hangs (it just do not respond) when executed using mpirun. It hangs when I try to execute nest.Simulate() after weigth assignment. If I remove the "conn.weight = w_nparray" instruction in the following code, it works without hang.
I use NEST 3.6 and python3, compiled with python, mpi, sionlib and music.
Thanks a lot in advance!
import nest import numpy as np
pos = nest.spatial.grid(shape = [30,30] ) input = nest.Create('iaf_psc_alpha', positions=pos)
layer_0 = nest.Create('iaf_psc_alpha', positions=pos) layer_1 = nest.Create('iaf_psc_alpha', positions=pos)
conn_neur = {'rule':'pairwise_bernoulli', 'use_on_source': True, 'mask': {'grid':{'shape':[9,9]}} }
nest.CopyModel('static_synapse', 'syn_1_model') syn_0 = {'synapse_model': 'static_synapse'} syn_1 = {'synapse_model': 'syn_1_model'}
nest.Connect(input, layer_0, conn_neur, syn_0) nest.Connect(input, layer_1, conn_neur, syn_0)
nest.DumpLayerConnections(input, layer_0, 'static_synapse', 'conn.txt') nest.DumpLayerConnections(input, layer_1, 'syn_1_model', 'conn.txt')
nest.Simulate(100)
for neuron in layer_0: conn = nest.GetConnections(source=input, target=neuron, synapse_model='static_synapse') w = np.array(conn.weight) if (w.size>1): w_normed = w / sum(abs(w)) # L1-norm w_nparray = 2. * w_normed conn.weight = w_nparray
nest.Simulate(100)