|
TrioCFD 1.9.8
TrioCFD documentation
|
This class stores and manages counters in TRUST. It is a singleton. More...
#include <Perf_counters.h>
Classes | |
| class | Impl |
Public Types | |
| using | clock = std::chrono::high_resolution_clock |
| using | time_point = std::chrono::time_point<clock> |
| using | duration = std::chrono::duration<double> |
Public Member Functions | |
| time_point | now () |
| time_point | start_clock () |
| Start a clock, return a time_point, not a double. | |
| double | compute_time (time_point start) |
| return time since start in seconds | |
| void | create_custom_counter (std::string counter_description, int counter_level, std::string counter_family="None", bool is_comm=false, bool is_gpu=false) |
| Create a new counter and add it to the map of custom counters. | |
| void | begin_count (const STD_COUNTERS &std_cnt, int counter_lvl=-100000) |
| void | begin_count (const std::string &custom_count_name, int counter_lvl=-100000) |
| void | end_count (const std::string &custom_count_name, int count_increment=1, long int quantity_increment=0) |
| End the count of a counter and update the counter values. | |
| void | end_count (const STD_COUNTERS &std_cnt, int count_increment=1, long int quantity_increment=0) |
| End the count of a counter and update the counter values. | |
| void | stop_counters () |
| Stop all counters, has to be called on every processor simultaneously. | |
| void | restart_counters () |
| Restart all counters, has to be called on every processor simultaneously. | |
| void | reset_counters () |
| Reset counters to zero, used between the start-up of the computation, the computation itself and the post-processing. | |
| void | print_TU_files (const std::string &message) |
| Function that encapsulate the two functions that writes the TU files. | |
| double | get_computation_time () |
| Update computation_time_ and return its value as a double (in seconds). | |
| double | get_total_time (const STD_COUNTERS &name) |
| Give as a double the total time (in second) elapsed in the operation tracked by the standard counter call name. | |
| double | get_total_time (const std::string &name) |
| Give as a double the total time (in second) elapsed in the operation tracked by the custom counter call name. | |
| double | get_time_since_last_open (const STD_COUNTERS &name) |
| Give as a double the time (in second) elapsed in the operation tracked by the standard counter call name since the counter was last opened. | |
| double | get_time_since_last_open (const std::string &name) |
| Give as a double the time (in second) elapsed in the operation tracked by the standard counter call name since the counter was last opened. | |
| bool | is_running (const STD_COUNTERS &name) |
| Check whether a counter is already running. Should rarely be used! | |
| void | start_timeloop () |
| Set time_loop_ to true in order to account for cache properly. | |
| void | end_timeloop () |
| Set time_loop_ to false as we exit the time loop. | |
| void | start_time_step () |
| , this function start statistics tracking for a time step. It has to be called at the start of each time step. | |
| void | end_time_step (long int tstep) |
| This function compute statistics per time steps of counters used at least once during a time step. | |
| void | set_nb_time_steps_elapsed (int n) |
| int | get_last_opened_counter_level () const |
| void | record_nb_elem (trustIdType nb_elem) |
| void | start_gpu_timer () |
| void | stop_gpu_timer () |
| bool | is_gpu_verbose_on () const |
| void | set_gpu_verbose (bool on) |
| bool | get_init_device () const |
| void | set_init_device (bool init) |
| bool | get_gpu_timer () const |
| void | set_gpu_timer (bool timer) |
| void | add_to_gpu_timer_counter (int to_add) |
| int | get_gpu_timer_counter () const |
| double | stop_gpu_timer_and_compute_gpu_time () |
| bool | get_use_gpu () const |
| bool | get_gpu_fence () const |
| void | set_gpu_fence (bool fence) |
| Perf_counters (const Perf_counters &)=delete | |
| Perf_counters & | operator= (const Perf_counters &)=delete |
Static Public Member Functions | |
| static Perf_counters & | getInstance () |
| The class Perf_counters is based on a phoenix singleton pattern. To access to the unique object inside the code, use the getInstance() function. | |
This class stores and manages counters in TRUST. It is a singleton.
Definition at line 85 of file Perf_counters.h.
| using Perf_counters::clock = std::chrono::high_resolution_clock |
Definition at line 88 of file Perf_counters.h.
| using Perf_counters::duration = std::chrono::duration<double> |
Definition at line 90 of file Perf_counters.h.
| using Perf_counters::time_point = std::chrono::time_point<clock> |
Definition at line 89 of file Perf_counters.h.
|
delete |
| void Perf_counters::add_to_gpu_timer_counter | ( | int | to_add | ) |
Definition at line 2072 of file Perf_counters.cpp.
| void Perf_counters::begin_count | ( | const std::string & | custom_count_name, |
| int | counter_lvl = -100000 ) |
Custom counters, start the tracking of the wanted operation
| custom_count_name | string key in the custom counter map |
| counter_lvl | level of the counter you try to open, warning it changes the value of the level of the counter associated with custom_count_name |
Definition at line 1937 of file Perf_counters.cpp.
| void Perf_counters::begin_count | ( | const STD_COUNTERS & | std_cnt, |
| int | counter_lvl = -100000 ) |
Standard counters, start the tracking of the wanted operation
| std_cnt | reference to the standard counter |
| counter_lvl | level of the counter you try to open, warning it changes the value of the counter level associated with counter std_cnt |
Definition at line 1932 of file Perf_counters.cpp.
| double Perf_counters::compute_time | ( | time_point | start | ) |
return time since start in seconds
Definition at line 1921 of file Perf_counters.cpp.
| void Perf_counters::create_custom_counter | ( | std::string | counter_description, |
| int | counter_level, | ||
| std::string | counter_family = "None", | ||
| bool | is_comm = false, | ||
| bool | is_gpu = false ) |
Create a new counter and add it to the map of custom counters.
| counter_level | |
| counter_description | |
| counter_family | |
| is_comm |
Definition at line 1927 of file Perf_counters.cpp.
| void Perf_counters::end_count | ( | const std::string & | custom_count_name, |
| int | count_increment = 1, | ||
| long int | quantity_increment = 0 ) |
End the count of a counter and update the counter values.
| c | is the counter to end the count |
| count_increment | is the count increment. If not specified, then it is equal to 1 |
| quantity_increment | is the increment of custom variable quantity. If not specified, it is set to 0. |
Definition at line 1942 of file Perf_counters.cpp.
| void Perf_counters::end_count | ( | const STD_COUNTERS & | std_cnt, |
| int | count_increment = 1, | ||
| long int | quantity_increment = 0 ) |
End the count of a counter and update the counter values.
| c | is the counter to end the count |
| count_increment | is the count increment. If not specified, then it is equal to 1 |
| quantity_increment | is the increment of custom variable quantity. If not specified, it is set to 0. |
Definition at line 1947 of file Perf_counters.cpp.
| void Perf_counters::end_time_step | ( | long int | tstep | ) |
This function compute statistics per time steps of counters used at least once during a time step.
| tstep | is the current time step number |
Definition at line 2017 of file Perf_counters.cpp.
| void Perf_counters::end_timeloop | ( | ) |
Set time_loop_ to false as we exit the time loop.
Definition at line 2007 of file Perf_counters.cpp.
| double Perf_counters::get_computation_time | ( | ) |
Update computation_time_ and return its value as a double (in seconds).
Definition at line 1972 of file Perf_counters.cpp.
| bool Perf_counters::get_gpu_fence | ( | ) | const |
Definition at line 2089 of file Perf_counters.cpp.
| bool Perf_counters::get_gpu_timer | ( | ) | const |
Definition at line 2067 of file Perf_counters.cpp.
| int Perf_counters::get_gpu_timer_counter | ( | ) | const |
Definition at line 2077 of file Perf_counters.cpp.
| bool Perf_counters::get_init_device | ( | ) | const |
Definition at line 2057 of file Perf_counters.cpp.
| int Perf_counters::get_last_opened_counter_level | ( | ) | const |
Definition at line 2027 of file Perf_counters.cpp.
| double Perf_counters::get_time_since_last_open | ( | const std::string & | name | ) |
Give as a double the time (in second) elapsed in the operation tracked by the standard counter call name since the counter was last opened.
Definition at line 1992 of file Perf_counters.cpp.
| double Perf_counters::get_time_since_last_open | ( | const STD_COUNTERS & | name | ) |
Give as a double the time (in second) elapsed in the operation tracked by the standard counter call name since the counter was last opened.
Definition at line 1987 of file Perf_counters.cpp.
| double Perf_counters::get_total_time | ( | const std::string & | name | ) |
Give as a double the total time (in second) elapsed in the operation tracked by the custom counter call name.
Definition at line 1982 of file Perf_counters.cpp.
| double Perf_counters::get_total_time | ( | const STD_COUNTERS & | name | ) |
Give as a double the total time (in second) elapsed in the operation tracked by the standard counter call name.
Definition at line 1977 of file Perf_counters.cpp.
| bool Perf_counters::get_use_gpu | ( | ) | const |
Definition at line 2087 of file Perf_counters.cpp.
|
inlinestatic |
The class Perf_counters is based on a phoenix singleton pattern. To access to the unique object inside the code, use the getInstance() function.
Definition at line 106 of file Perf_counters.h.
| bool Perf_counters::is_gpu_verbose_on | ( | ) | const |
Definition at line 2047 of file Perf_counters.cpp.
| bool Perf_counters::is_running | ( | const STD_COUNTERS & | name | ) |
Check whether a counter is already running. Should rarely be used!
Definition at line 1997 of file Perf_counters.cpp.
|
inline |
Definition at line 91 of file Perf_counters.h.
|
delete |
| void Perf_counters::print_TU_files | ( | const std::string & | message | ) |
Function that encapsulate the two functions that writes the TU files.
| messsage | can only take three values: "Computation start-up statistics", "Time loop statistics" or "Post-resolution statistics" |
Definition at line 1967 of file Perf_counters.cpp.
| void Perf_counters::record_nb_elem | ( | trustIdType | nb_elem | ) |
Definition at line 2032 of file Perf_counters.cpp.
| void Perf_counters::reset_counters | ( | ) |
Reset counters to zero, used between the start-up of the computation, the computation itself and the post-processing.
Definition at line 1962 of file Perf_counters.cpp.
| void Perf_counters::restart_counters | ( | ) |
Restart all counters, has to be called on every processor simultaneously.
Definition at line 1957 of file Perf_counters.cpp.
| void Perf_counters::set_gpu_fence | ( | bool | fence | ) |
Definition at line 2091 of file Perf_counters.cpp.
| void Perf_counters::set_gpu_timer | ( | bool | timer | ) |
| void Perf_counters::set_gpu_verbose | ( | bool | on | ) |
Definition at line 2052 of file Perf_counters.cpp.
| void Perf_counters::set_init_device | ( | bool | init | ) |
Definition at line 2062 of file Perf_counters.cpp.
| void Perf_counters::set_nb_time_steps_elapsed | ( | int | n | ) |
Definition at line 2022 of file Perf_counters.cpp.
|
inline |
Start a clock, return a time_point, not a double.
Definition at line 98 of file Perf_counters.h.
| void Perf_counters::start_gpu_timer | ( | ) |
Definition at line 2037 of file Perf_counters.cpp.
| void Perf_counters::start_time_step | ( | ) |
, this function start statistics tracking for a time step. It has to be called at the start of each time step.
Definition at line 2012 of file Perf_counters.cpp.
| void Perf_counters::start_timeloop | ( | ) |
Set time_loop_ to true in order to account for cache properly.
Definition at line 2002 of file Perf_counters.cpp.
| void Perf_counters::stop_counters | ( | ) |
Stop all counters, has to be called on every processor simultaneously.
Definition at line 1952 of file Perf_counters.cpp.
| void Perf_counters::stop_gpu_timer | ( | ) |
Definition at line 2042 of file Perf_counters.cpp.
| double Perf_counters::stop_gpu_timer_and_compute_gpu_time | ( | ) |
Definition at line 2082 of file Perf_counters.cpp.