#include "kmp.h"
#include "kmp_error.h"
#include "kmp_i18n.h"
#include "kmp_str.h"
#define MIN_STACK …
static char const *cons_text_c[] = …;
#define get_src(ident) …
#define PUSH_MSG(ct, ident) …
#define POP_MSG(p) …
static int const cons_text_c_num = …;
static void __kmp_check_null_func(void) { … }
static void __kmp_expand_cons_stack(int gtid, struct cons_header *p) { … }
static char *__kmp_pragma(int ct, ident_t const *ident) { … }
void __kmp_error_construct(kmp_i18n_id_t id,
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
) { … }
struct cons_header *__kmp_allocate_cons_stack(int gtid) { … }
void __kmp_free_cons_stack(void *ptr) { … }
#if KMP_DEBUG
static void dump_cons_stack(int gtid, struct cons_header *p) {
int i;
int tos = p->stack_top;
kmp_str_buf_t buffer;
__kmp_str_buf_init(&buffer);
__kmp_str_buf_print(
&buffer,
"+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n");
__kmp_str_buf_print(&buffer,
"Begin construct stack with %d items for thread %d\n",
tos, gtid);
__kmp_str_buf_print(&buffer, " stack_top=%d { P=%d, W=%d, S=%d }\n", tos,
p->p_top, p->w_top, p->s_top);
for (i = tos; i > 0; i--) {
struct cons_data *c = &(p->stack_data[i]);
__kmp_str_buf_print(
&buffer, " stack_data[%2d] = { %s (%s) %d %p }\n", i,
cons_text_c[c->type], get_src(c->ident), c->prev, c->name);
}
__kmp_str_buf_print(&buffer, "End construct stack for thread %d\n", gtid);
__kmp_str_buf_print(
&buffer,
"+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n");
__kmp_debug_printf("%s", buffer.str);
__kmp_str_buf_free(&buffer);
}
#endif
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) { … }
void
#if KMP_USE_DYNAMIC_LOCK
__kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck, kmp_uint32 seq )
#else
__kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck )
#endif
{ … }
void
#if KMP_USE_DYNAMIC_LOCK
__kmp_push_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck, kmp_uint32 seq )
#else
__kmp_push_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_lock_p lck )
#endif
{ … }
void __kmp_pop_parallel(int gtid, ident_t const *ident) { … }
enum cons_type __kmp_pop_workshare(int gtid, enum cons_type ct,
ident_t const *ident) { … }
void __kmp_pop_sync(int gtid, enum cons_type ct, ident_t const *ident) { … }
void __kmp_check_barrier(int gtid, enum cons_type ct, ident_t const *ident) { … }