|
LLVM OpenMP 22.0.0git
|
#include <algorithm>#include <atomic>#include <cassert>#include <cstdlib>#include <cstring>#include <dlfcn.h>#include <inttypes.h>#include <iostream>#include <list>#include <mutex>#include <sstream>#include <string>#include <sys/resource.h>#include <unistd.h>#include <unordered_map>#include <vector>#include "omp-tools.h"Go to the source code of this file.
Macros | |
| #define | __STDC_FORMAT_MACROS |
| #define | KMP_FALLTHROUGH() |
| #define | DECLARE_TSAN_FUNCTION(name, ...) |
| #define | TsanHappensBefore(cv) |
| #define | TsanHappensAfter(cv) |
| #define | TsanIgnoreWritesBegin() |
| #define | TsanIgnoreWritesEnd() |
| #define | TsanDeleteClock(cv) |
| #define | TsanNewMemory(addr, size) |
| #define | TsanFreeMemory(addr, size) |
| #define | TsanFuncEntry(pc) |
| #define | TsanFuncExit() |
| #define | SET_OPTIONAL_CALLBACK_T(event, type, result, level) |
| #define | SET_CALLBACK_T(event, type) |
| #define | SET_CALLBACK(event) |
| #define | findTsanFunction(f, fSig) |
| #define | findTsanFunctionSilent(f, fSig) |
Typedefs | |
| typedef char | ompt_tsan_clockid |
Functions | |
| template<typename... Args> | |
| static void | __ompt_tsan_func (Args...) |
| DECLARE_TSAN_FUNCTION (AnnotateHappensAfter, const char *, int, const volatile void *) DECLARE_TSAN_FUNCTION(AnnotateHappensBefore | |
| const char const volatile void * | DECLARE_TSAN_FUNCTION (AnnotateNewMemory, const char *, int, const volatile void *, size_t) } static ompt_get_parallel_info_t ompt_get_parallel_info |
| Required OMPT inquiry functions. | |
| static uint64_t | my_next_id () |
| static TaskData * | ToTaskData (ompt_data_t *task_data) |
| static void | ompt_tsan_thread_begin (ompt_thread_t thread_type, ompt_data_t *thread_data) |
| static void | ompt_tsan_thread_end (ompt_data_t *thread_data) |
| static void | ompt_tsan_parallel_begin (ompt_data_t *parent_task_data, const ompt_frame_t *parent_task_frame, ompt_data_t *parallel_data, uint32_t requested_team_size, int flag, const void *codeptr_ra) |
| OMPT event callbacks for handling parallel regions. | |
| static void | ompt_tsan_parallel_end (ompt_data_t *parallel_data, ompt_data_t *task_data, int flag, const void *codeptr_ra) |
| static void | ompt_tsan_implicit_task (ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, unsigned int team_size, unsigned int thread_num, int type) |
| static void | ompt_tsan_sync_region (ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) |
| static void | ompt_tsan_reduction (ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) |
| static void | ompt_tsan_task_create (ompt_data_t *parent_task_data, const ompt_frame_t *parent_frame, ompt_data_t *new_task_data, int type, int has_dependences, const void *codeptr_ra) |
| OMPT event callbacks for handling tasks. | |
| static void | freeTask (TaskData *task) |
| static void | releaseDependencies (TaskData *task) |
| static void | acquireDependencies (TaskData *task) |
| static void | completeTask (TaskData *FromTask) |
| static void | suspendTask (TaskData *FromTask) |
| static void | switchTasks (TaskData *FromTask, TaskData *ToTask) |
| static void | endTask (TaskData *FromTask) |
| static void | startTask (TaskData *ToTask) |
| static void | ompt_tsan_task_schedule (ompt_data_t *first_task_data, ompt_task_status_t prior_task_status, ompt_data_t *second_task_data) |
| static void | ompt_tsan_dependences (ompt_data_t *task_data, const ompt_dependence_t *deps, int ndeps) |
| static void | ompt_tsan_mutex_acquired (ompt_mutex_t kind, ompt_wait_id_t wait_id, const void *codeptr_ra) |
| OMPT event callbacks for handling locking. | |
| static void | ompt_tsan_mutex_released (ompt_mutex_t kind, ompt_wait_id_t wait_id, const void *codeptr_ra) |
| static int | ompt_tsan_initialize (ompt_function_lookup_t lookup, int device_num, ompt_data_t *tool_data) |
| static void | ompt_tsan_finalize (ompt_data_t *tool_data) |
| ompt_start_tool_result_t * | ompt_start_tool (unsigned int omp_version, const char *runtime_version) |
Variables | |
| static int | hasReductionCallback |
| static ArcherFlags * | archer_flags |
| const char | int |
| static ompt_get_thread_data_t | ompt_get_thread_data |
| static int | pagesize {0} |
| static std::unordered_map< ompt_wait_id_t, std::mutex > | Locks |
| Store a mutex for each wait_id to resolve race condition with callbacks. | |
| static std::mutex | LocksMutex |
| #define __STDC_FORMAT_MACROS |
Definition at line 14 of file ompt-tsan.cpp.
| #define DECLARE_TSAN_FUNCTION | ( | name, | |
| ... ) |
| #define findTsanFunction | ( | f, | |
| fSig ) |
Definition at line 1150 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize().
| #define findTsanFunctionSilent | ( | f, | |
| fSig ) |
Definition at line 1159 of file ompt-tsan.cpp.
Referenced by ompt_start_tool().
| #define KMP_FALLTHROUGH | ( | ) |
| #define SET_CALLBACK | ( | event | ) |
Definition at line 1148 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize().
Definition at line 1142 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize().
Definition at line 1131 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize().
| #define TsanDeleteClock | ( | cv | ) |
| #define TsanFuncEntry | ( | pc | ) |
Referenced by ompt_tsan_implicit_task(), and ompt_tsan_sync_region().
| #define TsanFuncExit | ( | ) |
Referenced by ompt_tsan_implicit_task(), and ompt_tsan_sync_region().
| #define TsanHappensAfter | ( | cv | ) |
Referenced by acquireDependencies(), completeTask(), ompt_tsan_implicit_task(), ompt_tsan_mutex_acquired(), ompt_tsan_parallel_end(), ompt_tsan_sync_region(), ompt_tsan_task_schedule(), and startTask().
| #define TsanHappensBefore | ( | cv | ) |
Referenced by completeTask(), ompt_tsan_dependences(), ompt_tsan_mutex_released(), ompt_tsan_parallel_begin(), ompt_tsan_sync_region(), ompt_tsan_task_create(), ompt_tsan_task_schedule(), releaseDependencies(), and suspendTask().
| #define TsanIgnoreWritesBegin | ( | ) |
Referenced by ompt_tsan_initialize(), ompt_tsan_parallel_end(), ompt_tsan_reduction(), ompt_tsan_sync_region(), ompt_tsan_thread_end(), and switchTasks().
| #define TsanIgnoreWritesEnd | ( | ) |
Referenced by ompt_tsan_finalize(), ompt_tsan_parallel_begin(), ompt_tsan_reduction(), ompt_tsan_sync_region(), ompt_tsan_thread_end(), and switchTasks().
Referenced by ompt_tsan_thread_begin().
| typedef char ompt_tsan_clockid |
Definition at line 203 of file ompt-tsan.cpp.
|
static |
Definition at line 150 of file ompt-tsan.cpp.
|
static |
Definition at line 900 of file ompt-tsan.cpp.
References archer_flags, i, and TsanHappensAfter.
Referenced by ompt_tsan_task_schedule(), and startTask().
|
static |
Definition at line 912 of file ompt-tsan.cpp.
References releaseDependencies(), TsanHappensAfter, and TsanHappensBefore.
Referenced by ompt_tsan_task_schedule().
| const char const volatile void * DECLARE_TSAN_FUNCTION | ( | AnnotateNewMemory | , |
| const char * | , | ||
| int | , | ||
| const volatile void * | , | ||
| size_t | ) |
Required OMPT inquiry functions.
References DECLARE_TSAN_FUNCTION, and ompt_get_parallel_info.
|
static |
Definition at line 967 of file ompt-tsan.cpp.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 875 of file ompt-tsan.cpp.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 205 of file ompt-tsan.cpp.
References ret.
Referenced by ompt_tsan_thread_begin().
| ompt_start_tool_result_t * ompt_start_tool | ( | unsigned int | omp_version, |
| const char * | runtime_version ) |
Definition at line 1235 of file ompt-tsan.cpp.
References archer_flags, findTsanFunctionSilent, ompt_start_tool_result, ompt_tsan_finalize(), ompt_tsan_initialize(), pagesize, and void.
|
static |
Definition at line 1060 of file ompt-tsan.cpp.
References archer_flags, d, i, ret, ToTaskData(), and TsanHappensBefore.
|
static |
Definition at line 1221 of file ompt-tsan.cpp.
References archer_flags, end, and TsanIgnoreWritesEnd.
Referenced by ompt_start_tool().
|
static |
Definition at line 664 of file ompt-tsan.cpp.
References ToTaskData(), TsanFuncEntry, TsanFuncExit, TsanHappensAfter, and type.
|
static |
Definition at line 1161 of file ompt-tsan.cpp.
References archer_flags, findTsanFunction, hasReductionCallback, ompt_get_parallel_info, ompt_get_thread_data, ompt_set_callback, SET_CALLBACK, SET_CALLBACK_T, SET_OPTIONAL_CALLBACK_T, and TsanIgnoreWritesBegin.
Referenced by ompt_start_tool().
|
static |
OMPT event callbacks for handling locking.
Definition at line 1106 of file ompt-tsan.cpp.
References Locks, LocksMutex, and TsanHappensAfter.
|
static |
Definition at line 1120 of file ompt-tsan.cpp.
References Locks, LocksMutex, and TsanHappensBefore.
|
static |
OMPT event callbacks for handling parallel regions.
Definition at line 632 of file ompt-tsan.cpp.
References archer_flags, flag, ToTaskData(), TsanHappensBefore, and TsanIgnoreWritesEnd.
|
static |
Definition at line 645 of file ompt-tsan.cpp.
References archer_flags, flag, ToTaskData(), TsanHappensAfter, and TsanIgnoreWritesBegin.
|
static |
Definition at line 807 of file ompt-tsan.cpp.
References TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
|
static |
Definition at line 700 of file ompt-tsan.cpp.
References hasReductionCallback, KMP_FALLTHROUGH, ToTaskData(), TsanFuncEntry, TsanFuncExit, TsanHappensAfter, TsanHappensBefore, TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
|
static |
OMPT event callbacks for handling tasks.
Definition at line 841 of file ompt-tsan.cpp.
References ompt_get_parallel_info, ToTaskData(), TsanHappensBefore, and type.
|
static |
Definition at line 985 of file ompt-tsan.cpp.
References acquireDependencies(), completeTask(), endTask(), freeTask(), startTask(), suspendTask(), switchTasks(), ToTaskData(), TsanHappensAfter, and TsanHappensBefore.
|
static |
Definition at line 604 of file ompt-tsan.cpp.
References my_next_id(), and TsanNewMemory.
|
static |
Definition at line 621 of file ompt-tsan.cpp.
References TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
|
static |
Definition at line 887 of file ompt-tsan.cpp.
References archer_flags, i, and TsanHappensBefore.
Referenced by completeTask().
|
static |
Definition at line 972 of file ompt-tsan.cpp.
References acquireDependencies(), and TsanHappensAfter.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 939 of file ompt-tsan.cpp.
References TsanHappensBefore.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 946 of file ompt-tsan.cpp.
References hasReductionCallback, TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
Referenced by ompt_tsan_task_schedule().
|
inlinestatic |
Definition at line 594 of file ompt-tsan.cpp.
Referenced by ompt_tsan_dependences(), ompt_tsan_implicit_task(), ompt_tsan_parallel_begin(), ompt_tsan_parallel_end(), ompt_tsan_sync_region(), ompt_tsan_task_create(), and ompt_tsan_task_schedule().
|
static |
Definition at line 146 of file ompt-tsan.cpp.
Referenced by acquireDependencies(), ompt_start_tool(), ompt_tsan_dependences(), ompt_tsan_finalize(), ompt_tsan_initialize(), ompt_tsan_parallel_begin(), ompt_tsan_parallel_end(), and releaseDependencies().
|
static |
Definition at line 53 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize(), ompt_tsan_sync_region(), and switchTasks().
| const char int |
Definition at line 161 of file ompt-tsan.cpp.
|
static |
Store a mutex for each wait_id to resolve race condition with callbacks.
Definition at line 601 of file ompt-tsan.cpp.
Referenced by ompt_tsan_mutex_acquired(), and ompt_tsan_mutex_released().
|
static |
Definition at line 602 of file ompt-tsan.cpp.
Referenced by ompt_tsan_mutex_acquired(), and ompt_tsan_mutex_released().
|
static |
Definition at line 201 of file ompt-tsan.cpp.
|
static |
Definition at line 211 of file ompt-tsan.cpp.
Referenced by ompt_start_tool().