Skip to content

Commit 88e557c

Browse files
committed
Revert "[OpenMP] [OMPT] [2/8] Implemented a connector for communication of OMPT callbacks between libraries."
This reverts commit f94c267.
1 parent b124295 commit 88e557c

File tree

11 files changed

+7
-252
lines changed

11 files changed

+7
-252
lines changed

openmp/libomptarget/CMakeLists.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,7 @@ if(LIBOMPTARGET_ENABLE_DEBUG)
6969
add_definitions(-DOMPTARGET_DEBUG)
7070
endif()
7171

72-
# OMPT support for libomptarget
73-
set(OMPT_TARGET_DEFAULT FALSE)
74-
if ((LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
75-
set (OMPT_TARGET_DEFAULT TRUE)
76-
endif()
77-
set(LIBOMPTARGET_OMPT_SUPPORT ${OMPT_TARGET_DEFAULT} CACHE BOOL "OMPT-target-support?")
78-
if (LIBOMPTARGET_OMPT_SUPPORT)
79-
add_definitions(-DOMPT_SUPPORT=1)
80-
message(STATUS "OMPT target enabled")
81-
else()
82-
message(STATUS "OMPT target disabled")
83-
endif()
84-
85-
pythonize_bool(LIBOMPTARGET_OMPT_SUPPORT)
86-
8772
set(LIBOMPTARGET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
88-
message(STATUS "OpenMP tools dir in libomptarget: ${LIBOMP_OMP_TOOLS_INCLUDE_DIR}")
89-
include_directories(${LIBOMP_OMP_TOOLS_INCLUDE_DIR})
9073

9174
# Build target agnostic offloading library.
9275
set(LIBOMPTARGET_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)

openmp/libomptarget/include/ompt-connector.h

Lines changed: 0 additions & 89 deletions
This file was deleted.

openmp/libomptarget/src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ add_llvm_library(omptarget
2020
interface.cpp
2121
interop.cpp
2222
omptarget.cpp
23-
ompt_callback.cpp
2423
rtl.cpp
2524
LegacyAPI.cpp
2625

openmp/libomptarget/src/ompt_callback.cpp

Lines changed: 0 additions & 75 deletions
This file was deleted.

openmp/runtime/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ add_subdirectory(test)
419419
# make these variables available for tools:
420420
set(LIBOMP_LIBRARY_DIR ${LIBOMP_LIBRARY_DIR} PARENT_SCOPE)
421421
set(LIBOMP_INCLUDE_DIR ${LIBOMP_INCLUDE_DIR} PARENT_SCOPE)
422-
set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_OMP_TOOLS_INCLUDE_DIR} PARENT_SCOPE)
423422
# make these variables available for tools/libompd:
424423
set(LIBOMP_SRC_DIR ${LIBOMP_SRC_DIR} PARENT_SCOPE)
425424
set(LIBOMP_OMPD_SUPPORT ${LIBOMP_OMPD_SUPPORT} PARENT_SCOPE)

openmp/runtime/cmake/config-ix.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,6 @@ else()
330330
endif()
331331
endif()
332332

333-
set(LIBOMP_HAVE_OMPT_SUPPORT ${LIBOMP_HAVE_OMPT_SUPPORT} PARENT_SCOPE)
334-
335333
# Check if HWLOC support is available
336334
if(${LIBOMP_USE_HWLOC})
337335
find_path(LIBOMP_HWLOC_INCLUDE_DIR NAMES hwloc.h HINTS ${LIBOMP_HWLOC_INSTALL_DIR} PATH_SUFFIXES include)

openmp/runtime/src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ if(${LIBOMP_OMPT_SUPPORT})
391391
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH})
392392
# install under legacy name ompt.h
393393
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h)
394-
set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
395394
endif()
396395
if(${LIBOMP_FORTRAN_MODULES})
397396
install(FILES

openmp/runtime/src/exports_so.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ VERSION {
2626
# OMPT API
2727
#
2828
ompt_start_tool; # OMPT start interface
29-
ompt_libomp_connect; # OMPT libomptarget interface
3029

3130
ompc_*; # omp.h renames some standard functions to ompc_*.
3231
kmp_*; # Intel extensions.

openmp/runtime/src/ompt-general.cpp

Lines changed: 7 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ static void *ompt_tool_module = NULL;
110110
#define OMPT_DLCLOSE(Lib) dlclose(Lib)
111111
#endif
112112

113-
/// Used to track the initializer and the finalizer provided by libomptarget
114-
static ompt_start_tool_result_t *libomptarget_ompt_result = NULL;
115-
116113
/*****************************************************************************
117114
* forward declarations
118115
****************************************************************************/
@@ -459,7 +456,7 @@ void ompt_pre_init() {
459456
if (verbose_init && verbose_file != stderr && verbose_file != stdout)
460457
fclose(verbose_file);
461458
#if OMPT_DEBUG
462-
printf("ompt_pre_init(): ompt_enabled = %d\n", ompt_enabled.enabled);
459+
printf("ompt_pre_init(): ompt_enabled = %d\n", ompt_enabled);
463460
#endif
464461
}
465462

@@ -512,13 +509,12 @@ void ompt_post_init() {
512509
}
513510

514511
void ompt_fini() {
515-
if (ompt_enabled.enabled) {
516-
if (ompt_start_tool_result && ompt_start_tool_result->finalize) {
517-
ompt_start_tool_result->finalize(&(ompt_start_tool_result->tool_data));
518-
}
519-
if (libomptarget_ompt_result && libomptarget_ompt_result->finalize) {
520-
libomptarget_ompt_result->finalize(NULL);
521-
}
512+
if (ompt_enabled.enabled
513+
#if OMPD_SUPPORT
514+
&& ompt_start_tool_result && ompt_start_tool_result->finalize
515+
#endif
516+
) {
517+
ompt_start_tool_result->finalize(&(ompt_start_tool_result->tool_data));
522518
}
523519

524520
if (ompt_tool_module)
@@ -873,50 +869,5 @@ static ompt_interface_fn_t ompt_fn_lookup(const char *s) {
873869

874870
FOREACH_OMPT_INQUIRY_FN(ompt_interface_fn)
875871

876-
#undef ompt_interface_fn
877-
878872
return NULL;
879873
}
880-
881-
/// Lookup function to query libomp callbacks registered by the tool
882-
static ompt_interface_fn_t ompt_libomp_target_fn_lookup(const char *s) {
883-
#define ompt_interface_fn(fn, type, code) \
884-
if (strcmp(s, #fn) == 0) \
885-
return (ompt_interface_fn_t)ompt_callbacks.ompt_callback(fn);
886-
887-
FOREACH_OMPT_DEVICE_EVENT(ompt_interface_fn)
888-
FOREACH_OMPT_EMI_EVENT(ompt_interface_fn)
889-
FOREACH_OMPT_NOEMI_EVENT(ompt_interface_fn)
890-
891-
#undef ompt_interface_fn
892-
893-
return (ompt_interface_fn_t)0;
894-
}
895-
896-
/// This function is called by the libomptarget connector to assign
897-
/// callbacks already registered with libomp.
898-
_OMP_EXTERN void ompt_libomp_connect(ompt_start_tool_result_t *result) {
899-
OMPT_VERBOSE_INIT_PRINT("libomp --> OMPT: Enter libomp_ompt_connect\n");
900-
901-
// Ensure libomp callbacks have been added if not already
902-
__ompt_force_initialization();
903-
904-
if (ompt_enabled.enabled &&
905-
// Callbacks are initiated only if the device initialize callback
906-
// has been registered by the tool
907-
ompt_callbacks.ompt_callback(ompt_callback_device_initialize)) {
908-
if (result) {
909-
OMPT_VERBOSE_INIT_PRINT(
910-
"libomp --> OMPT: Connecting with libomptarget\n");
911-
// Pass in the libomp lookup function so that the already registered
912-
// functions can be extracted and assigned to the callbacks in
913-
// libomptarget
914-
result->initialize(ompt_libomp_target_fn_lookup,
915-
0 /* initial_device_num */, nullptr /* tool_data */);
916-
// Track the object provided by libomptarget so that the finalizer can be
917-
// called during OMPT finalization
918-
libomptarget_ompt_result = result;
919-
}
920-
}
921-
OMPT_VERBOSE_INIT_PRINT("libomp --> OMPT: Exit libomp_ompt_connect\n");
922-
}

openmp/runtime/src/ompt-specific.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ ompt_task_info_t *__ompt_get_scheduling_taskinfo(int depth) {
188188
//******************************************************************************
189189
// interface operations
190190
//******************************************************************************
191-
//----------------------------------------------------------
192-
// initialization support
193-
//----------------------------------------------------------
194-
195-
void __ompt_force_initialization() { __kmp_serial_initialize(); }
196191

197192
//----------------------------------------------------------
198193
// thread support

openmp/runtime/src/ompt-specific.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
* forward declarations
2121
****************************************************************************/
2222

23-
/// Entrypoint used by libomptarget to register callbacks in libomp, if not
24-
/// done already
25-
void __ompt_force_initialization();
26-
2723
void __ompt_team_assign_id(kmp_team_t *team, ompt_data_t ompt_pid);
2824
void __ompt_thread_assign_wait_id(void *variable);
2925

0 commit comments

Comments
 (0)