Skip to content

Commit df8c0c5

Browse files
suku248jasperalbers
authored andcommitted
same commit as 2890ca6 in PR nest#1442
1 parent 3be9ac2 commit df8c0c5

11 files changed

+292
-316
lines changed

nestkernel/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ set( nestkernel_sources
2323
archiving_node.h archiving_node.cpp
2424
clopath_archiving_node.h clopath_archiving_node.cpp
2525
common_synapse_properties.h common_synapse_properties.cpp
26-
completed_checker.h completed_checker.cpp
2726
sibling_container.h sibling_container.cpp
2827
subnet.h subnet.cpp
2928
connection.h
@@ -54,6 +53,7 @@ set( nestkernel_sources
5453
multirange.h multirange.cpp
5554
node.h node.cpp
5655
nodelist.h nodelist.cpp
56+
per_thread_bool_indicator.h per_thread_bool_indicator.cpp
5757
proxynode.h proxynode.cpp
5858
recording_device.h recording_device.cpp
5959
pseudo_recording_device.h

nestkernel/completed_checker.cpp

-120
This file was deleted.

nestkernel/completed_checker.h

-140
This file was deleted.

nestkernel/connection_manager.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ nest::ConnectionManager::initialize()
9696
secondary_recv_buffer_pos_.resize( num_threads );
9797
sort_connections_by_source_ = true;
9898

99-
have_connections_changed_.resize( num_threads, true );
100-
check_primary_connections_.resize( num_threads, false );
101-
check_secondary_connections_.resize( num_threads, false );
99+
have_connections_changed_.initialize( num_threads, true );
100+
check_primary_connections_.initialize( num_threads, false );
101+
check_secondary_connections_.initialize( num_threads, false );
102102

103103
#pragma omp parallel
104104
{
@@ -606,17 +606,17 @@ nest::ConnectionManager::connect_( Node& s,
606606

607607
// We do not check has_primary_connections_ and secondary_connections_exist_
608608
// directly as this led to worse performance on the supercomputer Piz Daint.
609-
if ( not check_primary_connections_[ tid ] and is_primary )
609+
if ( check_primary_connections_[ tid ].is_false() and is_primary )
610610
{
611611
#pragma omp atomic write
612612
has_primary_connections_ = true;
613-
check_primary_connections_.set( tid, true );
613+
check_primary_connections_[ tid ].set_true();
614614
}
615-
else if ( not check_secondary_connections_[ tid ] and not is_primary )
615+
else if ( check_secondary_connections_[ tid ].is_false() and not is_primary )
616616
{
617617
#pragma omp atomic write
618618
secondary_connections_exist_ = true;
619-
check_secondary_connections_.set( tid, true );
619+
check_secondary_connections_[ tid ].set_true();
620620
}
621621
}
622622

@@ -1583,12 +1583,12 @@ nest::ConnectionManager::set_have_connections_changed( const thread tid )
15831583
// Need to check if have_connections_changed_ has already been set, because if
15841584
// we have a lot of threads and they all try to set the variable at once we get
15851585
// performance issues on supercomputers.
1586-
if ( not have_connections_changed_[ tid ] )
1586+
if ( have_connections_changed_[ tid ].is_false() )
15871587
{
15881588
std::string msg =
15891589
"New connections created, connection descriptors previously obtained using 'GetConnections' are now invalid.";
15901590
LOG( M_WARNING, "ConnectionManager", msg );
1591-
have_connections_changed_.set( tid, true );
1591+
have_connections_changed_[ tid ].set_true();
15921592
}
15931593
}
15941594

@@ -1598,8 +1598,8 @@ nest::ConnectionManager::unset_have_connections_changed( const thread tid )
15981598
// Need to check if have_connections_changed_ has already been set, because if
15991599
// we have a lot of threads and they all try to set the variable at once we get
16001600
// performance issues on supercomputers.
1601-
if ( have_connections_changed_[ tid ] )
1601+
if ( have_connections_changed_[ tid ].is_true() )
16021602
{
1603-
have_connections_changed_.set( tid, false );
1603+
have_connections_changed_[ tid ].set_false();
16041604
}
16051605
}

nestkernel/connection_manager.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
#include "manager_interface.h"
3232

3333
// Includes from nestkernel:
34-
#include "completed_checker.h"
3534
#include "conn_builder.h"
3635
#include "connection_id.h"
3736
#include "connector_base.h"
3837
#include "gid_collection.h"
3938
#include "nest_time.h"
4039
#include "nest_timeconverter.h"
4140
#include "nest_types.h"
41+
#include "per_thread_bool_indicator.h"
4242
#include "source_table.h"
4343
#include "target_table.h"
4444
#include "target_table_devices.h"
@@ -587,7 +587,7 @@ class ConnectionManager : public ManagerInterface
587587

588588
//! True if new connections have been created since startup or last call to
589589
//! simulate.
590-
CompletedChecker have_connections_changed_;
590+
PerThreadBoolIndicator have_connections_changed_;
591591

592592
//! Whether to sort connections by source gid.
593593
bool sort_connections_by_source_;
@@ -596,13 +596,13 @@ class ConnectionManager : public ManagerInterface
596596
bool has_primary_connections_;
597597

598598
//! Check for primary connections (spikes) on each thread.
599-
CompletedChecker check_primary_connections_;
599+
PerThreadBoolIndicator check_primary_connections_;
600600

601601
//! Whether secondary connections (e.g., gap junctions) exist.
602602
bool secondary_connections_exist_;
603603

604604
//! Check for secondary connections (e.g., gap junctions) on each thread.
605-
CompletedChecker check_secondary_connections_;
605+
PerThreadBoolIndicator check_secondary_connections_;
606606

607607
//! Maximum distance between (double) spike times in STDP that is
608608
//! still considered 0. See issue #894

0 commit comments

Comments
 (0)