timing.hpp 959 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* timing.hpp -- header file for self-timing code */

#ifndef TIMING_HPP
#define TIMING_HPP 1  // Include this header file at most once

/* The timing infrastructure works with a stack-based model.

   At portions of the code to be instrumented, call timing_push("name")
   with some (short but) memortable name for the code segment; after the
   end of the section call timing_pop().  This underlying code will build
   the corresponding call-time-tree and measure (via MPI_Wtime) the time
   between the timing_push and the corresponding timing_pop.

   This model does require that timing be called in a predictable way, such
   that timing_pop is called before any possible exit from the code path.*/

17
18
19
20
#ifndef TIMING_ENABLE // If timing code is not enabled, define the respective functions as no-ops 

#define timing_push(x)
#define timing_pop()
21

22
23
#else
void timing_push(const char * name);
24
void timing_pop();
25
#endif
26
27
28
29
30
31

void timing_stack_report();



#endif