openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
timers.h
Go to the documentation of this file.
1 #ifndef _TIMERS_H
2 #define _TIMERS_H
3 
4 #include <climits>
5 #include <limits>
6 #include <string>
7 
8 #include "basics.h"
9 
10 namespace opencarp {
11 
14  int min = INT_MAX;
15  int max = 0;
16  int tot = 0;
17  int last_tot = 0;
18  int iter = 0;
19  int solves = 0;
20  int totsolves = 0;
21  double slvtime = 0.0;
22  double lastSlvtime = 0.0;
23  FILE_SPEC logger = NULL;
24 
26  {
27  f_close(logger);
28  }
29 
30  void init_logger(const char* filename);
31  void update_iter(const int curiter);
32  void log_stats(double tm, bool cflg);
33 };
34 
37  int cycle = 0;
38  int activeList = 0;
39  double last_minAT = 0;
40  double minAT = 0;
41  double last_maxAT = std::numeric_limits<double>::quiet_NaN();
42  double maxAT = std::numeric_limits<double>::quiet_NaN();
43  int tot = 0;
44  int last_tot = 0;
45  double slvtime_A = 0.0;
46  double lastSlvtime_A = 0.0;
47  double slvtime_B = 0.0;
48  double lastSlvtime_B = 0.0;
49  double slvtime_D = 0.0;
50  double lastSlvtime_D = 0.0;
51  int solves = 0;
52  int totsolves = 0;
53  bool bc_status = false;
54 
55  FILE_SPEC logger = NULL;
56 
58  {
59  f_close(logger);
60  }
61 
62  void init_logger(const char* filename);
63  void update_iter(const int curiter);
64  void log_stats(double time, bool cflg);
65  void update_cli(double time, bool cflg);
66 };
67 
70  int calls = 0;
71  int tot_calls = 0;
72  double tot_time = 0.0;
73  double last_tot_time = 0.0;
74 
75  FILE_SPEC logger = NULL;
76 
78  {
79  f_close(logger);
80  }
81 
82  void init_logger(const char* filename);
83  void log_stats(double tm, bool cflg);
84 };
85 
86 
87 } // namespace opencarp
88 
89 
90 #endif // _TIMERS_H
int totsolves
total # of solutions
Definition: timers.h:20
void init_logger(const char *filename)
Definition: timers.cc:11
FILE_SPEC logger
file in which to write stats
Definition: timers.h:23
int solves
#solutions performed
Definition: timers.h:19
int iter
its previous solver step
Definition: timers.h:18
double lastSlvtime
total solver time
Definition: timers.h:22
for analysis of the #iterations to solve CG
Definition: timers.h:69
int min
minimum #interations
Definition: timers.h:14
for analysis of the computations done to solve the eikonal model
Definition: timers.h:36
File descriptor struct.
Definition: basics.h:133
int last_tot
previous total #
Definition: timers.h:17
void log_stats(double tm, bool cflg)
Definition: timers.cc:27
void update_iter(const int curiter)
Definition: timers.cc:69
double slvtime
total solver time
Definition: timers.h:21
void f_close(FILE_SPEC &f)
Close a FILE_SPEC.
Definition: basics.cc:162
int max
maximum #iterations
Definition: timers.h:15
for analysis of the #iterations to solve CG
Definition: timers.h:13
Basic utility structs and functions, mostly IO related.