Skip to content

Commit

Permalink
Make LIBOMP_USE_ITT_NOTIFY a setting that can be enabled or disabled
Browse files Browse the repository at this point in the history
On Blue Gene/Q, having LIBOMP_USE_ITT_NOTIFY support compiled into a
statically-linked binary causes a failure at runtime because dlopen fails.
This patch changes LIBOMP_USE_ITT_NOTIFY to a cacheable configuration setting
that can be disabled.

Patch by John Mellor-Crummey

Differential Revision: http://reviews.llvm.org/D20517

llvm-svn: 270884
  • Loading branch information
jpeyton52 committed May 26, 2016
1 parent 6ddf5f4 commit 7abf9d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions openmp/runtime/CMakeLists.txt
Expand Up @@ -200,8 +200,9 @@ elseif("${libomp_build_type_lowercase}" STREQUAL "minsizerel")
set(MINSIZEREL_BUILD TRUE)
endif()

# Include itt notify interface? Right now, always.
set(LIBOMP_USE_ITT_NOTIFY TRUE)
# Include itt notify interface?
set(LIBOMP_USE_ITT_NOTIFY TRUE CACHE BOOL
"Enable ITT notify?")

# normal, profile, stubs library.
set(NORMAL_LIBRARY FALSE)
Expand Down Expand Up @@ -354,6 +355,7 @@ if(${LIBOMP_STANDALONE_BUILD})
libomp_say("Build -- ${LIBOMP_BUILD}")
libomp_say("Use Stats-gathering -- ${LIBOMP_STATS}")
libomp_say("Use Debugger-support -- ${LIBOMP_USE_DEBUGGER}")
libomp_say("Use ITT notify -- ${LIBOMP_USE_ITT_NOTIFY}")
libomp_say("Use OMPT-support -- ${LIBOMP_OMPT_SUPPORT}")
if(${LIBOMP_OMPT_SUPPORT})
libomp_say("Use OMPT-blame -- ${LIBOMP_OMPT_BLAME}")
Expand Down
2 changes: 1 addition & 1 deletion openmp/runtime/src/kmp_config.h.cmake
Expand Up @@ -85,7 +85,7 @@
#define KMP_ADJUST_BLOCKTIME 1
#define BUILD_PARALLEL_ORDERED 1
#define KMP_ASM_INTRINS 1
#define USE_ITT_BUILD 1
#define USE_ITT_BUILD LIBOMP_USE_ITT_NOTIFY
#define INTEL_ITTNOTIFY_PREFIX __kmp_itt_
#if ! KMP_MIC
# define USE_LOAD_BALANCE 1
Expand Down
2 changes: 1 addition & 1 deletion openmp/runtime/src/kmp_csupport.c
Expand Up @@ -507,7 +507,7 @@ __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid)

// we need to wait for the proxy tasks before finishing the thread
if ( task_team != NULL && task_team->tt.tt_found_proxy_tasks )
__kmp_task_team_wait(this_thr, serial_team, NULL ); // is an ITT object needed here?
__kmp_task_team_wait(this_thr, serial_team USE_ITT_BUILD_ARG(NULL) ); // is an ITT object needed here?
#endif

KMP_MB();
Expand Down
4 changes: 3 additions & 1 deletion openmp/runtime/src/kmp_runtime.c
Expand Up @@ -3734,7 +3734,9 @@ __kmp_register_root( int initial_thread )
/* prepare the master thread for get_gtid() */
__kmp_gtid_set_specific( gtid );

#if USE_ITT_BUILD
__kmp_itt_thread_name( gtid );
#endif /* USE_ITT_BUILD */

#ifdef KMP_TDATA_GTID
__kmp_gtid = gtid;
Expand Down Expand Up @@ -3908,7 +3910,7 @@ __kmp_unregister_root_current_thread( int gtid )
// the runtime is shutting down so we won't report any events
thread->th.ompt_thread_info.state = ompt_state_undefined;
#endif
__kmp_task_team_wait(thread, team, NULL );
__kmp_task_team_wait(thread, team USE_ITT_BUILD_ARG(NULL));
}
#endif

Expand Down

0 comments on commit 7abf9d5

Please sign in to comment.