aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2016-06-02 20:32:40 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2016-06-02 20:32:40 +0000
commitafbead27742ec0eed7d9fd5633fa0df06fa69514 (patch)
tree0785e8792ba7b3b9a01bc7a0ee44ccf2ce7fb130
parentae0d3801758248a770578b31c5ab07d985e5ac69 (diff)
downloadllvm-afbead27742ec0eed7d9fd5633fa0df06fa69514.zip
llvm-afbead27742ec0eed7d9fd5633fa0df06fa69514.tar.gz
llvm-afbead27742ec0eed7d9fd5633fa0df06fa69514.tar.bz2
Merging r270884:
------------------------------------------------------------------------ r270884 | jlpeyton | 2016-05-26 13:19:10 -0500 (Thu, 26 May 2016) | 11 lines Make LIBOMP_USE_ITT_NOTIFY a setting that can be enabled or disabled 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: 271581
-rw-r--r--openmp/runtime/CMakeLists.txt6
-rw-r--r--openmp/runtime/src/kmp_config.h.cmake2
-rw-r--r--openmp/runtime/src/kmp_csupport.c2
-rw-r--r--openmp/runtime/src/kmp_runtime.c4
4 files changed, 9 insertions, 5 deletions
diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt
index 9380ab5..67f1187 100644
--- a/openmp/runtime/CMakeLists.txt
+++ b/openmp/runtime/CMakeLists.txt
@@ -192,8 +192,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)
@@ -326,6 +327,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}")
diff --git a/openmp/runtime/src/kmp_config.h.cmake b/openmp/runtime/src/kmp_config.h.cmake
index dc37da0..f5ac6f1 100644
--- a/openmp/runtime/src/kmp_config.h.cmake
+++ b/openmp/runtime/src/kmp_config.h.cmake
@@ -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
diff --git a/openmp/runtime/src/kmp_csupport.c b/openmp/runtime/src/kmp_csupport.c
index ef2391a..c469dae 100644
--- a/openmp/runtime/src/kmp_csupport.c
+++ b/openmp/runtime/src/kmp_csupport.c
@@ -511,7 +511,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();
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c
index b80bbfd..fcddee7 100644
--- a/openmp/runtime/src/kmp_runtime.c
+++ b/openmp/runtime/src/kmp_runtime.c
@@ -3804,7 +3804,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;
@@ -3972,7 +3974,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