Threaded timers break GetConnections() #3468
Labels
I: Behavior changes
Introduces changes that produce different results for some users
S: High
Should be handled next
T: Bug
Wrong statements in the code or documentation
A NEST built with
-Dwith-detailed-timers=ON -Dwith-threaded-timers=ON
will trigger a failing assertion upon the following:python -c "import nest ; nest.local_num_threads = 2 ; nest.GetConnections()"
The assertion is triggered by the call to
is_source_table_cleared()
here:nest-simulator/nestkernel/connection_manager.cpp
Line 1227 in 5fd75c0
PerThreadBoolIndicator::all_true()
here:nest-simulator/nestkernel/per_thread_bool_indicator.cpp
Line 82 in 5fd75c0
This all happens in a serial context. But threaded timers require that they be started and stopped in a thread-parallel context, see
nest-simulator/nestkernel/stopwatch_impl.h
Line 36 in 5fd75c0
The idea behind the assertion was that threaded timers would only be started/stopped from parallel contexts. But the
all/any_true/false()
methods may be called from serial and parallel contexts, and then the timers in them need to support this.So I think we should remove the assertions from the
start()
andstop()
methods, as well as fromis_running()
andelapsed()
. If called from a serial context, the time would be for thread 0.For
print()
I am uncertain what would be the best choice and implementation, but thread-parallel writing to an ostream does not seem optimal.The text was updated successfully, but these errors were encountered: