This template has two template arguments. More...
#include <stopwatch.h>
Public Member Functions | |
| void | start () |
| void | stop () |
| double | elapsed (timers::timeunit_t timeunit=timers::timeunit_t::SECONDS) const |
| void | reset () |
| void | print (const std::string &msg="", timers::timeunit_t timeunit=timers::timeunit_t::SECONDS, std::ostream &os=std::cout) const |
| void | get_status (Dictionary &d, const std::string &walltime_name, const std::string &cputime_name) const |
Private Types | |
| template<clockid_t ClockType> | |
| using | InternalTimerType = std::conditional_t< use_timer_array, std::vector< timers::StopwatchTimer< ClockType > >, timers::StopwatchTimer< ClockType > > |
| template<clockid_t ClockType> | |
| using | StopwatchTimerType = std::conditional_t< enable_timer, InternalTimerType< ClockType >, NoOpStopwatch > |
Private Member Functions | |
| bool | is_running_ () const |
Private Attributes | |
| StopwatchTimerType< CLOCK_MONOTONIC > | walltime_timer_ |
| StopwatchTimerType< CLOCK_THREAD_CPUTIME_ID > | cputime_timer_ |
Static Private Attributes | |
| static constexpr bool | enable_timer = detailed_timer == StopwatchGranularity::Normal or use_detailed_timers |
| static constexpr bool | use_timer_array = threaded_timer == StopwatchParallelism::Threaded and use_threaded_timers |
This template has two template arguments.
The first one "detailed_timer" controls the granularity of the stopwatch, i.e., if the timer is considered a normal or detailed timer. The second one "threaded_timer" defines if the timer is supposed to be measured by each thread individually. In case a timer is specified as threaded, but threaded timers are turned off globally, the stopwatch will run in master-only mode instead.
In all cases, both the (monotonic) wall-time and cpu time are measured.
|
private |
|
private |
| double nest::Stopwatch< detailed_timer, threaded_timer >::elapsed | ( | timers::timeunit_t | timeunit = timers::timeunit_t::SECONDS | ) | const |
References nest::VPManager::assert_thread_parallel(), nest::VPManager::get_thread_id(), nest::kernel(), and nest::KernelManager::vp_manager.
Referenced by nest::SimulationManager::update_().
| void nest::Stopwatch< detailed_timer, threaded_timer >::get_status | ( | Dictionary & | d, |
| const std::string & | walltime_name, | ||
| const std::string & | cputime_name | ||
| ) | const |
References nest::VPManager::assert_single_threaded(), nest::kernel(), and nest::KernelManager::vp_manager.
Referenced by nest::KernelManager::get_status(), nest::ConnectionManager::get_status(), nest::EventDeliveryManager::get_status(), nest::NodeManager::get_status(), and nest::SimulationManager::get_status().
|
private |
References nest::VPManager::assert_thread_parallel(), nest::VPManager::get_thread_id(), nest::kernel(), and nest::KernelManager::vp_manager.
| void nest::Stopwatch< detailed_timer, threaded_timer >::print | ( | const std::string & | msg = "", |
| timers::timeunit_t | timeunit = timers::timeunit_t::SECONDS, |
||
| std::ostream & | os = std::cout |
||
| ) | const |
References nest::VPManager::assert_thread_parallel(), nest::VPManager::get_thread_id(), nest::kernel(), and nest::KernelManager::vp_manager.
| void nest::Stopwatch< detailed_timer, threaded_timer >::reset | ( | ) |
References nest::VPManager::assert_single_threaded(), nest::VPManager::get_num_threads(), nest::kernel(), and nest::KernelManager::vp_manager.
Referenced by nest::KernelManager::change_number_of_threads(), nest::KernelManager::initialize(), nest::ConnectionManager::initialize(), nest::NodeManager::initialize(), nest::KernelManager::prepare(), nest::EventDeliveryManager::reset_timers_for_dynamics(), nest::SimulationManager::reset_timers_for_dynamics(), nest::EventDeliveryManager::reset_timers_for_preparation(), and nest::SimulationManager::reset_timers_for_preparation().
| void nest::Stopwatch< detailed_timer, threaded_timer >::start | ( | ) |
References nest::VPManager::assert_thread_parallel(), nest::VPManager::get_thread_id(), nest::kernel(), and nest::KernelManager::vp_manager.
Referenced by nest::NodeManager::add_node(), nest::PerThreadBoolIndicator::all_false(), nest::PerThreadBoolIndicator::all_true(), nest::PerThreadBoolIndicator::any_false(), nest::PerThreadBoolIndicator::any_true(), nest::ConnectionManager::collect_compressed_spike_data(), nest::SourceTable::compute_buffer_pos_for_unique_secondary_sources(), nest::ConnectionManager::connect(), nest::ConnectionManager::connect_arrays(), nest::connect_layers(), nest::ConnectionManager::connect_sonata(), nest::ConnectionManager::connect_tripartite(), nest::EventDeliveryManager::gather_spike_data_(), nest::EventDeliveryManager::gather_target_data(), nest::EventDeliveryManager::gather_target_data_compressed(), nest::SimulationManager::run(), nest::SimulationManager::update_(), and nest::SimulationManager::update_connection_infrastructure().
| void nest::Stopwatch< detailed_timer, threaded_timer >::stop | ( | ) |
References nest::VPManager::assert_thread_parallel(), nest::VPManager::get_thread_id(), nest::kernel(), and nest::KernelManager::vp_manager.
Referenced by nest::NodeManager::add_node(), nest::PerThreadBoolIndicator::all_false(), nest::PerThreadBoolIndicator::all_true(), nest::PerThreadBoolIndicator::any_false(), nest::PerThreadBoolIndicator::any_true(), nest::ConnectionManager::collect_compressed_spike_data(), nest::SourceTable::compute_buffer_pos_for_unique_secondary_sources(), nest::ConnectionManager::connect(), nest::ConnectionManager::connect_arrays(), nest::connect_layers(), nest::ConnectionManager::connect_sonata(), nest::ConnectionManager::connect_tripartite(), nest::EventDeliveryManager::gather_spike_data_(), nest::EventDeliveryManager::gather_target_data(), nest::EventDeliveryManager::gather_target_data_compressed(), nest::SimulationManager::run(), nest::SimulationManager::update_(), and nest::SimulationManager::update_connection_infrastructure().
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
private |