Description
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:
, which in turn starts a stopwatch.
This all happens in a serial context. But threaded timers require that they be started and stopped in a thread-parallel context, see
.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()
and stop()
methods, as well as from is_running()
and elapsed()
. 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status