28 "\"ordered\" work-sharing",
41#define get_src(ident) ((ident) == NULL ? NULL : (ident)->psource)
43#define PUSH_MSG(ct, ident) \
44 "\tpushing on stack: %s (%s)\n", cons_text_c[(ct)], get_src((ident))
46 "\tpopping off stack: %s (%s)\n", cons_text_c[(p)->stack_data[tos].type], \
47 get_src((p)->stack_data[tos].ident)
68 p->stack_size = (
p->stack_size * 2) + 100;
74 for (
i =
p->stack_top;
i >= 0; --
i)
75 p->stack_data[
i] =
d[
i];
82 char const *cons = NULL;
140 KE_TRACE(10, (
"allocate cons_stack (%d)\n", gtid));
142 p->p_top =
p->w_top =
p->s_top = 0;
148 p->stack_data[0].prev = 0;
149 p->stack_data[0].ident = NULL;
156 if (
p->stack_data != NULL) {
158 p->stack_data = NULL;
165static void dump_cons_stack(
int gtid,
struct cons_header *
p) {
167 int tos =
p->stack_top;
172 "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n");
174 "Begin construct stack with %d items for thread %d\n",
177 p->p_top,
p->w_top,
p->s_top);
178 for (
i = tos;
i > 0;
i--) {
181 &buffer,
" stack_data[%2d] = { %s (%s) %d %p }\n",
i,
187 "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n");
200 if (
p->stack_top >=
p->stack_size) {
203 tos = ++
p->stack_top;
205 p->stack_data[tos].prev =
p->p_top;
206 p->stack_data[tos].ident =
ident;
207 p->stack_data[tos].name = NULL;
209 KE_DUMP(1000, dump_cons_stack(gtid,
p));
218 if (
p->stack_top >=
p->stack_size) {
221 if (
p->w_top >
p->p_top) {
224 &
p->stack_data[
p->w_top]);
226 if (
p->s_top >
p->p_top) {
229 &
p->stack_data[
p->s_top]);
239 tos = ++
p->stack_top;
240 p->stack_data[tos].type = ct;
241 p->stack_data[tos].prev =
p->w_top;
242 p->stack_data[tos].ident =
ident;
243 p->stack_data[tos].name = NULL;
245 KE_DUMP(1000, dump_cons_stack(gtid,
p));
249#if KMP_USE_DYNAMIC_LOCK
259 if (
p->stack_top >=
p->stack_size)
263 if (
p->w_top <=
p->p_top) {
265#ifdef BUILD_PARALLEL_ORDERED
275 &
p->stack_data[
p->w_top]);
278 if (
p->s_top >
p->p_top &&
p->s_top >
p->w_top) {
280 int index =
p->s_top;
283 stack_type =
p->stack_data[index].type;
289 p->stack_data[index].ident != NULL &&
293 &
p->stack_data[index]);
297#if KMP_USE_DYNAMIC_LOCK
306 int index =
p->s_top;
309 while (index != 0 &&
p->stack_data[index].name !=
lck) {
310 index =
p->stack_data[index].prev;
315 cons =
p->stack_data[index];
321 if (
p->w_top >
p->p_top) {
324 &
p->stack_data[
p->w_top]);
329 &
p->stack_data[
p->s_top]);
335#if KMP_USE_DYNAMIC_LOCK
345 KE_TRACE(10, (
"__kmp_push_sync (gtid=%d)\n", gtid));
346#if KMP_USE_DYNAMIC_LOCK
352 tos = ++
p->stack_top;
353 p->stack_data[tos].type = ct;
354 p->stack_data[tos].prev =
p->s_top;
355 p->stack_data[tos].ident =
ident;
356 p->stack_data[tos].name =
lck;
358 KE_DUMP(1000, dump_cons_stack(gtid,
p));
368 if (tos == 0 ||
p->p_top == 0) {
371 if (tos !=
p->p_top ||
p->stack_data[tos].type !=
ct_parallel) {
373 &
p->stack_data[tos]);
376 p->p_top =
p->stack_data[tos].prev;
378 p->stack_data[tos].ident = NULL;
379 p->stack_top = tos - 1;
380 KE_DUMP(1000, dump_cons_stack(gtid,
p));
390 if (tos == 0 ||
p->w_top == 0) {
394 if (tos !=
p->w_top ||
395 (
p->stack_data[tos].type != ct &&
400 &
p->stack_data[tos]);
403 p->w_top =
p->stack_data[tos].prev;
405 p->stack_data[tos].ident = NULL;
406 p->stack_top = tos - 1;
407 KE_DUMP(1000, dump_cons_stack(gtid,
p));
408 return p->stack_data[
p->w_top].type;
416 if (tos == 0 ||
p->s_top == 0) {
419 if (tos !=
p->s_top ||
p->stack_data[tos].type != ct) {
422 &
p->stack_data[tos]);
425 p->s_top =
p->stack_data[tos].prev;
427 p->stack_data[tos].ident = NULL;
428 p->stack_top = tos - 1;
429 KE_DUMP(1000, dump_cons_stack(gtid,
p));
436 KE_TRACE(10, (
"__kmp_check_barrier (loc: %p, gtid: %d %d)\n",
ident, gtid,
441 if (
p->w_top >
p->p_top) {
444 &
p->stack_data[
p->w_top]);
446 if (
p->s_top >
p->p_top) {
449 &
p->stack_data[
p->s_top]);
@ KMP_IDENT_KMPC
Use c-style ident structure.
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d
void const char const char int ITT_FORMAT __itt_group_sync p
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id tail
kmp_info_t ** __kmp_threads
#define __kmp_allocate(size)
#define KMP_INTERNAL_FREE(p)
#define IS_CONS_TYPE_ORDERED(ct)
void __kmp_debug_printf(char const *format,...)
#define KMP_DEBUG_ASSERT(cond)
static void __kmp_check_null_func(void)
#define PUSH_MSG(ct, ident)
void __kmp_push_sync(int gtid, enum cons_type ct, ident_t const *ident, kmp_user_lock_p lck)
void __kmp_push_parallel(int gtid, ident_t const *ident)
void __kmp_check_workshare(int gtid, enum cons_type ct, ident_t const *ident)
void __kmp_push_workshare(int gtid, enum cons_type ct, ident_t const *ident)
static void __kmp_expand_cons_stack(int gtid, struct cons_header *p)
void __kmp_check_sync(int gtid, enum cons_type ct, ident_t const *ident, kmp_user_lock_p lck)
static int const cons_text_c_num
enum cons_type __kmp_pop_workshare(int gtid, enum cons_type ct, ident_t const *ident)
void __kmp_error_construct(kmp_i18n_id_t id, enum cons_type ct, ident_t const *ident)
static char const * cons_text_c[]
void __kmp_pop_sync(int gtid, enum cons_type ct, ident_t const *ident)
void __kmp_error_construct2(kmp_i18n_id_t id, enum cons_type ct, ident_t const *ident, struct cons_data const *cons)
void __kmp_check_barrier(int gtid, enum cons_type ct, ident_t const *ident)
struct cons_header * __kmp_allocate_cons_stack(int gtid)
void __kmp_pop_parallel(int gtid, ident_t const *ident)
static char * __kmp_pragma(int ct, ident_t const *ident)
void __kmp_free_cons_stack(void *ptr)
kmp_msg_t __kmp_msg_format(unsigned id_arg,...)
void __kmp_fatal(kmp_msg_t message,...)
static kmp_int32 __kmp_get_user_lock_owner(kmp_user_lock_p lck)
void __kmp_str_split(char *str, char delim, char **head, char **tail)
void __kmp_str_buf_free(kmp_str_buf_t *buffer)
int __kmp_str_buf_print(kmp_str_buf_t *buffer, char const *format,...)
#define __kmp_str_buf_init(b)
The ident structure that describes a source location.
char const * psource
String describing the source location.