Dear Petia,
On each MPI rank, GetConnections() will only collect connections for which the post-synaptic neuron is on that MPI rank. You then need to find a way to collect this information across ranks. If you only need that information for offline processing, it might be easiest to write the connection information to file from each rank and then collect across ranks (you probably don't want to store the result from GetConnections(), but rather get the status of the synapses and store that). As a starting point, you could take the
https://nest-simulator.readthedocs.io/en/v3.4/auto_examples/store_restore_network.html
example. There, connections (and neurons) are stored with
network = {}
network["n_vp"] = nest.total_num_virtual_procs
network["e_nrns"] = self.neurons.get(["V_m"], output="pandas")
network["i_nrns"] = self.neurons.get(["V_m"], output="pandas")
network["e_syns"] = nest.GetConnections(synapse_model="e_syn").get(
("source", "target", "weight"), output="pandas")
network["i_syns"] = nest.GetConnections(synapse_model="i_syn").get(
("source", "target", "weight"), output="pandas")
with open(dump_filename, "wb") as f:
pickle.dump(network, f, pickle.HIGHEST_PROTOCOL)
You might not need the data on neurons, and you would have to write one file per MPI rank. Depending on your synapse type, you may want to store more parameters than source, target and weight.
If you need the information at runtime, you could try to use mpi4py to aggregate the connection information across ranks.
Best,
Hans Ekkehard
--
Prof. Dr. Hans Ekkehard Plesser
Head, 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
Home http://arken.nmbu.no/~plesser
From: Petia Koprinkova <pkoprinkova@yahoo.com>
Date: Monday, 5 June 2023 at 13:11
To: NEST User Mailing List <users@nest-simulator.org>
Subject: [NEST Users] GetConnections in distributed simulation
Dear NEST Support team,
We are trying to get the weights of stdp synapses during a distributed simulation.
According to NEST documentation and our experience function GetConnections returns only local connections but not all connections in our model.
Could you please advise us how to get all connections in such a case?
Best regards,
Petia Koprinkova-Hristova