1 #ifndef __OMPT_INTERNAL_H__
2 #define __OMPT_INTERNAL_H__
3 
4 #include "ompt.h"
5 #include "ompt-event-specific.h"
6 
7 #define OMPT_VERSION 1
8 
9 #define _OMP_EXTERN extern "C"
10 
11 #define OMPT_INVOKER(x) \
12   ((x == fork_context_gnu) ? ompt_invoker_program : ompt_invoker_runtime)
13 
14 
15 #define ompt_callback(e) e ## _callback
16 
17 
18 typedef struct ompt_callbacks_s {
19 #define ompt_event_macro(event, callback, eventid) callback ompt_callback(event);
20 
21     FOREACH_OMPT_EVENT(ompt_event_macro)
22 
23 #undef ompt_event_macro
24 } ompt_callbacks_t;
25 
26 
27 
28 typedef struct {
29     ompt_frame_t            frame;
30     void*                   function;
31     ompt_task_id_t          task_id;
32 #if OMP_40_ENABLED
33     int                     ndeps;
34     ompt_task_dependence_t  *deps;
35 #endif /* OMP_40_ENABLED */
36 } ompt_task_info_t;
37 
38 
39 typedef struct {
40     ompt_parallel_id_t  parallel_id;
41     void                *microtask;
42 } ompt_team_info_t;
43 
44 
45 typedef struct ompt_lw_taskteam_s {
46     ompt_team_info_t    ompt_team_info;
47     ompt_task_info_t    ompt_task_info;
48     struct ompt_lw_taskteam_s *parent;
49 } ompt_lw_taskteam_t;
50 
51 
52 typedef struct ompt_parallel_info_s {
53     ompt_task_id_t parent_task_id;    /* id of parent task            */
54     ompt_parallel_id_t parallel_id;   /* id of parallel region        */
55     ompt_frame_t *parent_task_frame;  /* frame data of parent task    */
56     void *parallel_function;          /* pointer to outlined function */
57 } ompt_parallel_info_t;
58 
59 
60 typedef struct {
61     ompt_state_t        state;
62     ompt_wait_id_t      wait_id;
63     void                *idle_frame;
64 } ompt_thread_info_t;
65 
66 
67 extern ompt_callbacks_t ompt_callbacks;
68 
69 #if OMP_40_ENABLED && OMPT_SUPPORT && OMPT_TRACE
70 #if USE_FAST_MEMORY
71 #  define KMP_OMPT_DEPS_ALLOC __kmp_fast_allocate
72 #  define KMP_OMPT_DEPS_FREE __kmp_fast_free
73 # else
74 #  define KMP_OMPT_DEPS_ALLOC __kmp_thread_malloc
75 #  define KMP_OMPT_DEPS_FREE __kmp_thread_free
76 # endif
77 #endif /* OMP_40_ENABLED && OMPT_SUPPORT && OMPT_TRACE */
78 
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82 
83 void ompt_pre_init(void);
84 void ompt_post_init(void);
85 void ompt_fini(void);
86 
87 extern int ompt_enabled;
88 
89 #ifdef __cplusplus
90 };
91 #endif
92 
93 #endif
94