NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::NodeManager Class Reference

#include <node_manager.h>

Inheritance diagram for nest::NodeManager:
[legend]
Collaboration diagram for nest::NodeManager:
[legend]

Public Member Functions

 NodeManager ()
 
 ~NodeManager () override
 
void initialize (const bool) override
 Prepare manager for operation.
 
void finalize (const bool) override
 Take down manager after operation.
 
void set_status (const Dictionary &) override
 Set the status of the manager.
 
void get_status (Dictionary &) override
 Retrieve the status of the manager.
 
Dictionary get_status (size_t)
 Get properties of a node.
 
void set_status (size_t, const Dictionary &)
 Set properties of a Node.
 
NodeCollectionPTR add_node (size_t m, long n=1)
 Add a number of nodes to the network.
 
NodeCollectionPTR get_nodes (const Dictionary &dict, const bool local_only)
 Get node ID's of all nodes with the given properties.
 
size_t size () const
 Return total number of network nodes.
 
size_t get_max_num_local_nodes () const
 Returns the maximal number of nodes per virtual process.
 
size_t get_num_thread_local_devices (size_t t) const
 Returns the number of devices per thread.
 
void print (std::ostream &) const
 Print network information.
 
bool is_local_node (Node *) const
 Return true, if the given Node is on the local machine.
 
bool is_local_node_id (size_t node_id) const
 Return true, if the given node ID is on the local machine.
 
Node * get_node_or_proxy (size_t node_id, size_t tid)
 Return pointer to the specified Node.
 
Node * get_node_or_proxy (size_t)
 Return pointer of the specified Node.
 
Node * get_mpi_local_node_or_device_head (size_t)
 Return pointer of Node on the thread we are on.
 
std::vector< Node * > get_thread_siblings (size_t n) const
 Return a vector that contains the thread siblings.
 
void update_thread_local_node_data ()
 Rebuild per-thread vectors of local nodes and of local nodes needing WFR and set thread-local ID on nodes.
 
bool thread_local_data_is_up_to_date () const
 Return true if thread-local data structures and thread-local node IDs are up to date.
 
Node * thread_lid_to_node (size_t t, targetindex thread_local_id) const
 Return node on thread t with given local node id.
 
const std::vector< Node * > & get_wfr_nodes_on_thread (size_t) const
 Get list of nodes on given thread.
 
void prepare_nodes ()
 Prepare nodes for simulation and register nodes in node_list.
 
size_t get_num_active_nodes ()
 Get the number of nodes created by last prepare_nodes() call.
 
void post_run_cleanup ()
 Invoke post_run_cleanup() on all nodes.
 
void finalize_nodes ()
 Invoke finalize() on all nodes.
 
bool wfr_is_used () const
 Returns whether any node uses waveform relaxation.
 
void check_wfr_use ()
 Checks whether waveform relaxation is used by any node.
 
const SparseNodeArray & get_local_nodes (size_t) const
 Return a reference to the thread-local nodes of thread t.
 
bool have_nodes_changed () const
 
void set_have_nodes_changed (const bool changed)
 
NodeCollectionPTR node_id_to_node_collection (const size_t node_id) const
 Map the node ID to its original primitive NodeCollection object.
 
NodeCollectionPTR node_id_to_node_collection (Node *node) const
 Map the node to its original primitive NodeCollection object.
 
- Public Member Functions inherited from nest::ManagerInterface
 ManagerInterface (ManagerInterface const &)=delete
 
void operator= (ManagerInterface const &)=delete
 
 ManagerInterface ()
 
virtual ~ManagerInterface ()
 
virtual void prepare ()
 
virtual void cleanup ()
 

Private Member Functions

void init_ ()
 Initialize the network data structures.
 
void destruct_nodes_ ()
 
void set_status_single_node_ (Node &, const Dictionary &, bool clear_flags=true)
 Helper function to set properties on single node.
 
void prepare_node_ (Node *)
 Initialized buffers, register in list of nodes to update/finalize.
 
void add_neurons_ (Model &model, size_t min_node_id, size_t max_node_id)
 Add normal neurons.
 
void add_devices_ (Model &model, size_t min_node_id, size_t max_node_id)
 Add device nodes.
 
void add_music_nodes_ (Model &model, size_t min_node_id, size_t max_node_id)
 Add MUSIC nodes.
 
void append_node_collection_ (NodeCollectionPTR ncp)
 Append the NodeCollection instance into the NodeManager::nodeCollection_container.
 
void clear_node_collection_container ()
 

Private Attributes

std::vector< SparseNodeArray > local_nodes_
 The network as sparse array of local nodes.
 
std::vector< NodeCollectionPTR > node_collection_container_
 a vector of the original/primitive NodeCollection
 
std::vector< size_t > node_collection_last_
 Store the ID of the last element in each NodeCollection instance.
 
std::vector< std::vector< Node * > > wfr_nodes_vec_
 Nodelists for unfrozen nodes that use the waveform relaxation method.
 
bool wfr_is_used_
 there is at least one node that uses waveform relaxation
 
size_t size_last_local_data_update_
 
size_t num_active_nodes_
 Network size when local node data was last updated.
 
std::vector< size_t > num_thread_local_devices_
 stores number of thread local devices
 
bool have_nodes_changed_
 true if new nodes have been created since startup or last call to simulate
 
std::vector< std::exception_ptr > exceptions_raised_
 Store exceptions raised in thread-parallel sections for later handling.
 
Stopwatch< StopwatchGranularity::Normal, StopwatchParallelism::MasterOnly > sw_construction_create_
 

Constructor & Destructor Documentation

◆ NodeManager()

nest::NodeManager::NodeManager ( )

◆ ~NodeManager()

nest::NodeManager::~NodeManager ( )
override

References clear_node_collection_container(), and destruct_nodes_().

Here is the call graph for this function:

Member Function Documentation

◆ add_devices_()

void nest::NodeManager::add_devices_ ( Model &  model,
size_t  min_node_id,
size_t  max_node_id 
)
private

Add device nodes.

For device nodes, a clone of the node is added to every virtual process.

Parameters
modelModel of neuron to create.
min_node_idnode ID of first neuron to create.
max_node_idnode ID of last neuron to create (inclusive).

References exceptions_raised_, nest::VPManager::get_thread_id(), nest::kernel(), local_nodes_, num_thread_local_devices_, nest::Node::set_initialized(), nest::Node::set_local_device_id(), nest::Node::set_model_id(), nest::Node::set_node_id_(), nest::Node::set_thread(), nest::Node::set_vp(), and nest::KernelManager::vp_manager.

Referenced by add_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_music_nodes_()

void nest::NodeManager::add_music_nodes_ ( Model &  model,
size_t  min_node_id,
size_t  max_node_id 
)
private

Add MUSIC nodes.

Nodes for MUSIC communication are added once per MPI process and are always placed on thread 0.

Parameters
modelModel of neuron to create.
min_node_idnode ID of first neuron to create.
max_node_idnode ID of last neuron to create (inclusive).

References exceptions_raised_, nest::VPManager::get_thread_id(), nest::kernel(), local_nodes_, num_thread_local_devices_, nest::Node::set_initialized(), nest::Node::set_local_device_id(), nest::Node::set_model_id(), nest::Node::set_node_id_(), nest::Node::set_thread(), nest::Node::set_vp(), and nest::KernelManager::vp_manager.

Referenced by add_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_neurons_()

void nest::NodeManager::add_neurons_ ( Model &  model,
size_t  min_node_id,
size_t  max_node_id 
)
private

Add normal neurons.

Each neuron is added to exactly one virtual process. On all other VPs, it is represented by a proxy.

Parameters
modelModel of neuron to create.
min_node_idnode ID of first neuron to create.
max_node_idnode ID of last neuron to create (inclusive).

References exceptions_raised_, nest::VPManager::get_num_virtual_processes(), nest::VPManager::get_thread_id(), nest::kernel(), local_nodes_, nest::VPManager::node_id_to_vp(), nest::Node::set_initialized(), nest::Node::set_model_id(), nest::Node::set_node_id_(), nest::Node::set_thread(), nest::Node::set_vp(), nest::VPManager::thread_to_vp(), and nest::KernelManager::vp_manager.

Referenced by add_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_node()

NodeCollectionPTR nest::NodeManager::add_node ( size_t  m,
long  n = 1 
)

Add a number of nodes to the network.

This function creates n Node objects of Model m and adds them to the Network at the current position.

Parameters
mvalid Model ID.
nNumber of Nodes to be created. Defaults to 1 if not specified.
Returns
NodeCollection as lock pointer

References add_devices_(), add_music_nodes_(), add_neurons_(), nest::ModelRangeManager::add_range(), append_node_collection_(), nest::KernelManager::connection_manager, nest::ERROR, nest::KernelManager::event_delivery_manager, exceptions_raised_, nest::ModelManager::get_node_model(), have_nodes_changed_, nest::INFO, nest::kernel(), local_nodes_, LOG, nest::KernelManager::model_manager, nest::KernelManager::modelrange_manager, nest::ConnectionManager::resize_target_table_devices_to_number_of_neurons(), nest::ConnectionManager::resize_target_table_devices_to_number_of_synapse_types(), nest::EventDeliveryManager::set_off_grid_communication(), nest::Stopwatch< detailed_timer, threaded_timer >::start(), nest::Stopwatch< detailed_timer, threaded_timer >::stop(), and sw_construction_create_.

Referenced by nest::create(), and nest::AbstractLayer::create_layer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append_node_collection_()

void nest::NodeManager::append_node_collection_ ( NodeCollectionPTR  ncp)
private

Append the NodeCollection instance into the NodeManager::nodeCollection_container.

Parameters
ncpThe NodeCollection instance.

References node_collection_container_, and node_collection_last_.

Referenced by add_node().

Here is the caller graph for this function:

◆ check_wfr_use()

void nest::NodeManager::check_wfr_use ( )

◆ clear_node_collection_container()

void nest::NodeManager::clear_node_collection_container ( )
private

References node_collection_container_, and node_collection_last_.

Referenced by finalize(), and ~NodeManager().

Here is the caller graph for this function:

◆ destruct_nodes_()

void nest::NodeManager::destruct_nodes_ ( )
private

References nest::VPManager::get_thread_id(), nest::kernel(), local_nodes_, and nest::KernelManager::vp_manager.

Referenced by finalize(), and ~NodeManager().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalize()

void nest::NodeManager::finalize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Take down manager after operation.

After this method has completed, all dynamic data structures created by the manager shall be deallocated and containers emptied. Plain variables need not be reset.

Note
Finalization of any given manager may depend on other managers not having been finalized yet. KernelManager::finalize() is responsible for calling the initialization routines on the specific managers in correct order, i.e., the opposite order of initialize() calls.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment.
See also
initialize()

Implements nest::ManagerInterface.

References clear_node_collection_container(), and destruct_nodes_().

Here is the call graph for this function:

◆ finalize_nodes()

void nest::NodeManager::finalize_nodes ( )

Invoke finalize() on all nodes.

This function is called only if the thread data structures are properly set up.

References nest::VPManager::get_thread_id(), nest::kernel(), local_nodes_, and nest::KernelManager::vp_manager.

Referenced by nest::SimulationManager::cleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_local_nodes()

const SparseNodeArray & nest::NodeManager::get_local_nodes ( size_t  t) const
inline

Return a reference to the thread-local nodes of thread t.

References local_nodes_.

Referenced by nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::PoissonBuilder::connect_(), get_nodes(), nest::SPManager::get_synaptic_elements(), and nest::SimulationManager::update_().

Here is the caller graph for this function:

◆ get_max_num_local_nodes()

size_t nest::NodeManager::get_max_num_local_nodes ( ) const

Returns the maximal number of nodes per virtual process.

References nest::kernel(), and size().

Referenced by nest::TargetTable::prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mpi_local_node_or_device_head()

Node * nest::NodeManager::get_mpi_local_node_or_device_head ( size_t  node_id)

Return pointer of Node on the thread we are on.

If the node has proxies, it returns the node on the first thread (used by recorders).

@params node_id Index of the Node.

References nest::ModelManager::get_proxy_node(), nest::Node::has_proxies(), nest::kernel(), local_nodes_, nest::KernelManager::model_manager, nest::KernelManager::vp_manager, and nest::VPManager::vp_to_thread().

Referenced by get_status(), and nest::FreeLayer< D >::set_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_node_or_proxy() [1/2]

Node * nest::NodeManager::get_node_or_proxy ( size_t  node_id,
size_t  tid 
)

Return pointer to the specified Node.

The function expects that the given node ID and thread are valid. If they are not, an assertion will fail. In case the given Node does not exist on the given thread, a proxy is returned instead.

Parameters
node_idindex of the Node
tidlocal thread index of the Node

References nest::ModelManager::get_proxy_node(), nest::kernel(), local_nodes_, nest::KernelManager::model_manager, and size().

Referenced by nest::apply(), nest::BipartiteConnBuilder::change_connected_synaptic_elements(), nest::ConnectionManager::connect(), nest::ConnectionManager::connect(), nest::OneToOneBuilder::connect_(), nest::AllToAllBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::FixedTotalNumberBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::PoissonBuilder::connect_(), nest::SymmetricBernoulliBuilder::connect_(), nest::SPBuilder::connect_(), nest::ConnectionManager::connect_arrays(), nest::ConnectionManager::connection_required(), nest::SPManager::delete_synapse(), nest::SPManager::disconnect(), nest::disconnect(), nest::OneToOneBuilder::disconnect_(), nest::AllToAllBuilder::disconnect_(), nest::ConnectionCreator::fixed_indegree_(), nest::ConnectionCreator::fixed_outdegree_(), nest::TargetTableDevices::get_connections_from_devices_(), nest::ConnectionManager::get_synapse_status(), nest::ConnectionCreator::pairwise_bernoulli_on_source_(), nest::ConnectionCreator::pairwise_bernoulli_on_target_(), nest::ConnectionCreator::pairwise_poisson_(), nest::STDPDopaCommonProperties::set_status(), nest::CommonSynapseProperties::set_status(), nest::ConnectionManager::set_synapse_status(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_connect_(), nest::OneToOneBuilder::sp_disconnect_(), nest::AllToAllBuilder::sp_disconnect_(), nest::ConnectionManager::split_to_neuron_device_vectors_(), nest::ThirdBernoulliWithPoolBuilder::ThirdBernoulliWithPoolBuilder(), and nest::ThirdBernoulliWithPoolBuilder::~ThirdBernoulliWithPoolBuilder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_node_or_proxy() [2/2]

Node * nest::NodeManager::get_node_or_proxy ( size_t  node_id)

Return pointer of the specified Node.

Parameters
iIndex of the specified Node.

References nest::ModelManager::get_proxy_node(), nest::kernel(), local_nodes_, nest::KernelManager::model_manager, nest::VPManager::node_id_to_vp(), size(), nest::KernelManager::vp_manager, and nest::VPManager::vp_to_thread().

Here is the call graph for this function:

◆ get_nodes()

NodeCollectionPTR nest::NodeManager::get_nodes ( const Dictionary &  dict,
const bool  local_only 
)

Get node ID's of all nodes with the given properties.

Only node ID's of nodes matching the properties given in the dictionary exactly will be returned. If the dictionary is empty, all nodes will be returned. If the local_only bool is true, only node IDs of nodes simulated on the local MPI process will be returned.

Parameters
dictparameter dictionary of selection properties
local_onlybool indicating whether all nodes, or just mpi local nodes should be returned.
Returns
NodeCollection as lock pointer

References Dictionary::at(), nest::MPIManager::communicate(), nest::NodeCollection::create(), Dictionary::empty(), get_local_nodes(), get_status(), nest::VPManager::get_thread_id(), nest::kernel(), Dictionary::known(), nest::KernelManager::mpi_manager, and nest::KernelManager::vp_manager.

Referenced by nest::get_nodes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_num_active_nodes()

size_t nest::NodeManager::get_num_active_nodes ( )
inline

Get the number of nodes created by last prepare_nodes() call.

See also
prepare_nodes()
Returns
number of active nodes

References num_active_nodes_.

Referenced by nest::SimulationManager::call_update_().

Here is the caller graph for this function:

◆ get_num_thread_local_devices()

size_t nest::NodeManager::get_num_thread_local_devices ( size_t  t) const

Returns the number of devices per thread.

References num_thread_local_devices_.

◆ get_status() [1/2]

void nest::NodeManager::get_status ( Dictionary &  )
overridevirtual

Retrieve the status of the manager.

Note
This would ideally be a const function. However, some managers delay the update of internal variables up to the point where they are needed (e.g., before reporting their values to the user, or before simulate is called). An example for this pattern is the call to update_delay_extrema_() right at the beginning of ConnectionManager::get_status().
See also
set_status()

Implements nest::ManagerInterface.

References nest::Stopwatch< detailed_timer, threaded_timer >::get_status(), nest::names::network_size(), size(), sw_construction_create_, nest::names::time_construction_create(), and nest::names::time_construction_create_cpu().

Referenced by nest::get_node_status(), and get_nodes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_status() [2/2]

Dictionary nest::NodeManager::get_status ( size_t  idx)

Get properties of a node.

The specified node must exist.

Exceptions
nest::UnknownNodeTarget does not exist in the network.

References get_mpi_local_node_or_device_head().

Here is the call graph for this function:

◆ get_thread_siblings()

std::vector< Node * > nest::NodeManager::get_thread_siblings ( size_t  n) const

Return a vector that contains the thread siblings.

Parameters
iIndex of the specified Node.
Exceptions
nest::NoThreadSiblingsAvailableNode does not have thread siblings.

References nest::VPManager::get_num_threads(), nest::kernel(), local_nodes_, and nest::KernelManager::vp_manager.

Referenced by nest::multimeter::get_status(), nest::spike_recorder::get_status(), nest::spin_detector::get_status(), and nest::weight_recorder::get_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_wfr_nodes_on_thread()

const std::vector< Node * > & nest::NodeManager::get_wfr_nodes_on_thread ( size_t  t) const
inline

Get list of nodes on given thread.

References wfr_nodes_vec_.

Referenced by nest::SimulationManager::update_().

Here is the caller graph for this function:

◆ have_nodes_changed()

bool nest::NodeManager::have_nodes_changed ( ) const
inline

References have_nodes_changed_.

◆ init_()

void nest::NodeManager::init_ ( )
private

Initialize the network data structures.

init_() is used by the constructor and by reset().

See also
reset()

◆ initialize()

void nest::NodeManager::initialize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Prepare manager for operation.

After this method has completed, the manager should be completely initialized and "ready for action".

Note
Initialization of any given manager may depend on other managers having been initialized before. KernelManager::initialize() is responsible for calling the initialization routines on the specific managers in correct order.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() or RandomManager::get_status() to limit operations to those necessary for thread adjustment or switch or re-seeding of RNG.
See also
finalize()

Implements nest::ManagerInterface.

References nest::kernel(), local_nodes_, num_thread_local_devices_, nest::Stopwatch< detailed_timer, threaded_timer >::reset(), size_last_local_data_update_, sw_construction_create_, and update_thread_local_node_data().

Here is the call graph for this function:

◆ is_local_node()

bool nest::NodeManager::is_local_node ( Node *  n) const

Return true, if the given Node is on the local machine.

References nest::VPManager::is_local_vp(), nest::kernel(), and nest::KernelManager::vp_manager.

Referenced by nest::Node::get_status_base().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_local_node_id()

bool nest::NodeManager::is_local_node_id ( size_t  node_id) const

Return true, if the given node ID is on the local machine.

References nest::VPManager::is_local_vp(), nest::kernel(), nest::VPManager::node_id_to_vp(), and nest::KernelManager::vp_manager.

Referenced by nest::displacement(), nest::displacement(), nest::distance(), nest::distance(), and nest::get_position().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ node_id_to_node_collection() [1/2]

NodeCollectionPTR nest::NodeManager::node_id_to_node_collection ( const size_t  node_id) const

Map the node ID to its original primitive NodeCollection object.

Parameters
node_idThe node ID
Returns
The primitive NodeCollection object containing the node ID that falls in [first, last)

References node_collection_container_, and node_collection_last_.

Referenced by nest::distance(), nest::NodePosParameter::get_node_pos_(), nest::get_position(), and node_id_to_node_collection().

Here is the caller graph for this function:

◆ node_id_to_node_collection() [2/2]

NodeCollectionPTR nest::NodeManager::node_id_to_node_collection ( Node *  node) const

Map the node to its original primitive NodeCollection object.

Parameters
nodeNode instance
Returns
The primitive NodeCollection object containing the node with node ID falls in [first, last)

References nest::Node::get_node_id(), and node_id_to_node_collection().

Here is the call graph for this function:

◆ post_run_cleanup()

void nest::NodeManager::post_run_cleanup ( )

Invoke post_run_cleanup() on all nodes.

References nest::VPManager::get_thread_id(), nest::kernel(), local_nodes_, and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ prepare_node_()

void nest::NodeManager::prepare_node_ ( Node *  n)
private

Initialized buffers, register in list of nodes to update/finalize.

See also
prepare_nodes_()

Referenced by prepare_nodes().

Here is the caller graph for this function:

◆ prepare_nodes()

void nest::NodeManager::prepare_nodes ( )

Prepare nodes for simulation and register nodes in node_list.

Calls prepare_node_() for each pertaining Node.

See also
prepare_node_()

References nest::VPManager::get_thread_id(), nest::INFO, nest::kernel(), local_nodes_, LOG, num_active_nodes_, prepare_node_(), and nest::KernelManager::vp_manager.

Referenced by nest::SimulationManager::prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print()

void nest::NodeManager::print ( std::ostream &  out) const

Print network information.

References nest::ModelRangeManager::end(), nest::Model::get_name(), nest::ModelManager::get_node_model(), nest::kernel(), nest::mod(), nest::KernelManager::model_manager, nest::KernelManager::modelrange_manager, and size().

Referenced by nest::print_nodes_to_string().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_have_nodes_changed()

void nest::NodeManager::set_have_nodes_changed ( const bool  changed)
inline

References have_nodes_changed_.

Referenced by nest::SimulationManager::update_connection_infrastructure().

Here is the caller graph for this function:

◆ set_status() [1/2]

void nest::NodeManager::set_status ( const Dictionary &  )
overridevirtual

Set the status of the manager.

See also
get_status()

Implements nest::ManagerInterface.

Referenced by nest::set_nc_status(), and nest::set_node_status().

Here is the caller graph for this function:

◆ set_status() [2/2]

void nest::NodeManager::set_status ( size_t  node_id,
const Dictionary &  d 
)

Set properties of a Node.

The specified node must exist.

Exceptions
nest::UnknownNodeTarget does not exist in the network.
nest::UnaccessedDictionaryEntryNon-proxy target did not read dict entry.
TypeMismatchArray is not a flat & homogeneous array of integers.

References nest::VPManager::get_num_threads(), nest::kernel(), local_nodes_, set_status_single_node_(), and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ set_status_single_node_()

void nest::NodeManager::set_status_single_node_ ( Node &  target,
const Dictionary &  d,
bool  clear_flags = true 
)
private

Helper function to set properties on single node.

Parameters
nodeto set properties for
dictionarycontaining properties
iftrue (default), access flags are called before each call so Node::set_status_()
Exceptions
UnaccessedDictionaryEntry

Referenced by set_status().

Here is the caller graph for this function:

◆ size()

size_t nest::NodeManager::size ( ) const
inline

Return total number of network nodes.

References local_nodes_.

Referenced by nest::KernelManager::change_number_of_threads(), nest::RecordingBackendASCII::compute_vp_node_id_string_(), get_max_num_local_nodes(), get_node_or_proxy(), get_node_or_proxy(), get_status(), nest::SPManager::get_synaptic_elements(), nest::BipartiteConnBuilder::loop_over_targets_(), print(), thread_local_data_is_up_to_date(), and update_thread_local_node_data().

Here is the caller graph for this function:

◆ thread_lid_to_node()

Node * nest::NodeManager::thread_lid_to_node ( size_t  t,
targetindex  thread_local_id 
) const
inline

Return node on thread t with given local node id.

References local_nodes_.

Referenced by nest::TargetIdentifierIndex::get_target_ptr().

Here is the caller graph for this function:

◆ thread_local_data_is_up_to_date()

bool nest::NodeManager::thread_local_data_is_up_to_date ( ) const
inline

Return true if thread-local data structures and thread-local node IDs are up to date.

Note
The decision is based on whether new nodes have been created since update_thread_local_node_data() was run last.

References size(), and size_last_local_data_update_.

Referenced by update_thread_local_node_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_thread_local_node_data()

void nest::NodeManager::update_thread_local_node_data ( )

Rebuild per-thread vectors of local nodes and of local nodes needing WFR and set thread-local ID on nodes.

Note
This method must be called from a serial context before connection creation or simulation.

References nest::VPManager::assert_single_threaded(), nest::SparseNodeArray::NodeEntry::get_node(), nest::VPManager::get_num_threads(), nest::kernel(), local_nodes_, size(), size_last_local_data_update_, thread_local_data_is_up_to_date(), nest::KernelManager::vp_manager, wfr_is_used_, and wfr_nodes_vec_.

Referenced by nest::ConnectionManager::connect(), nest::ConnectionManager::connect_arrays(), nest::connect_layers(), nest::ConnectionManager::connect_sonata(), nest::ConnectionManager::connect_tripartite(), nest::disconnect(), nest::SPManager::disconnect(), initialize(), and nest::SimulationManager::prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfr_is_used()

bool nest::NodeManager::wfr_is_used ( ) const
inline

Returns whether any node uses waveform relaxation.

References wfr_is_used_.

Member Data Documentation

◆ exceptions_raised_

std::vector< std::exception_ptr > nest::NodeManager::exceptions_raised_
private

Store exceptions raised in thread-parallel sections for later handling.

Referenced by add_devices_(), add_music_nodes_(), add_neurons_(), and add_node().

◆ have_nodes_changed_

bool nest::NodeManager::have_nodes_changed_
private

true if new nodes have been created since startup or last call to simulate

Referenced by add_node(), have_nodes_changed(), and set_have_nodes_changed().

◆ local_nodes_

std::vector< SparseNodeArray > nest::NodeManager::local_nodes_
private

◆ node_collection_container_

std::vector< NodeCollectionPTR > nest::NodeManager::node_collection_container_
private

◆ node_collection_last_

std::vector< size_t > nest::NodeManager::node_collection_last_
private

Store the ID of the last element in each NodeCollection instance.

Mainly, the node_collection_last_ must be the same size as node_collection_container, where each element at position i in the nodeCollection_last_ is the last node ID stored in the node_collection_container_ at position i.

Referenced by append_node_collection_(), clear_node_collection_container(), and node_id_to_node_collection().

◆ num_active_nodes_

size_t nest::NodeManager::num_active_nodes_
private

Network size when local node data was last updated.

number of nodes created by prepare_nodes

Referenced by get_num_active_nodes(), and prepare_nodes().

◆ num_thread_local_devices_

std::vector< size_t > nest::NodeManager::num_thread_local_devices_
private

stores number of thread local devices

Referenced by add_devices_(), add_music_nodes_(), get_num_thread_local_devices(), and initialize().

◆ size_last_local_data_update_

size_t nest::NodeManager::size_last_local_data_update_
private

◆ sw_construction_create_

Stopwatch< StopwatchGranularity::Normal, StopwatchParallelism::MasterOnly > nest::NodeManager::sw_construction_create_
private

Referenced by add_node(), get_status(), and initialize().

◆ wfr_is_used_

bool nest::NodeManager::wfr_is_used_
private

there is at least one node that uses waveform relaxation

Referenced by check_wfr_use(), update_thread_local_node_data(), and wfr_is_used().

◆ wfr_nodes_vec_

std::vector< std::vector< Node* > > nest::NodeManager::wfr_nodes_vec_
private

Nodelists for unfrozen nodes that use the waveform relaxation method.

Referenced by get_wfr_nodes_on_thread(), and update_thread_local_node_data().


The documentation for this class was generated from the following files: