Tracing computation time.
More...
#include <timer.h>
|
static void | tick (const std::string &class_name_in, const std::string &name_in) |
| Use twice at a time: the first time, set start_flag to false; the second time, calculate the time duration.
|
|
static void | start (void) |
| Start total time calculation.
|
|
static void | finish (std::ofstream &ofs, const bool print_flag=1) |
| Finish total time calculation and print computational processes with duration > 0.1 s.
|
|
static void | enable (void) |
| Enable time computation.
|
|
static void | disable (void) |
| Disable time computation.
|
|
static void | write_to_json (std::string file_name) |
| Write all computational processes to json file.
|
|
static void | print_all (std::ofstream &ofs) |
| Print all computational processes with during > 0.1 s.
|
|
static long double | print_until_now (void) |
| Stop total time calculation, print total time until now, and then start total time calculation again.
|
|
|
static double | cpu_time (void) |
| Member function: calculate time.
|
|
|
static bool | disabled = false |
| Member variable: if disabled , timer can't work.
|
|
static size_t | n_now = 0 |
| Member variable: the index of clocks.
|
|
Tracing computation time.
- Authors
- Fangwei, Mohan, Peize Lin
◆ cpu_time()
double ModuleBase::timer::cpu_time |
( |
void |
| ) |
|
|
staticprivate |
Member function: calculate time.
- Returns
- double
◆ disable()
static void ModuleBase::timer::disable |
( |
void |
| ) |
|
|
inlinestatic |
Disable time computation.
◆ enable()
static void ModuleBase::timer::enable |
( |
void |
| ) |
|
|
inlinestatic |
◆ finish()
void ModuleBase::timer::finish |
( |
std::ofstream & |
ofs, |
|
|
const bool |
print_flag = 1 |
|
) |
| |
|
static |
Finish total time calculation and print computational processes with duration > 0.1 s.
- Parameters
-
ofs | The output file for print out timings |
print_flag | Print timings or not |
◆ print_all()
void ModuleBase::timer::print_all |
( |
std::ofstream & |
ofs | ) |
|
|
static |
Print all computational processes with during > 0.1 s.
- Parameters
-
ofs | The output file for print out timings |
◆ print_until_now()
long double ModuleBase::timer::print_until_now |
( |
void |
| ) |
|
|
static |
Stop total time calculation, print total time until now, and then start total time calculation again.
- Returns
- long double
◆ start()
void ModuleBase::timer::start |
( |
void |
| ) |
|
|
static |
Start total time calculation.
◆ tick()
void ModuleBase::timer::tick |
( |
const std::string & |
class_name_in, |
|
|
const std::string & |
name_in |
|
) |
| |
|
static |
Use twice at a time: the first time, set start_flag to false; the second time, calculate the time duration.
- Parameters
-
class_name_in | The class name for timing |
name_in | The compuational process for timing |
◆ write_to_json()
void ModuleBase::timer::write_to_json |
( |
std::string |
file_name | ) |
|
|
static |
Write all computational processes to json file.
- Parameters
-
file_name | The output file name |
◆ disabled
bool ModuleBase::timer::disabled = false |
|
staticprivate |
Member variable: if disabled , timer can't work.
◆ n_now
size_t ModuleBase::timer::n_now = 0 |
|
staticprivate |
Member variable: the index of clocks.
◆ timer_pool
std::map< std::string, std::map< std::string, timer::Timer_One > > ModuleBase::timer::timer_pool |
|
static |
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/timer.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/timer.cpp