00001 /* 00002 * kmp_omp.h -- OpenMP definition for kmp_omp_struct_info_t. 00003 * This is for information about runtime library structures. 00004 * $Revision: 42105 $ 00005 * $Date: 2013-03-11 14:51:34 -0500 (Mon, 11 Mar 2013) $ 00006 */ 00007 00008 /* <copyright> 00009 Copyright (c) 1997-2013 Intel Corporation. All Rights Reserved. 00010 00011 Redistribution and use in source and binary forms, with or without 00012 modification, are permitted provided that the following conditions 00013 are met: 00014 00015 * Redistributions of source code must retain the above copyright 00016 notice, this list of conditions and the following disclaimer. 00017 * Redistributions in binary form must reproduce the above copyright 00018 notice, this list of conditions and the following disclaimer in the 00019 documentation and/or other materials provided with the distribution. 00020 * Neither the name of Intel Corporation nor the names of its 00021 contributors may be used to endorse or promote products derived 00022 from this software without specific prior written permission. 00023 00024 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00025 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00026 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00027 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00028 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00029 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00030 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00031 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00032 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00033 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 00036 00037 ------------------------------------------------------------------------ 00038 00039 Portions of this software are protected under the following patents: 00040 U.S. Patent 5,812,852 00041 U.S. Patent 6,792,599 00042 U.S. Patent 7,069,556 00043 U.S. Patent 7,328,433 00044 U.S. Patent 7,500,242 00045 00046 </copyright> */ 00047 00048 /* THIS FILE SHOULD NOT BE MODIFIED IN IDB INTERFACE LIBRARY CODE 00049 * It should instead be modified in the OpenMP runtime and copied 00050 * to the interface library code. This way we can minimize the 00051 * problems that this is sure to cause having two copies of the 00052 * same file. 00053 * 00054 * files live in libomp and libomp_db/src/include 00055 */ 00056 00057 /* CHANGE THIS WHEN STRUCTURES BELOW CHANGE 00058 * Before we release this to a customer, please don't change this value. After it is released and 00059 * stable, then any new updates to the structures or data structure traversal algorithms need to 00060 * change this value. 00061 */ 00062 #define KMP_OMP_VERSION 8 00063 00064 typedef struct { 00065 kmp_int32 offset; 00066 kmp_int32 size; 00067 } offset_and_size_t; 00068 00069 typedef struct { 00070 kmp_uint64 addr; 00071 kmp_int32 size; 00072 kmp_int32 padding; 00073 } addr_and_size_t; 00074 00075 typedef struct { 00076 kmp_uint64 flags; // Flags for future extensions. 00077 kmp_uint64 file; // Pointer to name of source file where the parallel region is. 00078 kmp_uint64 func; // Pointer to name of routine where the parallel region is. 00079 kmp_int32 begin; // Beginning of source line range. 00080 kmp_int32 end; // End of source line range. 00081 kmp_int32 num_threads; // Specified number of threads. 00082 } kmp_omp_nthr_item_t; 00083 00084 typedef struct { 00085 kmp_int32 num; // Number of items in the arrray. 00086 kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t. 00087 } kmp_omp_nthr_info_t; 00088 00089 00090 /* This structure is known to the idb interface library */ 00091 typedef struct { 00092 00093 /* Change this only if you make a fundamental data structure change here */ 00094 kmp_int32 lib_version; 00095 00096 /* sanity check. Only should be checked if versions are identical 00097 * This is also used for backward compatibility to get the runtime 00098 * structure size if it the runtime is older than the interface */ 00099 kmp_int32 sizeof_this_structure; 00100 00101 /* OpenMP RTL version info. */ 00102 addr_and_size_t major; 00103 addr_and_size_t minor; 00104 addr_and_size_t build; 00105 addr_and_size_t banner; 00106 00107 /* Various globals. */ 00108 addr_and_size_t threads; // Pointer to __kmp_threads. 00109 addr_and_size_t roots; // Pointer to __kmp_root. 00110 addr_and_size_t capacity; // Pointer to __kmp_threads_capacity. 00111 addr_and_size_t monitor; // Pointer to __kmp_monitor. 00112 addr_and_size_t lock_table; // Pointer to __kmp_lock_table. 00113 addr_and_size_t func_microtask; 00114 addr_and_size_t func_fork; 00115 addr_and_size_t team_counter; 00116 addr_and_size_t task_counter; 00117 addr_and_size_t nthr_info; 00118 kmp_int32 address_width; 00119 kmp_int32 indexed_locks; 00120 kmp_int32 last_barrier; 00121 kmp_int32 deque_size; 00122 00123 /* thread structure information. */ 00124 kmp_int32 th_sizeof_struct; 00125 offset_and_size_t th_info; // descriptor for thread 00126 offset_and_size_t th_team; // team for this thread 00127 offset_and_size_t th_root; // root for this thread 00128 offset_and_size_t th_serial_team; // serial team under this thread 00129 offset_and_size_t th_ident; // location for this thread (if available) 00130 offset_and_size_t th_spin_here; // is thread waiting for lock (if available) 00131 offset_and_size_t th_next_waiting; // next thread waiting for lock (if available) 00132 offset_and_size_t th_task_team; 00133 offset_and_size_t th_current_task; 00134 offset_and_size_t th_task_state; 00135 offset_and_size_t th_bar; 00136 offset_and_size_t th_b_worker_arrived; 00137 00138 /* kmp_desc structure (for info field above) */ 00139 kmp_int32 ds_sizeof_struct; 00140 offset_and_size_t ds_tid; // team thread id 00141 offset_and_size_t ds_gtid; // global thread id 00142 offset_and_size_t ds_thread; // native thread id 00143 00144 /* team structure information */ 00145 kmp_int32 t_sizeof_struct; 00146 offset_and_size_t t_master_tid; // tid of master in parent team 00147 offset_and_size_t t_ident; // location of parallel region 00148 offset_and_size_t t_parent; // parent team 00149 offset_and_size_t t_nproc; // # team threads 00150 offset_and_size_t t_threads; // array of threads 00151 offset_and_size_t t_serialized; // # levels of serialized teams 00152 offset_and_size_t t_id; // unique team id 00153 offset_and_size_t t_pkfn; 00154 offset_and_size_t t_task_team; 00155 offset_and_size_t t_implicit_task; 00156 offset_and_size_t t_bar; 00157 offset_and_size_t t_b_master_arrived; 00158 offset_and_size_t t_b_team_arrived; 00159 00160 /* root structure information */ 00161 kmp_int32 r_sizeof_struct; 00162 offset_and_size_t r_root_team; // team at root 00163 offset_and_size_t r_hot_team; // hot team for this root 00164 offset_and_size_t r_uber_thread; // root thread 00165 offset_and_size_t r_root_id; // unique root id (if available) 00166 00167 /* ident structure information */ 00168 kmp_int32 id_sizeof_struct; 00169 offset_and_size_t id_psource; /* address of string ";file;func;line1;line2;;". */ 00170 offset_and_size_t id_flags; 00171 00172 /* lock structure information */ 00173 kmp_int32 lk_sizeof_struct; 00174 offset_and_size_t lk_initialized; 00175 offset_and_size_t lk_location; 00176 offset_and_size_t lk_tail_id; 00177 offset_and_size_t lk_head_id; 00178 offset_and_size_t lk_next_ticket; 00179 offset_and_size_t lk_now_serving; 00180 offset_and_size_t lk_owner_id; 00181 offset_and_size_t lk_depth_locked; 00182 00183 /* lock_table_t */ 00184 kmp_int32 lt_size_of_struct; /* Size and layout of kmp_lock_table_t. */ 00185 offset_and_size_t lt_used; 00186 offset_and_size_t lt_allocated; 00187 offset_and_size_t lt_table; 00188 00189 /* task_team_t */ 00190 kmp_int32 tt_sizeof_struct; 00191 offset_and_size_t tt_threads_data; 00192 offset_and_size_t tt_found_tasks; 00193 offset_and_size_t tt_nproc; 00194 offset_and_size_t tt_unfinished_threads; 00195 offset_and_size_t tt_active; 00196 offset_and_size_t tt_state; 00197 00198 /* kmp_taskdata_t */ 00199 kmp_int32 td_sizeof_struct; 00200 offset_and_size_t td_task_id; 00201 offset_and_size_t td_flags; 00202 offset_and_size_t td_team; 00203 offset_and_size_t td_parent; 00204 offset_and_size_t td_ident; 00205 offset_and_size_t td_allocated_child_tasks; 00206 offset_and_size_t td_incomplete_child_tasks; 00207 00208 /* kmp_thread_data_t */ 00209 kmp_int32 hd_sizeof_struct; 00210 offset_and_size_t hd_deque; 00211 offset_and_size_t hd_deque_head; 00212 offset_and_size_t hd_deque_tail; 00213 offset_and_size_t hd_deque_ntasks; 00214 offset_and_size_t hd_deque_last_stolen; 00215 00216 // The last field of stable version. 00217 kmp_uint64 last_field; 00218 // Extensions. 00219 // When KMP_OMP_VERSION is bumped, move these fields up to appropriate location, 00220 // to let last_field be actually last. 00221 addr_and_size_t openmp_version; 00222 offset_and_size_t td_taskwait_ident; 00223 offset_and_size_t td_taskwait_counter; 00224 offset_and_size_t td_taskwait_thread; 00225 00226 offset_and_size_t lk_lock_flags; 00227 00228 } kmp_omp_struct_info_t; 00229 00230 00231 /* end of file */