Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
timer.h
Go to the documentation of this file.
1 #ifndef __TIMER_H__
2 #define __TIMER_H__
3 
4 #include "common.h"
5 
6 
7 namespace CTF {
14  #define MAX_NAME_LENGTH 53
15 
20  public:
22  double start_time;
24  double acc_time;
25  double acc_excl_time;
26  int calls;
27 
28  double total_time;
31 
32  public:
33  Function_timer(char const * name_,
34  double const start_time_,
35  double const start_excl_time_);
36  //Function_timer(Function_timer const & other);
37  //~Function_timer();
38  void compute_totals(MPI_Comm comm);
39  bool operator<(Function_timer const & w) const ;
40  void print(FILE * output,
41  MPI_Comm const comm,
42  int const rank,
43  int const np);
44  };
45 
46 
50  class Timer{
51  public:
52  char const * timer_name;
53  int index;
54  int exited;
55  int original;
56 
57  public:
58  Timer(char const * name);
59  ~Timer();
60  void stop();
61  void start();
62  void exit();
63 
64  };
65 
69  class Timer_epoch{
70  private:
71  Timer * tmr_inner;
72  Timer * tmr_outer;
73  double save_excl_time;
74  std::vector<Function_timer> saved_function_timers;
75  public:
76  char const * name;
77  //create epoch called name
78  Timer_epoch(char const * name_);
79 
81  saved_function_timers.clear();
82  }
83 
84  //clears timers and begins epoch
85  void begin();
86 
87  //prints timers and clears them
88  void end();
89  };
90 
91 
99  class Flop_counter{
100  public:
101  int64_t start_count;
102 
103  public:
107  Flop_counter();
108  ~Flop_counter();
109 
113  void zero();
114 
118  int64_t count(MPI_Comm comm = MPI_COMM_SELF);
119 
120  };
121 
125 }
126 
127 
128 #endif
129 
CTF::Timer Timer
Definition: back_comp.h:14
int original
Definition: timer.h:55
int exited
Definition: timer.h:54
double start_excl_time
Definition: timer.h:23
MPI_Comm comm
Definition: int_timer.cxx:22
def rank(self)
Definition: core.pyx:312
times a specific symbol
Definition: timer.h:19
double start_time
Definition: timer.h:22
Function_timer(char const *name_, double const start_time_, double const start_excl_time_)
Definition: int_timer.cxx:28
local process walltime measurement
Definition: timer.h:50
char name[MAX_NAME_LENGTH]
Definition: timer.h:21
double acc_time
Definition: timer.h:24
double acc_excl_time
Definition: timer.h:25
char const * name
Definition: timer.h:76
void print(FILE *output, MPI_Comm const comm, int const rank, int const np)
Definition: int_timer.cxx:74
a term is an abstract object representing some expression of tensors
Definition: timer.h:99
double total_excl_time
Definition: timer.h:29
#define MAX_NAME_LENGTH
Definition: timer.h:14
epoch during which to measure timers
Definition: timer.h:69
double total_time
Definition: timer.h:28
void compute_totals(MPI_Comm comm)
Definition: int_timer.cxx:61
bool operator<(Function_timer const &w) const
Definition: int_timer.cxx:70
char const * timer_name
Definition: timer.h:52
CTF::Timer_epoch Timer_epoch
Definition: back_comp.h:15
Definition: apsp.cxx:17
CTF::Flop_counter Flop_counter
Definition: back_comp.h:17
int64_t start_count
Definition: timer.h:101
int index
Definition: timer.h:53
def np(self)
Definition: core.pyx:315