MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
macsio_timing.h
Go to the documentation of this file.
1 #ifndef _MACSIO_TIMING_H
2 #define _MACSIO_TIMING_H
3 /*
4 Copyright (c) 2015, Lawrence Livermore National Security, LLC.
5 Produced at the Lawrence Livermore National Laboratory.
6 Written by Mark C. Miller
7 
8 LLNL-CODE-676051. All rights reserved.
9 
10 This file is part of MACSio
11 
12 Please also read the LICENSE file at the top of the source code directory or
13 folder hierarchy.
14 
15 This program is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License (as published by the Free Software
17 Foundation) version 2, dated June 1991.
18 
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
22 Public License for more details.
23 
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
26 Place, Suite 330, Boston, MA 02111-1307 USA
27 */
28 
29 
30 #include <mpi.h>
31 
32 #include <stdio.h>
33 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
97 #define MACSIO_TIMING_ITER_AUTO -1
98 
103 #define MACSIO_TIMING_ITER_IGNORE -2
104 
109 #define MACSIO_TIMING_INVALID_TIMER (~((MACSIO_TIMING_TimerId_t)0x0))
110 
115 #define MACSIO_TIMING_NO_GROUP (((MACSIO_TIMING_GroupMask_t)0x0)
116 
121 #define MACSIO_TIMING_ALL_GROUPS (~((MACSIO_TIMING_GroupMask_t)0))
122 
127 #define MT_Time MACSIO_TIMING_GetCurrentTime
128 
136 #define MT_StartTimer(LAB, GMASK, ITER) MACSIO_TIMING_StartTimer(LAB, GMASK, ITER, __FILE__, __LINE__)
137 
143 #define MT_StopTimer(ID) MACSIO_TIMING_StopTimer(ID)
144 
145 typedef unsigned int MACSIO_TIMING_TimerId_t;
146 typedef unsigned long long MACSIO_TIMING_GroupMask_t;
147 
154 extern int MACSIO_TIMING_UseMPI_Wtime;
155 
162 extern MACSIO_TIMING_GroupMask_t MACSIO_TIMING_GroupMask(
163  char const *grpName
164 );
165 
172 extern MACSIO_TIMING_TimerId_t
174  char const *label,
175  MACSIO_TIMING_GroupMask_t gmask,
176  int iter_num,
177  char const *file,
178  int line );
179 
186 extern double
187 MACSIO_TIMING_StopTimer(MACSIO_TIMING_TimerId_t id );
188 
194 extern double
196  MACSIO_TIMING_TimerId_t tid,
197  char const *field
198 );
199 
203 extern double
205  MACSIO_TIMING_TimerId_t tid,
206  char const *field
207 );
208 
217  MACSIO_TIMING_GroupMask_t gmask,
218  char ***strs,
219  int *nstrs,
220  int *maxlen );
221 
227 extern void
229 #ifdef HAVE_MPI
230  MPI_Comm comm,
231 #else
232  int comm,
233 #endif
234  int root );
235 
241 extern void
243  MACSIO_TIMING_GroupMask_t gmask,
244  char ***strs,
245  int *nstrs,
246  int *maxlen );
247 
253 extern void MACSIO_TIMING_ClearTimers(
254  MACSIO_TIMING_GroupMask_t gmask );
255 
259 extern double MACSIO_TIMING_GetCurrentTime(void);
260 
261 #ifdef __cplusplus
262 }
263 #endif
264 
267 #endif /* _MACSIO_TIMING_H */
void MACSIO_TIMING_ReduceTimers(MPI_Comm comm, int root)
Reduce timers across MPI tasks.
double MACSIO_TIMING_GetReducedTimer(MACSIO_TIMING_TimerId_t tid, char const *field)
Get data from a specific reduced timer.
void MACSIO_TIMING_ClearTimers(MACSIO_TIMING_GroupMask_t gmask)
Clear a group of timers.
unsigned long long MACSIO_TIMING_GroupMask_t
unsigned int MACSIO_TIMING_TimerId_t
double MACSIO_TIMING_GetCurrentTime(void)
Get current time.
MACSIO_TIMING_TimerId_t MACSIO_TIMING_StartTimer(char const *label, MACSIO_TIMING_GroupMask_t gmask, int iter_num, char const *file, int line)
Create/Start a timer.
int MACSIO_TIMING_UseMPI_Wtime
Integer variable to control function used to get timer values.
Definition: macsio_timing.c:44
void MACSIO_TIMING_DumpReducedTimersToStrings(MACSIO_TIMING_GroupMask_t gmask, char ***strs, int *nstrs, int *maxlen)
Dump reduced timers to ascii strings.
double MACSIO_TIMING_StopTimer(MACSIO_TIMING_TimerId_t id)
Stop a timer.
double MACSIO_TIMING_GetTimer(MACSIO_TIMING_TimerId_t tid, char const *field)
Get data from a specific timer.
void MACSIO_TIMING_DumpTimersToStrings(MACSIO_TIMING_GroupMask_t gmask, char ***strs, int *nstrs, int *maxlen)
Dump timers to ascii strings.
MACSIO_TIMING_GroupMask_t MACSIO_TIMING_GroupMask(char const *grpName)
Create a group name and mask.