Paramotopy
parallel parameter homotopy through bertini
|
Capable of timing arbitrary categories of processes, using a map of timer_data's. More...
#include <timing.hpp>
Public Member Functions | |
timer () | |
void | press_start (const std::string timer_name) |
void | add_time (const std::string timer_name) |
void | add_time (const std::string timer_name, const int num_incrementations) |
bool | write_timing_data (const boost::filesystem::path folder_to_write_to, const int myid) |
Private Member Functions | |
bool | create_timer (const std::string timer_name) |
Private Attributes | |
std::map< std::string, timer_data > | active_timers |
Capable of timing arbitrary categories of processes, using a map of timer_data's.
this class defines that which keeps track of timing data. it uses a map to hold actual time elapsed, and the number of times the timer has been incremented;
Definition at line 71 of file timing.hpp.
|
inline |
default constructor. it always pushes start on the total category at instantiation
Definition at line 80 of file timing.hpp.
References press_start().
void timer::add_time | ( | const std::string | timer_name | ) |
this is how to add time to a particular timer.
timer_name | string of the name of the timer to be incremented increments both the elapsed time based on t1, and the counter by 1. |
Definition at line 12 of file timing.cpp.
References active_timers, and create_timer().
Referenced by master_process::CleanupBasic(), master_process::LoopBasic(), slave_process::LoopBasic(), master_process::LoopSearch(), slave_process::LoopSearch(), main(), slave_process::ReceiveInput(), slave_process::ReceiveStart(), master_process::SeedBasic(), master_process::SeedSearch(), master_process::SendInput(), master_process::SendStart(), datagatherer::SlaveCollectAndWriteData(), master_process::TerminateActiveWorker(), master_process::TerminateInactiveWorker(), and write_timing_data().
void timer::add_time | ( | const std::string | timer_name, |
const int | num_incrementations | ||
) |
this is how to add time to a particular timer.
timer_name | string of the name of the timer to be incremented |
num_incrementations | the number to add to the respective timer_data's num_calls_timed field increments both the elapsed time based on t1, and the counter by num_incrementations. |
Definition at line 26 of file timing.cpp.
References active_timers, and create_timer().
|
private |
add a timer to the map.
timer_name | name to assign to the timer_data in the map of active_timers. |
Definition at line 41 of file timing.cpp.
References active_timers.
Referenced by add_time(), and press_start().
void timer::press_start | ( | const std::string | timer_name | ) |
starts the timer for timer_name
timer_name | internally, sets the value of t1 in the respective timer_data. |
Definition at line 5 of file timing.cpp.
References active_timers, and create_timer().
Referenced by master_process::CleanupBasic(), master_process::LoopBasic(), slave_process::LoopBasic(), master_process::LoopSearch(), slave_process::LoopSearch(), main(), slave_process::ReceiveInput(), slave_process::ReceiveStart(), master_process::SeedBasic(), master_process::SeedSearch(), master_process::SendInput(), master_process::SendStart(), datagatherer::SlaveCollectAndWriteData(), master_process::TerminateActiveWorker(), master_process::TerminateInactiveWorker(), and timer().
bool timer::write_timing_data | ( | const boost::filesystem::path | folder_to_write_to, |
const int | myid | ||
) |
write all the timing data to disk.
folder_to_write_to | the folder in which to write the timing data |
myid | a number unique to the process to identify the worker. designed for use in a multi-process environment. as long as each process gets a unique number, things will be ok. |
Definition at line 57 of file timing.cpp.
References active_timers, and add_time().
Referenced by main().
|
private |
map of active timer_data objects.
Definition at line 124 of file timing.hpp.
Referenced by add_time(), create_timer(), press_start(), and write_timing_data().