Builder creating "thírd in" connections based on data from "third out" builder. More...
#include <conn_builder.h>
Classes | |
| struct | SourceThirdInfo_ |
| Provide information on connections from primary source to third-factor population. More... | |
Public Member Functions | |
| ThirdInBuilder (NodeCollectionPTR sources, NodeCollectionPTR third, const Dictionary &third_conn_spec, const std::vector< Dictionary > &syn_specs) | |
| ~ThirdInBuilder () | |
| void | register_connection (size_t primary_source_id, size_t third_node_id) |
| Register required source node to third-factor node connection. | |
Public Member Functions inherited from nest::BipartiteConnBuilder | |
| virtual void | connect () |
| Connect with or without structural plasticity. | |
| virtual void | disconnect () |
| Delete synapses with or without structural plasticity. | |
| BipartiteConnBuilder (NodeCollectionPTR sources, NodeCollectionPTR targets, ThirdOutBuilder *third_out, const Dictionary &conn_spec, const std::vector< Dictionary > &syn_specs) | |
| virtual | ~BipartiteConnBuilder () |
| size_t | get_synapse_model () const |
| bool | get_default_delay () const |
| void | set_synaptic_element_names (const std::string &pre_name, const std::string &post_name) |
| bool | change_connected_synaptic_elements (size_t snode_id, size_t tnode_id, const size_t tid, int update) |
| Updates the number of connected synaptic elements in the target and the source. | |
| virtual bool | supports_symmetric () const |
| Return true if rule allows creation of symmetric connectivity. | |
| virtual bool | is_symmetric () const |
| Return true if rule automatically creates symmetric connectivity. | |
| bool | allows_autapses () const |
| bool | allows_multapses () const |
| virtual bool | requires_proxies () const |
| Return true if rule is applicable only to nodes with proxies. | |
Private Member Functions | |
| void | connect_ () override |
| Exchange required connection info via MPI and create needed connections locally. | |
Private Attributes | |
| std::vector< BlockVector< SourceThirdInfo_ > * > | source_third_gids_ |
| Container for register source-third connections, one per thread via pointer for collision free operation in thread-local storage. | |
| std::vector< std::vector< size_t > * > | source_third_counts_ |
| Number of source-third pairs to send. Outer dimension is writing thread, inner dimension MPI rank to send to. | |
Additional Inherited Members | |
Protected Member Functions inherited from nest::BipartiteConnBuilder | |
| bool | all_parameters_scalar_ () const |
| virtual void | sp_connect_ () |
| virtual void | disconnect_ () |
| virtual void | sp_disconnect_ () |
| void | update_param_dict_ (size_t snode_id, Node &target, size_t target_thread, RngPtr rng, size_t indx) |
| void | single_connect_ (size_t, Node &, size_t, RngPtr) |
| Create connection between given nodes, fill parameter values. | |
| void | single_disconnect_ (size_t, Node &, size_t) |
| void | skip_conn_parameter_ (size_t, size_t n_skip=1) |
| Moves pointer in parameter array. | |
| bool | loop_over_targets_ () const |
| Returns true if conventional looping over targets is indicated. | |
Protected Attributes inherited from nest::BipartiteConnBuilder | |
| NodeCollectionPTR | sources_ |
| Population to connect from. | |
| NodeCollectionPTR | targets_ |
| Population to connect to. | |
| ThirdOutBuilder * | third_out_ |
| To be triggered when primary connection is created. | |
| bool | allow_autapses_ |
| bool | allow_multapses_ |
| bool | make_symmetric_ |
| bool | creates_symmetric_connections_ |
| std::vector< std::exception_ptr > | exceptions_raised_ |
| buffer for exceptions raised in threads | |
| std::string | pre_synaptic_element_name_ |
| std::string | post_synaptic_element_name_ |
| bool | use_structural_plasticity_ |
| std::vector< ConnParameter * > | parameters_requiring_skipping_ |
| Pointers to connection parameters specified as arrays. | |
| std::vector< size_t > | synapse_model_id_ |
| std::vector< std::vector< Dictionary > > | param_dicts_ |
| Dictionaries to pass to connect function, one per thread for every syn_spec. | |
Builder creating "thírd in" connections based on data from "third out" builder.
This builder creates the actual connections from primary sources to third-factor nodes based on the source-third lists generated by the third-out builder.
The ThirdOutBuilder::third_connect() method calls register_connection() for each source node to third-factor node connection that needs to be created to store this information in the ThirdIn builder.
The connect_() method of this class needs to be called after all primary connections and third-factor to target connections have been created. It then exchanges information about required source-third connections with the other MPI ranks and creates required connections locally.
The class is final because there is no freedom of choice of connection rule at this stage.
| ThirdInBuilder::ThirdInBuilder | ( | NodeCollectionPTR | sources, |
| NodeCollectionPTR | third, | ||
| const Dictionary & | third_conn_spec, | ||
| const std::vector< Dictionary > & | syn_specs | ||
| ) |
References nest::VPManager::get_thread_id(), nest::kernel(), source_third_counts_, source_third_gids_, and nest::KernelManager::vp_manager.
| ThirdInBuilder::~ThirdInBuilder | ( | ) |
References nest::VPManager::get_thread_id(), nest::kernel(), source_third_counts_, source_third_gids_, and nest::KernelManager::vp_manager.
|
overrideprivatevirtual |
Exchange required connection info via MPI and create needed connections locally.
Implements nest::BipartiteConnBuilder.
References nest::VPManager::assert_single_threaded(), nest::MPIManager::communicate(), nest::MPIManager::communicate_Alltoall(), nest::MPIManager::get_num_processes(), nest::MPIManager::get_rank(), nest::VPManager::get_thread_id(), nest::RandomManager::get_vp_specific_rng(), nest::VPManager::is_node_id_vp_local(), nest::kernel(), nest::KernelManager::mpi_manager, nest::KernelManager::random_manager, nest::BipartiteConnBuilder::single_connect_(), source_third_counts_, source_third_gids_, and nest::KernelManager::vp_manager.
| void ThirdInBuilder::register_connection | ( | size_t | primary_source_id, |
| size_t | third_node_id | ||
| ) |
Register required source node to third-factor node connection.
| primary_source_id | GID of source node to connect from |
| third_node_id | GID of target node to connect to |
References nest::MPIManager::get_process_id_of_vp(), nest::VPManager::get_thread_id(), nest::kernel(), nest::KernelManager::mpi_manager, source_third_counts_, source_third_gids_, and nest::KernelManager::vp_manager.
Referenced by nest::ThirdBernoulliWithPoolBuilder::third_connect().
|
private |
Number of source-third pairs to send. Outer dimension is writing thread, inner dimension MPI rank to send to.
Referenced by connect_(), register_connection(), ThirdInBuilder(), and ~ThirdInBuilder().
|
private |
Container for register source-third connections, one per thread via pointer for collision free operation in thread-local storage.
Referenced by connect_(), register_connection(), ThirdInBuilder(), and ~ThirdInBuilder().