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 <string>
5 
6 #include "basics.h"
7 
8 namespace opencarp {
9 
12  int min = INT_MAX;
13  int max = 0;
14  int tot = 0;
15  int last_tot = 0;
16  int iter = 0;
17  int solves = 0;
18  int totsolves = 0;
19  double slvtime = 0.0;
20  double lastSlvtime = 0.0;
21  FILE_SPEC logger = NULL;
22 
24  {
25  f_close(logger);
26  }
27 
28  void init_logger(const char* filename);
29  void update_iter(const int curiter);
30  void log_stats(double tm, bool cflg);
31 };
32 
35  int calls = 0;
36  int tot_calls = 0;
37  double tot_time = 0.0;
38  double last_tot_time = 0.0;
39 
40  FILE_SPEC logger = NULL;
41 
43  {
44  f_close(logger);
45  }
46 
47  void init_logger(const char* filename);
48  void log_stats(double tm, bool cflg);
49 };
50 
51 
52 } // namespace opencarp
53 
54 
55 #endif // _TIMERS_H
int totsolves
total # of solutions
Definition: timers.h:18
void init_logger(const char *filename)
Definition: timers.cc:9
FILE_SPEC logger
file in which to write stats
Definition: timers.h:21
int solves
#solutions performed
Definition: timers.h:17
int iter
its previous solver step
Definition: timers.h:16
double lastSlvtime
total solver time
Definition: timers.h:20
for analysis of the #iterations to solve CG
Definition: timers.h:34
int min
minimum #interations
Definition: timers.h:12
File descriptor struct.
Definition: basics.h:133
int last_tot
previous total #
Definition: timers.h:15
void log_stats(double tm, bool cflg)
Definition: timers.cc:25
void update_iter(const int curiter)
Definition: timers.cc:67
double slvtime
total solver time
Definition: timers.h:19
void f_close(FILE_SPEC &f)
Close a FILE_SPEC.
Definition: basics.cc:162
int max
maximum #iterations
Definition: timers.h:13
for analysis of the #iterations to solve CG
Definition: timers.h:11
Basic utility structs and functions, mostly IO related.