67 assert( target_thread <=
MAX_TID );
111 std::vector< std::vector< BlockVector< Source > > >
sources_;
162 const Source& current_source )
const;
169 const Source& current_source,
170 const size_t source_rank,
214 void add_source(
const size_t tid,
const synindex syn_id,
const size_t node_id,
const bool is_primary );
219 void clear(
const size_t tid );
230 const size_t rank_start,
231 const size_t rank_end,
282 void clean(
const size_t tid );
296 std::map< size_t, size_t >& buffer_pos_of_source_node_id_syn_id_ );
324 const std::vector< size_t >& source_lcids,
325 std::vector< size_t >& sources );
360 const std::vector< std::vector< std::vector< SpikeData > > >& compressed_spike_data )
const;
366 const Source src( node_id, is_primary );
367 sources_[ tid ][ syn_id ].push_back( src );
392 .set_processed(
false );
463 iit->set_processed(
false );
481 assert( not
sources_[ tid ][ syn_id ][ lcid ].is_disabled() );
482 sources_[ tid ][ syn_id ][ lcid ].disable();
488 const std::vector< size_t >& source_lcids,
489 std::vector< size_t >& sources )
491 for ( std::vector< size_t >::const_iterator cit = source_lcids.begin(); cit != source_lcids.end(); ++cit )
501 size_t last_source = 0;
503 cit !=
sources_[ tid ][ syn_id ].end();
506 if ( last_source != ( *cit ).get_node_id() )
508 last_source = ( *cit ).get_node_id();
518 assert( source_node_id < 72057594037927936 );
522 return ( source_node_id << 8 ) + syn_id;
530 source_index_map.clear();
Container with a vector-of-vectors structure.
Definition block_vector.h:156
iterator end()
Returns a read/write iterator that points one past the last element in the BlockVector.
Definition block_vector.h:394
Entry of compressed_spike_data_map_.
Definition source_table.h:57
size_t target_thread_
Definition source_table.h:83
CSDMapEntry(size_t source_index, size_t target_thread)
Definition source_table.h:59
size_t source_index_
Definition source_table.h:82
size_t get_source_index() const
Definition source_table.h:71
size_t get_target_thread() const
Definition source_table.h:76
Definition connection_manager.h:62
A thread-safe vector to keep track of the status across threads, for example during gather operations...
Definition per_thread_bool_indicator.h:104
void set_false(const size_t tid)
Definition per_thread_bool_indicator.h:121
void set_true(const size_t tid)
Definition per_thread_bool_indicator.h:111
This data structure stores the node IDs of presynaptic neurons during postsynaptic connection creatio...
Definition source_table.h:104
void clean(const size_t tid)
Removes all entries marked as processed.
Definition source_table.cpp:113
void dump_compressed_spike_data(const std::vector< std::vector< std::vector< SpikeData > > > &compressed_spike_data) const
Definition source_table.cpp:597
void resize_sources()
Resizes sources_ according to total number of threads and synapse types.
Definition source_table.cpp:307
void save_entry_point(const size_t tid)
Stores current_positions_ in saved_positions_.
Definition source_table.h:396
std::vector< std::map< size_t, CSDMapEntry > > compressed_spike_data_map_
A structure to temporarily store locations of "unpacked spikes" in the compressed_spike_data_ structu...
Definition source_table.h:195
size_t remove_disabled_sources(const size_t tid, const synindex syn_id)
Removes all entries from sources_ that are marked as disabled.
Definition source_table.cpp:199
void fill_compressed_spike_data(std::vector< std::vector< std::vector< SpikeData > > > &compressed_spike_data)
Definition source_table.cpp:546
void dump_compressible_sources() const
Definition source_table.cpp:527
void finalize()
Delete data structures.
Definition source_table.cpp:68
size_t get_node_id(const size_t tid, const synindex syn_id, const size_t lcid) const
Returns the node ID of the source at tid|syn_id|lcid.
Definition source_table.cpp:159
size_t num_unique_sources(const size_t tid, const synindex syn_id) const
Returns the number of unique node IDs for given thread id and synapse type in sources_....
Definition source_table.h:498
void disable_connection(const size_t tid, const synindex syn_id, const size_t lcid)
Marks entry in sources_ at given position as disabled.
Definition source_table.h:477
SourceTable()
Definition source_table.cpp:38
size_t pack_source_node_id_and_syn_id(const size_t source_node_id, const synindex syn_id) const
Encodes combination of node ID and synapse types as single long number.
Definition source_table.h:516
void resize_compressible_sources()
Definition source_table.cpp:465
void dump_sources() const
Definition source_table.cpp:506
void get_source_node_ids(const size_t tid, const synindex syn_id, const std::vector< size_t > &source_lcids, std::vector< size_t > &sources)
Returns node IDs for entries in sources_ for the given thread id, synapse type and local connections ...
Definition source_table.h:486
size_t find_first_source(const size_t tid, const synindex syn_id, const size_t snode_id) const
Finds the first non-disabled entry in sources_ at the given thread id and synapse type that has sende...
Definition source_table.cpp:169
std::vector< std::vector< std::map< size_t, SpikeData > > > compressible_sources_
A structure to temporarily hold information about all process local targets will be addressed by inco...
Definition source_table.h:183
void clear_compressed_spike_data_map()
Definition source_table.h:526
void restore_entry_point(const size_t tid)
Restores current_positions_ from saved_positions_.
Definition source_table.h:423
bool populate_target_data_fields_(const SourceTablePosition ¤t_position, const Source ¤t_source, const size_t source_rank, TargetData &next_target_data) const
Fills the fields of a TargetData during construction of * presynaptic connection infrastructure.
Definition source_table.cpp:352
void reset_processed_flags(const size_t tid)
Resets all processed flags.
Definition source_table.h:457
void reset_entry_point(const size_t tid)
Resets saved_positions_ to end of sources_.
Definition source_table.h:430
void clear(const size_t tid)
Clears sources_.
Definition source_table.h:371
std::vector< std::vector< BlockVector< Source > > > sources_
3D structure storing node IDs of presynaptic neurons.
Definition source_table.h:111
std::vector< SourceTablePosition > current_positions_
Needed during readout of sources_.
Definition source_table.h:119
void initialize()
Initialize data structure.
Definition source_table.cpp:47
bool previous_entry_has_same_source_(const SourceTablePosition ¤t_position, const Source ¤t_source) const
Returns true if the previous entry in the SourceTable has the same source gid.
Definition source_table.cpp:338
void compute_buffer_pos_for_unique_secondary_sources(const size_t tid, std::map< size_t, size_t > &buffer_pos_of_source_node_id_syn_id_)
Computes MPI buffer positions for unique combination of source node ID and synapse type across all th...
Definition source_table.cpp:234
std::vector< SourceTablePosition > saved_positions_
Needed during readout of sources_.
Definition source_table.h:121
bool is_cleared() const
Returns true if sources_ has been cleared.
Definition source_table.cpp:87
SourceTablePosition find_maximal_position() const
Determines maximal saved_positions_ after which it is safe to delete sources during clean().
Definition source_table.cpp:99
bool next_entry_has_same_source_(const SourceTablePosition ¤t_position, const Source ¤t_source) const
Returns true if the following entry in the SourceTable has the same source gid.
Definition source_table.cpp:325
static const size_t min_deleted_elements_
Minimal number of sources that need to be deleted per synapse type and thread before a reallocation o...
Definition source_table.h:138
void collect_compressible_sources(const size_t tid)
Definition source_table.cpp:476
void reject_last_target_data(const size_t tid)
Rejects the last target data, and resets the current_positions_ accordingly.
Definition source_table.h:382
PerThreadBoolIndicator saved_entry_point_
If we detect an overflow in one of the MPI buffer parts, we save our current position in sources_ to ...
Definition source_table.h:129
void add_source(const size_t tid, const synindex syn_id, const size_t node_id, const bool is_primary)
Adds a source to sources_.
Definition source_table.h:364
bool get_next_target_data(const size_t tid, const size_t rank_start, const size_t rank_end, size_t &source_rank, TargetData &next_target_data)
Returns the next target data, according to the current_positions_.
Definition source_table.cpp:397
PerThreadBoolIndicator is_cleared_
Whether the 3D structure has been deleted.
Definition source_table.h:116
std::vector< BlockVector< Source > > & get_thread_local_sources(const size_t tid)
Returns a reference to all sources local on thread; necessary for sorting.
Definition source_table.cpp:93
~SourceTable()
Definition source_table.cpp:42
void no_targets_to_process(const size_t tid)
Sets current_positions_ for this thread to minimal values so that these are not considered in find_ma...
Definition source_table.h:469
bool source_should_be_processed_(const size_t rank_start, const size_t rank_end, const Source &source) const
Returns whether this Source object should be considered when constructing MPI buffers for communicati...
Definition source_table.cpp:314
Stores the node ID of a presynaptic neuron and the number of local targets, along with a flag,...
Definition source.h:41
Used to communicate part of the connection infrastructure from post- to presynaptic side.
Definition target_data.h:175
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
constexpr uint8_t NUM_BITS_LCID
Definition nest_types.h:83
constexpr int64_t MAX_TID
Definition nest_types.h:95
constexpr synindex invalid_synindex
Definition nest_types.h:116
StaticAssert< sizeof(CSDMapEntry)==8 >::success success_csdmapentry_size
check legal size
Definition source_table.h:87
constexpr uint8_t NUM_BITS_TID
Definition nest_types.h:76
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
constexpr uint64_t MAX_LCID
Definition nest_types.h:93
Three-tuple to store position in 3d vector of sources.
Definition source_table_position.h:40
Compile time assertions.
Definition static_assert.h:47