My Project
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-2019 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 /*----------------------------------------------------------------------------*/
81 /*----------------------------------------------------------------------------*/
82 
83 void
85 
86 /*----------------------------------------------------------------------------*/
100 /*----------------------------------------------------------------------------*/
101 
102 void
104  int frequency,
105  int n_buffer_steps,
106  double flush_wtime);
107 
108 /*----------------------------------------------------------------------------*/
112 /*----------------------------------------------------------------------------*/
113 
114 void
116 
117 /*----------------------------------------------------------------------------*/
127 /*----------------------------------------------------------------------------*/
128 
129 int
130 cs_timer_stats_create(const char *parent_name,
131  const char *name,
132  const char *label);
133 
134 /*----------------------------------------------------------------------------*/
144 /*----------------------------------------------------------------------------*/
145 
146 int
147 cs_timer_stats_id_by_name(const char *name);
148 
149 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 void
166  int plot);
167 
168 /*----------------------------------------------------------------------------*/
176 /*----------------------------------------------------------------------------*/
177 
178 int
180 
181 /*----------------------------------------------------------------------------*/
193 /*----------------------------------------------------------------------------*/
194 
195 void
196 cs_timer_stats_start(int id);
197 
198 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 void
209 cs_timer_stats_stop(int id);
210 
211 /*----------------------------------------------------------------------------*/
221 /*----------------------------------------------------------------------------*/
222 
223 int
224 cs_timer_stats_switch(int id);
225 
226 /*----------------------------------------------------------------------------*/
237 /*----------------------------------------------------------------------------*/
238 
239 void
241  const cs_timer_t *t0,
242  const cs_timer_t *t1);
243 
244 /*----------------------------------------------------------------------------*/
252 /*----------------------------------------------------------------------------*/
253 
254 void
256 
257 /*----------------------------------------------------------------------------*/
258 
260 
261 #endif /* __CS_TIMER_STATS_H__ */
cs_defs.h
t0
void const cs_real_t const cs_real_t const cs_real_t * t0
Definition: cs_ctwr_air_props.h:128
cs_timer_stats_add_diff
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:774
cs_timer_stats_is_active
int cs_timer_stats_is_active(int id)
indicate if a timer for a given statistic is currently active.
Definition: cs_timer_stats.c:598
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_time_plot.h
cs_timer_stats_stop
void cs_timer_stats_stop(int id)
Stop a timer for a given statistic.
Definition: cs_timer_stats.c:669
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_timer_stats_increment_time_step
void cs_timer_stats_increment_time_step(void)
Increment time step for timer statistics.
Definition: cs_timer_stats.c:406
cs_timer_stats_id_by_name
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:557
cs_timer_stats_switch
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:707
cs_timer_stats_finalize
void cs_timer_stats_finalize(void)
Finalize timer statistics handling.
Definition: cs_timer_stats.c:325
cs_timer_t
Definition: cs_timer.h:46
cs_timer_stats_set_start_time
void cs_timer_stats_set_start_time(int time_id)
Set a start time for time stats.
Definition: cs_timer_stats.c:362
cs_timer_stats_create
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:456
cs_timer_stats_define_defaults
void cs_timer_stats_define_defaults(void)
Define default timer statistics.
Definition: cs_timer_stats.c:797
cs_timer_stats_set_plot_options
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:387
cs_timer_stats_initialize
void cs_timer_stats_initialize(void)
Initialize timer statistics handling.
Definition: cs_timer_stats.c:297
cs_timer_stats_start
void cs_timer_stats_start(int id)
Start a timer for a given statistic.
Definition: cs_timer_stats.c:624
cs_timer_stats_set_plot
void cs_timer_stats_set_plot(int id, int plot)
Enable or disable plotting for a timer statistic.
Definition: cs_timer_stats.c:578
cs_time_plot_format_t
cs_time_plot_format_t
Definition: cs_time_plot.h:56
cs_timer.h