Hi Xavier,
I think I can reproduce your problem and have an idea what it may cause it. How many MPI
processes did you use?
Best,
Hans Ekkehard
--
Prof. Dr. Hans Ekkehard Plesser
Department of Data Science
Faculty of Science and Technology
Norwegian University of Life Sciences
PO Box 5003, 1432 Aas, Norway
Phone +47 6723 1560
Email hans.ekkehard.plesser@nmbu.no<mailto:hans.ekkehard.plesser@nmbu.no>
Home
http://arken.nmbu.no/~plesser
From: Xavier Otazu <xotazu(a)cvc.uab.cat>
Date: Wednesday, 7 February 2024 at 15:41
To: users(a)nest-simulator.org <users(a)nest-simulator.org>
Subject: [NEST Users] Weights assignment error with mpirun
[Some people who received this message don't often get email from xotazu(a)cvc.uab.cat.
Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]
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)
_______________________________________________
NEST Users mailing list -- users(a)nest-simulator.org
To unsubscribe send an email to users-leave(a)nest-simulator.org