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