LLVM OpenMP 20.0.0git
|
#include "kmp_utils.h"
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ompt-specific.cpp"
Go to the source code of this file.
Classes | |
struct | ompt_state_info_t |
struct | kmp_mutex_impl_info_t |
Macros | |
#define | ompt_get_callback_success 1 |
#define | ompt_get_callback_failure 0 |
#define | no_tool_present 0 |
#define | OMPT_API_ROUTINE static |
#define | OMPT_STR_MATCH(haystack, needle) (!strcasecmp(haystack, needle)) |
#define | OMPT_VERBOSE_INIT_PRINT(...) |
#define | OMPT_VERBOSE_INIT_CONTINUED_PRINT(...) |
#define | ompt_state_macro(state, code) {#state, state}, |
#define | kmp_mutex_impl_macro(name, id) {#name, name}, |
#define | OMPT_DLCLOSE(Lib) dlclose(Lib) |
#define | ompt_event_macro(event_name, callback_type, event_id) |
#define | ompt_event_macro(event_name, callback_type, event_id) |
#define | ompt_interface_fn(fn) |
#define | provide_fn(fn) |
#define | ompt_interface_fn(fn, type, code) |
Typedefs | |
typedef ompt_start_tool_result_t *(* | ompt_start_tool_t) (unsigned int, const char *) |
Enumerations | |
enum | tool_setting_e { omp_tool_error , omp_tool_unset , omp_tool_disabled , omp_tool_enabled } |
Functions | |
static ompt_interface_fn_t | ompt_fn_lookup (const char *s) |
OMPT_API_ROUTINE ompt_data_t * | ompt_get_thread_data (void) |
static ompt_start_tool_result_t * | ompt_try_start_tool (unsigned int omp_version, const char *runtime_version) |
if (ret) | |
OMPT_VERBOSE_INIT_PRINT ("No OMP tool loaded.\n") | |
OMPT_VERBOSE_INIT_PRINT ("----- END LOGGING OF TOOL REGISTRATION -----\n") | |
void | ompt_pre_init () |
int | omp_get_initial_device (void) |
void | ompt_post_init () |
void | ompt_fini () |
OMPT_API_ROUTINE int | ompt_enumerate_states (int current_state, int *next_state, const char **next_state_name) |
OMPT_API_ROUTINE int | ompt_enumerate_mutex_impls (int current_impl, int *next_impl, const char **next_impl_name) |
OMPT_API_ROUTINE ompt_set_result_t | ompt_set_callback (ompt_callbacks_t which, ompt_callback_t callback) |
OMPT_API_ROUTINE int | ompt_get_callback (ompt_callbacks_t which, ompt_callback_t *callback) |
OMPT_API_ROUTINE int | ompt_get_parallel_info (int ancestor_level, ompt_data_t **parallel_data, int *team_size) |
OMPT_API_ROUTINE int | ompt_get_state (ompt_wait_id_t *wait_id) |
OMPT_API_ROUTINE int | ompt_get_task_info (int ancestor_level, int *type, ompt_data_t **task_data, ompt_frame_t **task_frame, ompt_data_t **parallel_data, int *thread_num) |
OMPT_API_ROUTINE int | ompt_get_task_memory (void **addr, size_t *size, int block) |
OMPT_API_ROUTINE int | ompt_get_num_procs (void) |
OMPT_API_ROUTINE int | ompt_get_num_places (void) |
OMPT_API_ROUTINE int | ompt_get_place_proc_ids (int place_num, int ids_size, int *ids) |
OMPT_API_ROUTINE int | ompt_get_place_num (void) |
OMPT_API_ROUTINE int | ompt_get_partition_place_nums (int place_nums_size, int *place_nums) |
OMPT_API_ROUTINE int | ompt_get_proc_id (void) |
int | __kmp_control_tool (uint64_t command, uint64_t modifier, void *arg) |
OMPT_API_ROUTINE uint64_t | ompt_get_unique_id (void) |
OMPT_API_ROUTINE void | ompt_finalize_tool (void) |
OMPT_API_ROUTINE int | ompt_get_target_info (uint64_t *device_num, ompt_id_t *target_id, ompt_id_t *host_op_id) |
OMPT_API_ROUTINE int | ompt_get_num_devices (void) |
static ompt_data_t * | ompt_get_task_data () |
static ompt_data_t * | ompt_get_target_task_data () |
static ompt_interface_fn_t | ompt_libomp_target_fn_lookup (const char *s) |
Lookup function to query libomp callbacks registered by the tool. | |
_OMP_EXTERN void | ompt_libomp_connect (ompt_start_tool_result_t *result) |
This function is called by the libomptarget connector to assign callbacks already registered with libomp. | |
Variables | |
static FILE * | verbose_file |
static int | verbose_init |
ompt_callbacks_active_t | ompt_enabled |
ompt_state_info_t | ompt_state_info [] |
kmp_mutex_impl_info_t | kmp_mutex_impl_info [] |
ompt_callbacks_internal_t | ompt_callbacks |
static ompt_start_tool_result_t * | ompt_start_tool_result = NULL |
static void * | ompt_tool_module = NULL |
static void * | ompt_archer_module = NULL |
static ompt_start_tool_result_t * | libomptarget_ompt_result = NULL |
Used to track the initializer and the finalizer provided by libomptarget. | |
else | |
return | ret |
#define no_tool_present 0 |
Definition at line 41 of file ompt-general.cpp.
#define OMPT_API_ROUTINE static |
Definition at line 43 of file ompt-general.cpp.
#define OMPT_DLCLOSE | ( | Lib | ) | dlclose(Lib) |
Definition at line 113 of file ompt-general.cpp.
#define ompt_event_macro | ( | event_name, | |
callback_type, | |||
event_id | |||
) |
#define ompt_event_macro | ( | event_name, | |
callback_type, | |||
event_id | |||
) |
#define ompt_get_callback_failure 0 |
Definition at line 39 of file ompt-general.cpp.
#define ompt_get_callback_success 1 |
Definition at line 38 of file ompt-general.cpp.
#define ompt_interface_fn | ( | fn | ) |
#define ompt_state_macro | ( | state, | |
code | |||
) | {#state, state}, |
#define OMPT_STR_MATCH | ( | haystack, | |
needle | |||
) | (!strcasecmp(haystack, needle)) |
Definition at line 46 of file ompt-general.cpp.
#define OMPT_VERBOSE_INIT_CONTINUED_PRINT | ( | ... | ) |
Definition at line 56 of file ompt-general.cpp.
#define OMPT_VERBOSE_INIT_PRINT | ( | ... | ) |
Definition at line 53 of file ompt-general.cpp.
typedef ompt_start_tool_result_t *(* ompt_start_tool_t) (unsigned int, const char *) |
Definition at line 131 of file ompt-general.cpp.
enum tool_setting_e |
Enumerator | |
---|---|
omp_tool_error | |
omp_tool_unset | |
omp_tool_disabled | |
omp_tool_enabled |
Definition at line 77 of file ompt-general.cpp.
Definition at line 832 of file ompt-general.cpp.
References __kmp_entry_gtid, ompt_callbacks_active_s::enabled, ompt_callbacks, and ompt_enabled.
Referenced by FTN_CONTROL_TOOL().
if | ( | ret | ) |
Definition at line 356 of file ompt-general.cpp.
References OMPT_VERBOSE_INIT_PRINT, and ret.
Referenced by __kmp_allocate_thread(), __kmp_dispatch_init_algorithm(), __kmp_fork_barrier(), __kmp_fork_call(), __kmp_get_global_thread_id(), __kmp_hierarchical_barrier_gather(), __kmp_is_address_mapped(), __kmp_join_call(), __kmpc_end_taskgroup(), and proc_bind_check().
Referenced by main(), ompt_post_init(), and test_omp_pause_resource().
OMPT_API_ROUTINE int ompt_enumerate_mutex_impls | ( | int | current_impl, |
int * | next_impl, | ||
const char ** | next_impl_name | ||
) |
Definition at line 560 of file ompt-general.cpp.
References i, kmp_mutex_impl_info_t::id, kmp_mutex_impl_info, and kmp_mutex_impl_info_t::name.
OMPT_API_ROUTINE int ompt_enumerate_states | ( | int | current_state, |
int * | next_state, | ||
const char ** | next_state_name | ||
) |
Definition at line 544 of file ompt-general.cpp.
References i, ompt_state_info, ompt_state_info_t::state_id, and ompt_state_info_t::state_name.
OMPT_API_ROUTINE void ompt_finalize_tool | ( | void | ) |
Definition at line 854 of file ompt-general.cpp.
References __kmp_internal_end_atexit().
Definition at line 519 of file ompt-general.cpp.
References ompt_callbacks_active_s::enabled, libomptarget_ompt_result, ompt_archer_module, OMPT_DLCLOSE, ompt_enabled, ompt_start_tool_result, and ompt_tool_module.
Referenced by __kmp_internal_end().
|
static |
Definition at line 874 of file ompt-general.cpp.
References ompt_interface_fn.
Referenced by ompt_post_init().
OMPT_API_ROUTINE int ompt_get_callback | ( | ompt_callbacks_t | which, |
ompt_callback_t * | callback | ||
) |
Definition at line 602 of file ompt-general.cpp.
References ompt_callbacks_active_s::enabled, ompt_enabled, ompt_event_macro, and ompt_get_callback_failure.
OMPT_API_ROUTINE int ompt_get_num_devices | ( | void | ) |
Definition at line 866 of file ompt-general.cpp.
OMPT_API_ROUTINE int ompt_get_num_places | ( | void | ) |
Definition at line 694 of file ompt-general.cpp.
OMPT_API_ROUTINE int ompt_get_num_procs | ( | void | ) |
Definition at line 684 of file ompt-general.cpp.
References __kmp_avail_proc.
OMPT_API_ROUTINE int ompt_get_parallel_info | ( | int | ancestor_level, |
ompt_data_t ** | parallel_data, | ||
int * | team_size | ||
) |
Definition at line 633 of file ompt-general.cpp.
References __ompt_get_parallel_info_internal(), ompt_callbacks_active_s::enabled, and ompt_enabled.
OMPT_API_ROUTINE int ompt_get_partition_place_nums | ( | int | place_nums_size, |
int * | place_nums | ||
) |
Definition at line 761 of file ompt-general.cpp.
References __kmp_entry_gtid, __kmp_get_gtid, __kmp_thread_from_gtid(), ompt_callbacks_active_s::enabled, end, i, and ompt_enabled.
OMPT_API_ROUTINE int ompt_get_place_num | ( | void | ) |
Definition at line 741 of file ompt-general.cpp.
References __kmp_entry_gtid, __kmp_get_gtid, __kmp_thread_from_gtid(), ompt_callbacks_active_s::enabled, and ompt_enabled.
OMPT_API_ROUTINE int ompt_get_place_proc_ids | ( | int | place_num, |
int | ids_size, | ||
int * | ids | ||
) |
OMPT_API_ROUTINE int ompt_get_proc_id | ( | void | ) |
Definition at line 801 of file ompt-general.cpp.
References __kmp_get_gtid, ompt_callbacks_active_s::enabled, and ompt_enabled.
OMPT_API_ROUTINE int ompt_get_state | ( | ompt_wait_id_t * | wait_id | ) |
Definition at line 642 of file ompt-general.cpp.
References __ompt_get_state_internal(), ompt_callbacks_active_s::enabled, and ompt_enabled.
OMPT_API_ROUTINE int ompt_get_target_info | ( | uint64_t * | device_num, |
ompt_id_t * | target_id, | ||
ompt_id_t * | host_op_id | ||
) |
Definition at line 860 of file ompt-general.cpp.
|
static |
Definition at line 890 of file ompt-general.cpp.
References __ompt_get_target_task_data().
Referenced by ompt_libomp_target_fn_lookup().
|
static |
Definition at line 888 of file ompt-general.cpp.
References __ompt_get_task_data().
Referenced by ompt_libomp_target_fn_lookup().
OMPT_API_ROUTINE int ompt_get_task_info | ( | int | ancestor_level, |
int * | type, | ||
ompt_data_t ** | task_data, | ||
ompt_frame_t ** | task_frame, | ||
ompt_data_t ** | parallel_data, | ||
int * | thread_num | ||
) |
Definition at line 664 of file ompt-general.cpp.
References __ompt_get_task_info_internal(), ompt_callbacks_active_s::enabled, ompt_enabled, and type.
OMPT_API_ROUTINE int ompt_get_task_memory | ( | void ** | addr, |
size_t * | size, | ||
int | block | ||
) |
Definition at line 675 of file ompt-general.cpp.
References __ompt_get_task_memory_internal(), addr, and size.
OMPT_API_ROUTINE ompt_data_t * ompt_get_thread_data | ( | void | ) |
Definition at line 658 of file ompt-general.cpp.
References __ompt_get_thread_data_internal(), ompt_callbacks_active_s::enabled, and ompt_enabled.
OMPT_API_ROUTINE uint64_t ompt_get_unique_id | ( | void | ) |
Definition at line 850 of file ompt-general.cpp.
References __ompt_get_unique_id_internal().
_OMP_EXTERN void ompt_libomp_connect | ( | ompt_start_tool_result_t * | result | ) |
This function is called by the libomptarget connector to assign callbacks already registered with libomp.
Definition at line 919 of file ompt-general.cpp.
References __ompt_force_initialization(), ompt_callbacks_active_s::enabled, libomptarget_ompt_result, ompt_enabled, ompt_libomp_target_fn_lookup(), OMPT_VERBOSE_INIT_PRINT, and result.
|
static |
Lookup function to query libomp callbacks registered by the tool.
Definition at line 895 of file ompt-general.cpp.
References ompt_get_callback, ompt_get_target_task_data(), ompt_get_task_data(), ompt_interface_fn, and provide_fn.
Referenced by ompt_libomp_connect().
Definition at line 473 of file ompt-general.cpp.
References __ompt_get_task_info_internal(), __ompt_get_thread_data_internal(), ompt_callbacks_active_s::enabled, omp_get_initial_device(), ompt_callbacks, ompt_enabled, ompt_fn_lookup(), and ompt_start_tool_result.
Referenced by __kmp_do_serial_initialize().
Definition at line 397 of file ompt-general.cpp.
References __kmp_openmp_version, ompt_callbacks_active_s::enabled, omp_tool_disabled, omp_tool_enabled, omp_tool_error, omp_tool_unset, ompt_enabled, ompt_start_tool_result, OMPT_STR_MATCH, ompt_try_start_tool(), OMPT_VERBOSE_INIT_PRINT, verbose_file, and verbose_init.
Referenced by __kmp_do_serial_initialize().
OMPT_API_ROUTINE ompt_set_result_t ompt_set_callback | ( | ompt_callbacks_t | which, |
ompt_callback_t | callback | ||
) |
Definition at line 580 of file ompt-general.cpp.
References ompt_event_macro.
|
static |
Definition at line 251 of file ompt-general.cpp.
References __kmp_str_format(), __kmp_str_free(), __kmp_str_token(), buf, h, OMPT_DLCLOSE, ompt_start_tool, ompt_tool_module, OMPT_VERBOSE_INIT_CONTINUED_PRINT, OMPT_VERBOSE_INIT_PRINT, and ret.
Referenced by ompt_pre_init().
OMPT_VERBOSE_INIT_PRINT | ( | "----- END LOGGING OF TOOL REGISTRATION -----\n" | ) |
OMPT_VERBOSE_INIT_PRINT | ( | "No OMP tool loaded.\n" | ) |
else |
Definition at line 351 of file ompt-general.cpp.
kmp_mutex_impl_info_t kmp_mutex_impl_info[] |
Definition at line 96 of file ompt-general.cpp.
Referenced by ompt_enumerate_mutex_impls().
|
static |
Used to track the initializer and the finalizer provided by libomptarget.
Definition at line 117 of file ompt-general.cpp.
Referenced by ompt_fini(), and ompt_libomp_connect().
|
static |
Definition at line 112 of file ompt-general.cpp.
Referenced by ompt_fini().
ompt_callbacks_internal_t ompt_callbacks |
Definition at line 102 of file ompt-general.cpp.
Referenced by __kmp_acquire_atomic_lock(), __kmp_barrier_template(), __kmp_control_tool(), __kmp_dispatch_init(), __kmp_dist_for_static_init(), __kmp_for_static_init(), __kmp_fork_barrier(), __kmp_fork_call(), __kmp_fork_in_teams(), __kmp_GOMP_fork_call(), __kmp_internal_join(), __kmp_invoke_task(), __kmp_invoke_task_func(), __kmp_invoke_teams_master(), __kmp_join_barrier(), __kmp_join_call(), __kmp_launch_thread(), __kmp_omp_taskloop_task(), __kmp_register_root(), __kmp_release_atomic_lock(), __kmp_reset_root(), __kmp_serial_fork_call(), __kmp_serialized_parallel(), __kmp_taskloop(), __kmp_track_dependence(), __kmpc_cancel(), __kmpc_cancellationpoint(), __kmpc_critical(), __kmpc_destroy_lock(), __kmpc_destroy_nest_lock(), __kmpc_doacross_post(), __kmpc_doacross_wait(), __kmpc_end_critical(), __kmpc_end_masked(), __kmpc_end_master(), __kmpc_end_ordered(), __kmpc_end_scope(), __kmpc_end_sections(), __kmpc_end_serialized_parallel(), __kmpc_end_single(), __kmpc_end_taskgroup(), __kmpc_error(), __kmpc_flush(), __kmpc_for_static_fini(), __kmpc_init_lock(), __kmpc_init_nest_lock(), __kmpc_masked(), __kmpc_master(), __kmpc_next_section(), __kmpc_omp_task(), __kmpc_omp_task_begin_if0_template(), __kmpc_omp_task_parts(), __kmpc_omp_task_with_deps(), __kmpc_omp_taskwait_deps_51(), __kmpc_omp_taskwait_template(), __kmpc_ordered(), __kmpc_scope(), __kmpc_sections_init(), __kmpc_set_lock(), __kmpc_set_nest_lock(), __kmpc_single(), __kmpc_taskgroup(), __kmpc_test_lock(), __kmpc_test_nest_lock(), __kmpc_unset_lock(), __kmpc_unset_nest_lock(), KMP_API_NAME_GOMP_SINGLE_START(), and ompt_post_init().
ompt_callbacks_active_t ompt_enabled |
Definition at line 88 of file ompt-general.cpp.
Referenced by __kmp_acquire_atomic_lock(), __kmp_acquire_queuing_lock_timed_template(), __kmp_barrier_template(), __kmp_control_tool(), __kmp_dispatch_init(), __kmp_dist_for_static_init(), __kmp_for_static_init(), __kmp_fork_barrier(), __kmp_fork_call(), __kmp_fork_in_teams(), __kmp_fulfill_event(), __kmp_GOMP_fork_call(), __kmp_GOMP_microtask_wrapper(), __kmp_GOMP_par_reductions_microtask_wrapper(), __kmp_GOMP_parallel_microtask_wrapper(), __kmp_init_implicit_task(), __kmp_internal_join(), __kmp_invoke_task(), __kmp_invoke_task_func(), __kmp_invoke_teams_master(), __kmp_join_barrier(), __kmp_join_call(), __kmp_launch_thread(), __kmp_omp_taskloop_task(), __kmp_register_root(), __kmp_release_atomic_lock(), __kmp_reset_root(), __kmp_serial_fork_call(), __kmp_serialized_parallel(), __kmp_task_alloc(), __kmp_task_dup_alloc(), __kmp_taskloop(), __kmp_taskloop_linear(), __kmp_track_dependence(), __kmp_wait_template(), __kmpc_barrier(), __kmpc_barrier_master(), __kmpc_barrier_master_nowait(), __kmpc_cancel(), __kmpc_cancellationpoint(), __kmpc_copyprivate(), __kmpc_copyprivate_light(), __kmpc_critical(), __kmpc_destroy_lock(), __kmpc_destroy_nest_lock(), __kmpc_doacross_post(), __kmpc_doacross_wait(), __kmpc_end(), __kmpc_end_critical(), __kmpc_end_masked(), __kmpc_end_master(), __kmpc_end_ordered(), __kmpc_end_reduce(), __kmpc_end_scope(), __kmpc_end_sections(), __kmpc_end_serialized_parallel(), __kmpc_end_single(), __kmpc_end_taskgroup(), __kmpc_error(), __kmpc_flush(), __kmpc_for_static_fini(), __kmpc_fork_call(), __kmpc_fork_teams(), __kmpc_init_lock(), __kmpc_init_nest_lock(), __kmpc_masked(), __kmpc_master(), __kmpc_next_section(), __kmpc_omp_task(), __kmpc_omp_task_begin_if0(), __kmpc_omp_task_begin_if0_template(), __kmpc_omp_task_complete_if0(), __kmpc_omp_task_parts(), __kmpc_omp_task_with_deps(), __kmpc_omp_taskwait(), __kmpc_omp_taskwait_deps_51(), __kmpc_omp_taskwait_template(), __kmpc_omp_taskyield(), __kmpc_ordered(), __kmpc_reduce(), __kmpc_reduce_nowait(), __kmpc_scope(), __kmpc_sections_init(), __kmpc_set_lock(), __kmpc_set_nest_lock(), __kmpc_single(), __kmpc_taskgroup(), __kmpc_test_lock(), __kmpc_test_nest_lock(), __kmpc_unset_lock(), __kmpc_unset_nest_lock(), KMP_API_NAME_GOMP_BARRIER(), KMP_API_NAME_GOMP_PARALLEL_END(), KMP_API_NAME_GOMP_PARALLEL_START(), KMP_API_NAME_GOMP_SINGLE_COPY_END(), KMP_API_NAME_GOMP_SINGLE_COPY_START(), KMP_API_NAME_GOMP_SINGLE_START(), ompt_fini(), ompt_get_callback(), ompt_get_parallel_info(), ompt_get_partition_place_nums(), ompt_get_place_num(), ompt_get_proc_id(), ompt_get_state(), ompt_get_task_info(), ompt_get_thread_data(), ompt_libomp_connect(), ompt_post_init(), and ompt_pre_init().
|
static |
Definition at line 104 of file ompt-general.cpp.
Referenced by ompt_fini(), ompt_post_init(), ompt_pre_init(), and ompt_start_tool().
ompt_state_info_t ompt_state_info[] |
Definition at line 90 of file ompt-general.cpp.
Referenced by ompt_enumerate_states().
|
static |
Definition at line 111 of file ompt-general.cpp.
Referenced by ompt_fini(), and ompt_try_start_tool().
return ret |
Definition at line 394 of file ompt-general.cpp.
Referenced by __kmp_lock_block_allocate(), __kmp_runtime_initialize(), __kmp_track_children_task(), __kmpc_barrier_master_nowait(), __kmpc_cancel_barrier(), __kmpc_omp_task_with_deps(), __kmpc_threadprivate(), __kmpc_threadprivate_cached(), kmp_flag_oncore::execute_tasks(), foo(), FTN_CONTROL_TOOL(), if(), main(), my_next_id(), ompt_multiplex_client_get_parallel_info(), ompt_multiplex_client_get_task_info(), ompt_multiplex_client_get_thread_data(), ompt_multiplex_own_get_parallel_info(), ompt_multiplex_own_get_task_info(), ompt_multiplex_own_get_thread_data(), ompt_try_start_tool(), ompt_tsan_dependences(), and outlined().
|
static |
Definition at line 60 of file ompt-general.cpp.
Referenced by ompt_pre_init().
|
static |
Definition at line 61 of file ompt-general.cpp.
Referenced by ompt_pre_init().