OpenMPI  0.1.1
vt_pomp.h
1 /**
2  * VampirTrace
3  * http://www.tu-dresden.de/zih/vampirtrace
4  *
5  * Copyright (c) 2005-2012, ZIH, TU Dresden, Federal Republic of Germany
6  *
7  * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing
8  * Centre, Federal Republic of Germany
9  *
10  * See the file COPYING in the package base directory for details
11  **/
12 
13 #include "vt_inttypes.h"
14 
15 #define IS_POMP_TRACE_ON ( pomp_tracing )
16 
17 extern int pomp_initialized;
18 extern int pomp_tracing;
19 
20 struct VTRegDescr {
21  uint32_t rid; /* region id */
22  uint32_t brid; /* region id of implicit barrier */
23  /* also: lockid for critical */
24  uint32_t sbrid; /* region id of enclosed structured block */
25  /* also: inner construct for combined constructs */
26  uint32_t fid;
27  uint32_t begln;
28  uint32_t endln;
29 };
30 
31 #define GUARDED_ENTER(id) \
32  if ( IS_POMP_TRACE_ON ) { \
33  struct VTRegDescr* data = (struct VTRegDescr*)(r->data); \
34  uint64_t time = vt_pform_wtime(); \
35  vt_enter(VT_CURRENT_THREAD, &time, data->id); \
36  }
37 
38 #define GUARDED_ENTER_2(ch,id1,id2) \
39  if ( IS_POMP_TRACE_ON ) { \
40  struct VTRegDescr* data; \
41  uint64_t time; \
42  data = (struct VTRegDescr*)(r->data); \
43  time = vt_pform_wtime(); \
44  if ( r->name[0] == ch ) \
45  vt_enter(VT_CURRENT_THREAD, &time, data->id1); \
46  else \
47  vt_enter(VT_CURRENT_THREAD, &time, data->id2); \
48  }
49 
50 #define GUARDED_EXIT() \
51  if ( IS_POMP_TRACE_ON ) { \
52  uint64_t time; \
53  time = vt_pform_wtime(); \
54  vt_exit(VT_CURRENT_THREAD, &time); \
55  }
56 
57 #define GUARDED_COLL_ENTER(id) \
58  if ( IS_POMP_TRACE_ON ) { \
59  struct VTRegDescr* data; \
60  uint64_t time; \
61  data = (struct VTRegDescr*)(r->data); \
62  time = vt_pform_wtime(); \
63  /* vt_omp_collenter(VT_CURRENT_THREAD, &time, data->id); */ \
64  vt_enter(VT_CURRENT_THREAD, &time, data->id); \
65  }
66 
67 #define GUARDED_COLL_ENTER_2(ch,id1,id2) \
68  if ( IS_POMP_TRACE_ON ) { \
69  struct VTRegDescr* data; \
70  uint64_t time; \
71  data = (struct VTRegDescr*)(r->data); \
72  time = vt_pform_wtime(); \
73  if ( r->name[0] == ch ) { \
74  /* vt_omp_collenter(VT_CURRENT_THREAD, &time, data->id1); */ \
75  vt_enter(VT_CURRENT_THREAD, &time, data->id1); \
76  } else { \
77  /* vt_omp_collenter(VT_CURRENT_THREAD, &time, data->id2); */ \
78  vt_enter(VT_CURRENT_THREAD, &time, data->id2); \
79  } \
80  }
81 
82 #define GUARDED_COLL_EXIT() \
83  if ( IS_POMP_TRACE_ON ) { \
84  uint64_t time; \
85  time = vt_pform_wtime(); \
86  /* vt_omp_collexit(VT_CURRENT_THREAD, &time); */ \
87  vt_exit(VT_CURRENT_THREAD, &time); \
88  }
Definition: vt_pomp.h:20