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 |
| 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(), elapsed(), enable_timer, nest::VPManager::get_thread_id(), nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
Referenced by elapsed().
| 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(), cputime_timer_, enable_timer, nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
|
private |
References nest::VPManager::assert_thread_parallel(), enable_timer, nest::VPManager::get_thread_id(), is_running_(), nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
Referenced by is_running_().
| 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(), enable_timer, nest::VPManager::get_thread_id(), nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
| void nest::Stopwatch< detailed_timer, threaded_timer >::reset | ( | ) |
References nest::VPManager::assert_single_threaded(), cputime_timer_, enable_timer, nest::VPManager::get_num_threads(), nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
| void nest::Stopwatch< detailed_timer, threaded_timer >::start | ( | ) |
References nest::VPManager::assert_thread_parallel(), cputime_timer_, enable_timer, nest::VPManager::get_thread_id(), nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
Referenced by 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::update_(), and nest::SimulationManager::update_connection_infrastructure().
| void nest::Stopwatch< detailed_timer, threaded_timer >::stop | ( | ) |
References nest::VPManager::assert_thread_parallel(), cputime_timer_, enable_timer, nest::VPManager::get_thread_id(), nest::kernel(), use_timer_array, nest::KernelManager::vp_manager, and walltime_timer_.
Referenced by 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::update_(), and nest::SimulationManager::update_connection_infrastructure().
|
private |
Referenced by get_status(), reset(), start(), and stop().
|
staticconstexprprivate |
Referenced by elapsed(), get_status(), is_running_(), print(), reset(), start(), and stop().
|
staticconstexprprivate |
Referenced by elapsed(), get_status(), is_running_(), print(), reset(), start(), and stop().
|
private |
Referenced by elapsed(), get_status(), is_running_(), print(), reset(), start(), and stop().