Intel® OpenMP* Runtime Library
ompt-specific.h
1 /*
2  * ompt-specific.h -- OMPT specific header file.
3  */
4 
5 /* <copyright>
6  Copyright (c) 1997-2015 Intel Corporation. All Rights Reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions
10  are met:
11 
12  * Redistributions of source code must retain the above copyright
13  notice, this list of conditions and the following disclaimer.
14  * Redistributions in binary form must reproduce the above copyright
15  notice, this list of conditions and the following disclaimer in the
16  documentation and/or other materials provided with the distribution.
17  * Neither the name of Intel Corporation nor the names of its
18  contributors may be used to endorse or promote products derived
19  from this software without specific prior written permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 </copyright> */
34 
35 #ifndef OMPT_SPECIFIC_H
36 #define OMPT_SPECIFIC_H
37 
38 #include "kmp.h"
39 
40 void __ompt_team_assign_id(kmp_team_t *team, ompt_parallel_id_t ompt_pid);
41 void __ompt_thread_assign_wait_id(void *variable);
42 
43 void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, kmp_info_t *thr,
44  int gtid, void *microtask,
45  ompt_parallel_id_t ompt_pid);
46 
47 void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, kmp_info_t *thr);
48 
49 ompt_lw_taskteam_t * __ompt_lw_taskteam_unlink(kmp_info_t *thr);
50 
51 ompt_parallel_id_t __ompt_parallel_id_new(int gtid);
52 ompt_task_id_t __ompt_task_id_new(int gtid);
53 
54 ompt_team_info_t *__ompt_get_teaminfo(int depth, int *size);
55 
56 ompt_task_info_t *__ompt_get_taskinfo(int depth);
57 
58 inline kmp_info_t *
59 ompt_get_thread_gtid(int gtid)
60 {
61  return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL;
62 }
63 
64 inline kmp_info_t *
65 ompt_get_thread()
66 {
67  int gtid = __kmp_gtid_get_specific();
68  return ompt_get_thread_gtid(gtid);
69 }
70 
71 
72 void __ompt_thread_begin(ompt_thread_type_t thread_type, int gtid);
73 
74 void __ompt_thread_end(ompt_thread_type_t thread_type, int gtid);
75 
76 
77 int __ompt_get_parallel_team_size_internal(int ancestor_level);
78 
79 ompt_task_id_t __ompt_get_task_id_internal(int depth);
80 
81 ompt_frame_t *__ompt_get_task_frame_internal(int depth);
82 
83 #endif