blob: fc4de0f2360e6ae613b163de1abd330c02b9f52a [file] [log] [blame]
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +00001#if USE_DEBUGGER
Jim Cownie5e8470a2013-09-27 10:38:44 +00002/*
3 * kmp_omp.h -- OpenMP definition for kmp_omp_struct_info_t.
4 * This is for information about runtime library structures.
Jim Cownie5e8470a2013-09-27 10:38:44 +00005 */
6
7
8//===----------------------------------------------------------------------===//
9//
10// The LLVM Compiler Infrastructure
11//
12// This file is dual licensed under the MIT and the University of Illinois Open
13// Source Licenses. See LICENSE.txt for details.
14//
15//===----------------------------------------------------------------------===//
16
17
18/* THIS FILE SHOULD NOT BE MODIFIED IN IDB INTERFACE LIBRARY CODE
19 * It should instead be modified in the OpenMP runtime and copied
20 * to the interface library code. This way we can minimize the
21 * problems that this is sure to cause having two copies of the
22 * same file.
23 *
24 * files live in libomp and libomp_db/src/include
25 */
26
27/* CHANGE THIS WHEN STRUCTURES BELOW CHANGE
28 * Before we release this to a customer, please don't change this value. After it is released and
29 * stable, then any new updates to the structures or data structure traversal algorithms need to
30 * change this value.
31 */
Andrey Churbanov440af7e2015-02-10 19:53:13 +000032#define KMP_OMP_VERSION 9
Jim Cownie5e8470a2013-09-27 10:38:44 +000033
34typedef struct {
35 kmp_int32 offset;
36 kmp_int32 size;
37} offset_and_size_t;
38
39typedef struct {
40 kmp_uint64 addr;
41 kmp_int32 size;
42 kmp_int32 padding;
43} addr_and_size_t;
44
45typedef struct {
46 kmp_uint64 flags; // Flags for future extensions.
47 kmp_uint64 file; // Pointer to name of source file where the parallel region is.
48 kmp_uint64 func; // Pointer to name of routine where the parallel region is.
49 kmp_int32 begin; // Beginning of source line range.
50 kmp_int32 end; // End of source line range.
51 kmp_int32 num_threads; // Specified number of threads.
52} kmp_omp_nthr_item_t;
53
54typedef struct {
55 kmp_int32 num; // Number of items in the arrray.
56 kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t.
57} kmp_omp_nthr_info_t;
58
59
60/* This structure is known to the idb interface library */
61typedef struct {
62
63 /* Change this only if you make a fundamental data structure change here */
64 kmp_int32 lib_version;
65
66 /* sanity check. Only should be checked if versions are identical
67 * This is also used for backward compatibility to get the runtime
68 * structure size if it the runtime is older than the interface */
69 kmp_int32 sizeof_this_structure;
70
71 /* OpenMP RTL version info. */
72 addr_and_size_t major;
73 addr_and_size_t minor;
74 addr_and_size_t build;
Andrey Churbanov440af7e2015-02-10 19:53:13 +000075 addr_and_size_t openmp_version;
Jim Cownie5e8470a2013-09-27 10:38:44 +000076 addr_and_size_t banner;
77
78 /* Various globals. */
79 addr_and_size_t threads; // Pointer to __kmp_threads.
80 addr_and_size_t roots; // Pointer to __kmp_root.
81 addr_and_size_t capacity; // Pointer to __kmp_threads_capacity.
82 addr_and_size_t monitor; // Pointer to __kmp_monitor.
Andrey Churbanov5c56fb52015-02-20 18:05:17 +000083#if ! KMP_USE_DYNAMIC_LOCK
Jim Cownie5e8470a2013-09-27 10:38:44 +000084 addr_and_size_t lock_table; // Pointer to __kmp_lock_table.
Andrey Churbanov5c56fb52015-02-20 18:05:17 +000085#endif
Jim Cownie5e8470a2013-09-27 10:38:44 +000086 addr_and_size_t func_microtask;
87 addr_and_size_t func_fork;
Andrey Churbanov440af7e2015-02-10 19:53:13 +000088 addr_and_size_t func_fork_teams;
Jim Cownie5e8470a2013-09-27 10:38:44 +000089 addr_and_size_t team_counter;
90 addr_and_size_t task_counter;
91 addr_and_size_t nthr_info;
92 kmp_int32 address_width;
93 kmp_int32 indexed_locks;
Andrey Churbanov440af7e2015-02-10 19:53:13 +000094 kmp_int32 last_barrier; // The end in enum barrier_type
95 kmp_int32 deque_size; // TASK_DEQUE_SIZE
Jim Cownie5e8470a2013-09-27 10:38:44 +000096
97 /* thread structure information. */
98 kmp_int32 th_sizeof_struct;
99 offset_and_size_t th_info; // descriptor for thread
100 offset_and_size_t th_team; // team for this thread
101 offset_and_size_t th_root; // root for this thread
102 offset_and_size_t th_serial_team; // serial team under this thread
103 offset_and_size_t th_ident; // location for this thread (if available)
104 offset_and_size_t th_spin_here; // is thread waiting for lock (if available)
105 offset_and_size_t th_next_waiting; // next thread waiting for lock (if available)
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000106 offset_and_size_t th_task_team; // task team struct
107 offset_and_size_t th_current_task; // innermost task being executed
108 offset_and_size_t th_task_state; // alternating 0/1 for task team identification
Jim Cownie5e8470a2013-09-27 10:38:44 +0000109 offset_and_size_t th_bar;
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000110 offset_and_size_t th_b_worker_arrived; // the worker increases it by 1 when it arrives to the barrier
111
Jonathan Peyton441f3372015-09-21 17:24:46 +0000112#if OMP_40_ENABLED
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000113 /* teams information */
114 offset_and_size_t th_teams_microtask;// entry address for teams construct
115 offset_and_size_t th_teams_level; // initial level of teams construct
116 offset_and_size_t th_teams_nteams; // number of teams in a league
117 offset_and_size_t th_teams_nth; // number of threads in each team of the league
Jonathan Peyton441f3372015-09-21 17:24:46 +0000118#endif
Jim Cownie5e8470a2013-09-27 10:38:44 +0000119
120 /* kmp_desc structure (for info field above) */
121 kmp_int32 ds_sizeof_struct;
122 offset_and_size_t ds_tid; // team thread id
123 offset_and_size_t ds_gtid; // global thread id
124 offset_and_size_t ds_thread; // native thread id
125
126 /* team structure information */
127 kmp_int32 t_sizeof_struct;
128 offset_and_size_t t_master_tid; // tid of master in parent team
129 offset_and_size_t t_ident; // location of parallel region
130 offset_and_size_t t_parent; // parent team
131 offset_and_size_t t_nproc; // # team threads
132 offset_and_size_t t_threads; // array of threads
133 offset_and_size_t t_serialized; // # levels of serialized teams
134 offset_and_size_t t_id; // unique team id
135 offset_and_size_t t_pkfn;
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000136 offset_and_size_t t_task_team; // task team structure
137 offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task
Jonathan Peyton441f3372015-09-21 17:24:46 +0000138#if OMP_40_ENABLED
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000139 offset_and_size_t t_cancel_request;
Jonathan Peyton441f3372015-09-21 17:24:46 +0000140#endif
Jim Cownie5e8470a2013-09-27 10:38:44 +0000141 offset_and_size_t t_bar;
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000142 offset_and_size_t t_b_master_arrived; // increased by 1 when master arrives to a barrier
143 offset_and_size_t t_b_team_arrived; // increased by one when all the threads arrived
Jim Cownie5e8470a2013-09-27 10:38:44 +0000144
145 /* root structure information */
146 kmp_int32 r_sizeof_struct;
147 offset_and_size_t r_root_team; // team at root
148 offset_and_size_t r_hot_team; // hot team for this root
149 offset_and_size_t r_uber_thread; // root thread
150 offset_and_size_t r_root_id; // unique root id (if available)
151
152 /* ident structure information */
153 kmp_int32 id_sizeof_struct;
154 offset_and_size_t id_psource; /* address of string ";file;func;line1;line2;;". */
155 offset_and_size_t id_flags;
156
157 /* lock structure information */
158 kmp_int32 lk_sizeof_struct;
159 offset_and_size_t lk_initialized;
160 offset_and_size_t lk_location;
161 offset_and_size_t lk_tail_id;
162 offset_and_size_t lk_head_id;
163 offset_and_size_t lk_next_ticket;
164 offset_and_size_t lk_now_serving;
165 offset_and_size_t lk_owner_id;
166 offset_and_size_t lk_depth_locked;
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000167 offset_and_size_t lk_lock_flags;
Jim Cownie5e8470a2013-09-27 10:38:44 +0000168
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000169#if ! KMP_USE_DYNAMIC_LOCK
Jim Cownie5e8470a2013-09-27 10:38:44 +0000170 /* lock_table_t */
171 kmp_int32 lt_size_of_struct; /* Size and layout of kmp_lock_table_t. */
172 offset_and_size_t lt_used;
173 offset_and_size_t lt_allocated;
174 offset_and_size_t lt_table;
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000175#endif
Jim Cownie5e8470a2013-09-27 10:38:44 +0000176
177 /* task_team_t */
178 kmp_int32 tt_sizeof_struct;
179 offset_and_size_t tt_threads_data;
180 offset_and_size_t tt_found_tasks;
181 offset_and_size_t tt_nproc;
182 offset_and_size_t tt_unfinished_threads;
183 offset_and_size_t tt_active;
Jim Cownie5e8470a2013-09-27 10:38:44 +0000184
185 /* kmp_taskdata_t */
186 kmp_int32 td_sizeof_struct;
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000187 offset_and_size_t td_task_id; // task id
188 offset_and_size_t td_flags; // task flags
189 offset_and_size_t td_team; // team for this task
190 offset_and_size_t td_parent; // parent task
191 offset_and_size_t td_level; // task testing level
192 offset_and_size_t td_ident; // task identifier
193 offset_and_size_t td_allocated_child_tasks; // child tasks (+ current task) not yet deallocated
194 offset_and_size_t td_incomplete_child_tasks; // child tasks not yet complete
195
196 /* Taskwait */
197 offset_and_size_t td_taskwait_ident;
198 offset_and_size_t td_taskwait_counter;
199 offset_and_size_t td_taskwait_thread; // gtid + 1 of thread encountered taskwait
200
Jonathan Peyton441f3372015-09-21 17:24:46 +0000201#if OMP_40_ENABLED
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000202 /* Taskgroup */
203 offset_and_size_t td_taskgroup; // pointer to the current taskgroup
204 offset_and_size_t td_task_count; // number of allocated and not yet complete tasks
205 offset_and_size_t td_cancel; // request for cancellation of this taskgroup
206
207 /* Task dependency */
208 offset_and_size_t td_depnode; // pointer to graph node if the task has dependencies
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000209 offset_and_size_t dn_node;
210 offset_and_size_t dn_next;
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +0000211 offset_and_size_t dn_successors;
Andrey Churbanov440af7e2015-02-10 19:53:13 +0000212 offset_and_size_t dn_task;
213 offset_and_size_t dn_npredecessors;
214 offset_and_size_t dn_nrefs;
Jonathan Peyton441f3372015-09-21 17:24:46 +0000215#endif
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +0000216 offset_and_size_t dn_routine;
Jim Cownie5e8470a2013-09-27 10:38:44 +0000217
218 /* kmp_thread_data_t */
219 kmp_int32 hd_sizeof_struct;
220 offset_and_size_t hd_deque;
221 offset_and_size_t hd_deque_head;
222 offset_and_size_t hd_deque_tail;
223 offset_and_size_t hd_deque_ntasks;
224 offset_and_size_t hd_deque_last_stolen;
225
226 // The last field of stable version.
227 kmp_uint64 last_field;
Jim Cownie5e8470a2013-09-27 10:38:44 +0000228
229} kmp_omp_struct_info_t;
230
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +0000231#endif /* USE_DEBUGGER */
Jim Cownie5e8470a2013-09-27 10:38:44 +0000232
233/* end of file */