Paramotopy
parallel parameter homotopy through bertini
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
timer Class Reference

Capable of timing arbitrary categories of processes, using a map of timer_data's. More...

#include <timing.hpp>

Collaboration diagram for timer:
[legend]

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_dataactive_timers
 

Detailed Description

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.

Constructor & Destructor Documentation

timer::timer ( )
inline

default constructor. it always pushes start on the total category at instantiation

Definition at line 80 of file timing.hpp.

References press_start().

Here is the call graph for this function:

Member Function Documentation

void timer::add_time ( const std::string  timer_name)

this is how to add time to a particular timer.

Parameters
timer_namestring 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void timer::add_time ( const std::string  timer_name,
const int  num_incrementations 
)

this is how to add time to a particular timer.

Parameters
timer_namestring of the name of the timer to be incremented
num_incrementationsthe 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().

Here is the call graph for this function:

bool timer::create_timer ( const std::string  timer_name)
private

add a timer to the map.

Parameters
timer_namename 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().

Here is the caller graph for this function:

void timer::press_start ( const std::string  timer_name)

starts the timer for timer_name

Parameters
timer_nameinternally, 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().

Here is the call graph for this function:

Here is the caller graph for this function:

bool timer::write_timing_data ( const boost::filesystem::path  folder_to_write_to,
const int  myid 
)

write all the timing data to disk.

Parameters
folder_to_write_tothe folder in which to write the timing data
myida 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().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::map< std::string, timer_data > timer::active_timers
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().


The documentation for this class was generated from the following files: