14 #ifndef OMPT_SPECIFIC_H 15 #define OMPT_SPECIFIC_H 23 typedef kmp_info_t ompt_thread_t;
29 void __ompt_team_assign_id(kmp_team_t *team, ompt_data_t ompt_pid);
30 void __ompt_thread_assign_wait_id(
void *variable);
32 void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr,
33 int gtid, ompt_data_t *ompt_pid,
void *codeptr);
35 void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr,
38 void __ompt_lw_taskteam_unlink(ompt_thread_t *thr);
40 ompt_team_info_t *__ompt_get_teaminfo(
int depth,
int *size);
42 ompt_task_info_t *__ompt_get_task_info_object(
int depth);
44 int __ompt_get_parallel_info_internal(
int ancestor_level,
45 ompt_data_t **parallel_data,
48 int __ompt_get_task_info_internal(
int ancestor_level,
int *type,
49 ompt_data_t **task_data,
50 omp_frame_t **task_frame,
51 ompt_data_t **parallel_data,
int *thread_num);
53 ompt_data_t *__ompt_get_thread_data_internal();
55 static uint64_t __ompt_get_get_unique_id_internal();
61 #define OMPT_CUR_TASK_INFO(thr) (&(thr->th.th_current_task->ompt_task_info)) 62 #define OMPT_CUR_TASK_DATA(thr) \ 63 (&(thr->th.th_current_task->ompt_task_info.task_data)) 64 #define OMPT_CUR_TEAM_INFO(thr) (&(thr->th.th_team->t.ompt_team_info)) 65 #define OMPT_CUR_TEAM_DATA(thr) \ 66 (&(thr->th.th_team->t.ompt_team_info.parallel_data)) 68 #define OMPT_HAVE_WEAK_ATTRIBUTE KMP_HAVE_WEAK_ATTRIBUTE 69 #define OMPT_HAVE_PSAPI KMP_HAVE_PSAPI 70 #define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle) 72 inline void *__ompt_load_return_address(
int gtid) {
73 kmp_info_t *thr = __kmp_threads[gtid];
74 void *return_address = thr->th.ompt_thread_info.return_address;
75 thr->th.ompt_thread_info.return_address = NULL;
76 return return_address;
79 #define OMPT_STORE_RETURN_ADDRESS(gtid) \ 80 if (ompt_enabled.enabled && gtid >= 0 && __kmp_threads[gtid] && \ 81 !__kmp_threads[gtid]->th.ompt_thread_info.return_address) \ 82 __kmp_threads[gtid]->th.ompt_thread_info.return_address = \ 83 __builtin_return_address(0) 84 #define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid) 90 inline ompt_thread_t *ompt_get_thread_gtid(
int gtid) {
91 return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL;
94 inline ompt_thread_t *ompt_get_thread() {
95 int gtid = __kmp_get_gtid();
96 return ompt_get_thread_gtid(gtid);
99 inline void ompt_set_thread_state(ompt_thread_t *thread, omp_state_t state) {
100 thread->th.ompt_thread_info.state = state;
103 inline const char *ompt_get_runtime_version() {
104 return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];