This is an archive of the discontinued LLVM Phabricator instance.

Make LIBOMP_USE_ITT_NOTIFY a setting that can be enabled or disabled
ClosedPublic

Authored by jmellorcrummey on May 22 2016, 10:01 PM.

Details

Summary

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.

Diff Detail

Event Timeline

jmellorcrummey retitled this revision from to Make LIBOMP_USE_ITT_NOTIFY a setting that can be enabled or disabled.
jmellorcrummey updated this object.
jmellorcrummey added reviewers: jlpeyton, hfinkel.

Remove comment that described ITT as always on.

jlpeyton edited edge metadata.May 23 2016, 11:14 AM
jlpeyton added subscribers: omalyshe, AndreyChurbanov.

Adding Olga and Andrey

Olga, Andrey,

Why are there two macros used throughout the codebase, USE_ITT_NOTIFY and USE_ITT_BUILD? Do they have different meanings? The LIBOMP_USE_ITT_NOTIFY (from this patch) is translated to USE_ITT_NOTIFY, but USE_ITT_BUILD is hard set to 1 in kmp_config.h.cmake. I guess I just need clarifications on them.

The USE_ITT_BUILD=0 removes all the ITT code from the sources, while the USE_ITT_NOTIFY=0 with USE_ITT_BUILD=1 leaves all ITT calls as empty routines. This is old code, and I guess two macros were introduced long ago for better debugging of the ittnotify interfaces. I doubt we need empty routines nowadays, so we can think of leaving only one macro that controls whether we have fully functional ittnotify or nothing. This should be enough. Whether it is called USE_ITT_NOTIFY or USE_ITT_BUILD does not make big difference to me, probably USE_ITT_NOTIFY better corresponds with ittnotify library name.

jmellorcrummey edited edge metadata.

Now that I have heard some thoughts from Intel, this patch does the following:

(1) improve the patch to replace hardwired "#define USE_ITT_BUILD 1" with #define USE_ITT_BUILD LIBOMP_ITT_NOTIFY" so that when LIBOMP_ITT_NOTIFY is turned off in cmake, USE_ITT_BUILD is set to 0, which causes all ITT support to be omitted.
(2) fix code that broke when USE_ITT_BUILD was turned off.

jlpeyton accepted this revision.May 26 2016, 11:23 AM
jlpeyton edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 26 2016, 11:23 AM
This revision was automatically updated to reflect the committed changes.