-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow DumpLayerConnections() #3142
Comments
The following version of dump_connections() reduces the execution time to 9 seconds. I checked the results are correct and exactly the same as the original method. template < int D > // Dictionary with parameters for get_connections() // Avoid setting up new array for each iteration of the loop // for ( typename std::vector< std::pair< Position< D >, size_t > >::iterator src_iter = src_vec->begin(); // const size_t source_node_id = src_iter->second; // source_array[ 0 ] = source_node_id;
// DictionaryDatum result_dict = kernel().connection_manager.get_synapse_status( con_id.get_source_node_id(),
// } |
I send this even improved version, considering (I do not know if it is true) that both connectome and source nodes positions (src_vec) are ordered by source node. I checked the results are correct and exactly the same as the original version.
} |
I propose this solution at pull request #3160 |
Issue automatically marked stale! |
Is your feature request related to a problem? Please describe.
Execution of DumpLayerConnections() is probably too slow (see code below).
Describe alternatives you've considered
Given the present implementation of DumpLayerConnections(), a solution would be to profile the implementation and improve speed.
Another possible solution (in addition to the previous one) could be to add another version of DumpLayerConnections() that accepts a collection of connections as input parameter. Something similar to:
my_conn = nest.GetConnections(layer1, layer2, ...)
nest.DumpConnections(my_conn)
Additional context
The following code takes 1m20s to execute with NEST 3.6 (git master head from february 12th) Python 3.8.12, RockyLinux 8.5
import nest
pos = nest.spatial.grid(shape = [100,100] )
input_l = nest.Create('iaf_psc_alpha', positions=pos)
layer_0 = nest.Create('iaf_psc_alpha', positions=pos)
conn_neur = {'rule':'pairwise_bernoulli', 'mask': {'grid':{'shape':[10,10]}} }
syn_0 = {'synapse_model': 'static_synapse'}
nest.Connect(input_l, layer_0, conn_neur, syn_0)
nest.DumpLayerConnections(input_l, layer_0, 'static_synapse', 'conn.txt')
The text was updated successfully, but these errors were encountered: