programmer's documentation
cs_timer_stats.h
Go to the documentation of this file.
1 #ifndef __CS_TIMER_STATS_H__
2 #define __CS_TIMER_STATS_H__
3 
4 /*============================================================================
5  * Application timer statistics and graphs
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2015 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 #include "cs_timer.h"
36 #include "cs_time_plot.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
41 
42 /*============================================================================
43  * Public types
44  *============================================================================*/
45 
46 /*============================================================================
47  * Public function prototypes
48  *============================================================================*/
49 
50 /*----------------------------------------------------------------------------*/
58 /*----------------------------------------------------------------------------*/
59 
60 void
62 
63 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 
69 void
71 
72 /*----------------------------------------------------------------------------*/
86 /*----------------------------------------------------------------------------*/
87 
88 void
90  int frequency,
91  int n_buffer_steps,
92  double flush_wtime);
93 
94 /*----------------------------------------------------------------------------*/
98 /*----------------------------------------------------------------------------*/
99 
100 void
102 
103 /*----------------------------------------------------------------------------*/
113 /*----------------------------------------------------------------------------*/
114 
115 int
116 cs_timer_stats_create(const char *parent_name,
117  const char *name,
118  const char *label);
119 
120 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
132 int
133 cs_timer_stats_id_by_name(const char *name);
134 
135 /*----------------------------------------------------------------------------*/
148 /*----------------------------------------------------------------------------*/
149 
150 void
152  int plot);
153 
154 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 int
166 
167 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
182 cs_timer_stats_start(int id);
183 
184 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
194 void
195 cs_timer_stats_stop(int id);
196 
197 /*----------------------------------------------------------------------------*/
207 /*----------------------------------------------------------------------------*/
208 
209 int
210 cs_timer_stats_switch(int id);
211 
212 /*----------------------------------------------------------------------------*/
223 /*----------------------------------------------------------------------------*/
224 
225 void
227  const cs_timer_t *t0,
228  const cs_timer_t *t1);
229 
230 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 void
242 
243 /*----------------------------------------------------------------------------*/
244 
246 
247 #endif /* __CS_TIMER_STATS_H__ */
int cs_timer_stats_create(const char *parent_name, const char *name, const char *label)
Create a timer statistics structure.
Definition: cs_timer_stats.c:434
void cs_timer_stats_add_diff(int id, const cs_timer_t *t0, const cs_timer_t *t1)
Add a timing range to an inactive timer.
Definition: cs_timer_stats.c:752
int cs_timer_stats_is_active(int id)
indicate if a timer for a given statistic is currently active.
Definition: cs_timer_stats.c:576
Definition: cs_timer.h:46
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
void cs_timer_stats_start(int id)
Start a timer for a given statistic.
Definition: cs_timer_stats.c:602
void cs_timer_stats_stop(int id)
Stop a timer for a given statistic.
Definition: cs_timer_stats.c:647
void cs_timer_stats_increment_time_step(void)
Increment time step for timer statistics.
Definition: cs_timer_stats.c:385
real(c_double), pointer, save t0
reference temperature.
Definition: cstphy.f90:192
cs_time_plot_format_t
Definition: cs_time_plot.h:56
void cs_timer_stats_finalize(void)
Finalize timer statistics handling.
Definition: cs_timer_stats.c:324
void cs_timer_stats_set_plot(int id, int plot)
Enable or disable plotting for a timer statistic.
Definition: cs_timer_stats.c:556
void cs_timer_stats_initialize(void)
Initialize timer statistics handling.
Definition: cs_timer_stats.c:297
#define END_C_DECLS
Definition: cs_defs.h:430
int cs_timer_stats_switch(int id)
Start a timer for a given statistic, stopping previous timers of the same type which are not a parent...
Definition: cs_timer_stats.c:685
void cs_timer_stats_define_defaults(void)
Define default timer statistics.
Definition: cs_timer_stats.c:775
void cs_timer_stats_set_plot_options(cs_time_plot_format_t format, int frequency, int n_buffer_steps, double flush_wtime)
Set global timer statistics plot options.
Definition: cs_timer_stats.c:366
int cs_timer_stats_id_by_name(const char *name)
Return the id of a defined statistic based on its name.
Definition: cs_timer_stats.c:535