Intel® OpenMP* Runtime Library
 All Classes Functions Variables Typedefs Enumerations Enumerator Modules Pages
kmp_omp.h
1 #if USE_DEBUGGER
2 /*
3  * kmp_omp.h -- OpenMP definition for kmp_omp_struct_info_t.
4  * This is for information about runtime library structures.
5  */
6 
7 /* <copyright>
8  Copyright (c) 1997-2015 Intel Corporation. All Rights Reserved.
9 
10  Redistribution and use in source and binary forms, with or without
11  modification, are permitted provided that the following conditions
12  are met:
13 
14  * Redistributions of source code must retain the above copyright
15  notice, this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright
17  notice, this list of conditions and the following disclaimer in the
18  documentation and/or other materials provided with the distribution.
19  * Neither the name of Intel Corporation nor the names of its
20  contributors may be used to endorse or promote products derived
21  from this software without specific prior written permission.
22 
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 
35 </copyright> */
36 
37 /* THIS FILE SHOULD NOT BE MODIFIED IN IDB INTERFACE LIBRARY CODE
38  * It should instead be modified in the OpenMP runtime and copied
39  * to the interface library code. This way we can minimize the
40  * problems that this is sure to cause having two copies of the
41  * same file.
42  *
43  * files live in libomp and libomp_db/src/include
44  */
45 
46 /* CHANGE THIS WHEN STRUCTURES BELOW CHANGE
47  * Before we release this to a customer, please don't change this value. After it is released and
48  * stable, then any new updates to the structures or data structure traversal algorithms need to
49  * change this value.
50  */
51 #define KMP_OMP_VERSION 9
52 
53 typedef struct {
54  kmp_int32 offset;
55  kmp_int32 size;
56 } offset_and_size_t;
57 
58 typedef struct {
59  kmp_uint64 addr;
60  kmp_int32 size;
61  kmp_int32 padding;
62 } addr_and_size_t;
63 
64 typedef struct {
65  kmp_uint64 flags; // Flags for future extensions.
66  kmp_uint64 file; // Pointer to name of source file where the parallel region is.
67  kmp_uint64 func; // Pointer to name of routine where the parallel region is.
68  kmp_int32 begin; // Beginning of source line range.
69  kmp_int32 end; // End of source line range.
70  kmp_int32 num_threads; // Specified number of threads.
71 } kmp_omp_nthr_item_t;
72 
73 typedef struct {
74  kmp_int32 num; // Number of items in the arrray.
75  kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t.
76 } kmp_omp_nthr_info_t;
77 
78 
79 /* This structure is known to the idb interface library */
80 typedef struct {
81 
82  /* Change this only if you make a fundamental data structure change here */
83  kmp_int32 lib_version;
84 
85  /* sanity check. Only should be checked if versions are identical
86  * This is also used for backward compatibility to get the runtime
87  * structure size if it the runtime is older than the interface */
88  kmp_int32 sizeof_this_structure;
89 
90  /* OpenMP RTL version info. */
91  addr_and_size_t major;
92  addr_and_size_t minor;
93  addr_and_size_t build;
94  addr_and_size_t openmp_version;
95  addr_and_size_t banner;
96 
97  /* Various globals. */
98  addr_and_size_t threads; // Pointer to __kmp_threads.
99  addr_and_size_t roots; // Pointer to __kmp_root.
100  addr_and_size_t capacity; // Pointer to __kmp_threads_capacity.
101  addr_and_size_t monitor; // Pointer to __kmp_monitor.
102 #if ! KMP_USE_DYNAMIC_LOCK
103  addr_and_size_t lock_table; // Pointer to __kmp_lock_table.
104 #endif
105  addr_and_size_t func_microtask;
106  addr_and_size_t func_fork;
107  addr_and_size_t func_fork_teams;
108  addr_and_size_t team_counter;
109  addr_and_size_t task_counter;
110  addr_and_size_t nthr_info;
111  kmp_int32 address_width;
112  kmp_int32 indexed_locks;
113  kmp_int32 last_barrier; // The end in enum barrier_type
114  kmp_int32 deque_size; // TASK_DEQUE_SIZE
115 
116  /* thread structure information. */
117  kmp_int32 th_sizeof_struct;
118  offset_and_size_t th_info; // descriptor for thread
119  offset_and_size_t th_team; // team for this thread
120  offset_and_size_t th_root; // root for this thread
121  offset_and_size_t th_serial_team; // serial team under this thread
122  offset_and_size_t th_ident; // location for this thread (if available)
123  offset_and_size_t th_spin_here; // is thread waiting for lock (if available)
124  offset_and_size_t th_next_waiting; // next thread waiting for lock (if available)
125  offset_and_size_t th_task_team; // task team struct
126  offset_and_size_t th_current_task; // innermost task being executed
127  offset_and_size_t th_task_state; // alternating 0/1 for task team identification
128  offset_and_size_t th_bar;
129  offset_and_size_t th_b_worker_arrived; // the worker increases it by 1 when it arrives to the barrier
130 
131  /* teams information */
132  offset_and_size_t th_teams_microtask;// entry address for teams construct
133  offset_and_size_t th_teams_level; // initial level of teams construct
134  offset_and_size_t th_teams_nteams; // number of teams in a league
135  offset_and_size_t th_teams_nth; // number of threads in each team of the league
136 
137  /* kmp_desc structure (for info field above) */
138  kmp_int32 ds_sizeof_struct;
139  offset_and_size_t ds_tid; // team thread id
140  offset_and_size_t ds_gtid; // global thread id
141  offset_and_size_t ds_thread; // native thread id
142 
143  /* team structure information */
144  kmp_int32 t_sizeof_struct;
145  offset_and_size_t t_master_tid; // tid of master in parent team
146  offset_and_size_t t_ident; // location of parallel region
147  offset_and_size_t t_parent; // parent team
148  offset_and_size_t t_nproc; // # team threads
149  offset_and_size_t t_threads; // array of threads
150  offset_and_size_t t_serialized; // # levels of serialized teams
151  offset_and_size_t t_id; // unique team id
152  offset_and_size_t t_pkfn;
153  offset_and_size_t t_task_team; // task team structure
154  offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task
155  offset_and_size_t t_cancel_request;
156  offset_and_size_t t_bar;
157  offset_and_size_t t_b_master_arrived; // increased by 1 when master arrives to a barrier
158  offset_and_size_t t_b_team_arrived; // increased by one when all the threads arrived
159 
160  /* root structure information */
161  kmp_int32 r_sizeof_struct;
162  offset_and_size_t r_root_team; // team at root
163  offset_and_size_t r_hot_team; // hot team for this root
164  offset_and_size_t r_uber_thread; // root thread
165  offset_and_size_t r_root_id; // unique root id (if available)
166 
167  /* ident structure information */
168  kmp_int32 id_sizeof_struct;
169  offset_and_size_t id_psource; /* address of string ";file;func;line1;line2;;". */
170  offset_and_size_t id_flags;
171 
172  /* lock structure information */
173  kmp_int32 lk_sizeof_struct;
174  offset_and_size_t lk_initialized;
175  offset_and_size_t lk_location;
176  offset_and_size_t lk_tail_id;
177  offset_and_size_t lk_head_id;
178  offset_and_size_t lk_next_ticket;
179  offset_and_size_t lk_now_serving;
180  offset_and_size_t lk_owner_id;
181  offset_and_size_t lk_depth_locked;
182  offset_and_size_t lk_lock_flags;
183 
184 #if ! KMP_USE_DYNAMIC_LOCK
185  /* lock_table_t */
186  kmp_int32 lt_size_of_struct; /* Size and layout of kmp_lock_table_t. */
187  offset_and_size_t lt_used;
188  offset_and_size_t lt_allocated;
189  offset_and_size_t lt_table;
190 #endif
191 
192  /* task_team_t */
193  kmp_int32 tt_sizeof_struct;
194  offset_and_size_t tt_threads_data;
195  offset_and_size_t tt_found_tasks;
196  offset_and_size_t tt_nproc;
197  offset_and_size_t tt_unfinished_threads;
198  offset_and_size_t tt_active;
199 
200  /* kmp_taskdata_t */
201  kmp_int32 td_sizeof_struct;
202  offset_and_size_t td_task_id; // task id
203  offset_and_size_t td_flags; // task flags
204  offset_and_size_t td_team; // team for this task
205  offset_and_size_t td_parent; // parent task
206  offset_and_size_t td_level; // task testing level
207  offset_and_size_t td_ident; // task identifier
208  offset_and_size_t td_allocated_child_tasks; // child tasks (+ current task) not yet deallocated
209  offset_and_size_t td_incomplete_child_tasks; // child tasks not yet complete
210 
211  /* Taskwait */
212  offset_and_size_t td_taskwait_ident;
213  offset_and_size_t td_taskwait_counter;
214  offset_and_size_t td_taskwait_thread; // gtid + 1 of thread encountered taskwait
215 
216  /* Taskgroup */
217  offset_and_size_t td_taskgroup; // pointer to the current taskgroup
218  offset_and_size_t td_task_count; // number of allocated and not yet complete tasks
219  offset_and_size_t td_cancel; // request for cancellation of this taskgroup
220 
221  /* Task dependency */
222  offset_and_size_t td_depnode; // pointer to graph node if the task has dependencies
223  offset_and_size_t dn_node;
224  offset_and_size_t dn_next;
225  offset_and_size_t dn_successors;
226  offset_and_size_t dn_task;
227  offset_and_size_t dn_npredecessors;
228  offset_and_size_t dn_nrefs;
229  offset_and_size_t dn_routine;
230 
231  /* kmp_thread_data_t */
232  kmp_int32 hd_sizeof_struct;
233  offset_and_size_t hd_deque;
234  offset_and_size_t hd_deque_head;
235  offset_and_size_t hd_deque_tail;
236  offset_and_size_t hd_deque_ntasks;
237  offset_and_size_t hd_deque_last_stolen;
238 
239  // The last field of stable version.
240  kmp_uint64 last_field;
241 
242 } kmp_omp_struct_info_t;
243 
244 #endif /* USE_DEBUGGER */
245 
246 /* end of file */