Skip to content

Commit

Permalink
Revert "Updating implementation of OMPT as specified in OpenMP 5.0 Pr…
Browse files Browse the repository at this point in the history
…eview 2 (TR6)"

This reverts commit r317339 which discarded some recent commits.

llvm-svn: 317346
  • Loading branch information
hahnjo committed Nov 3, 2017
1 parent 8fe9fb0 commit f0a1c65
Show file tree
Hide file tree
Showing 25 changed files with 396 additions and 251 deletions.
8 changes: 4 additions & 4 deletions openmp/CREDITS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ N: Carlo Bertolli
W: http://ibm.com
D: IBM contributor to PowerPC support in CMake files and elsewhere.

N: Diego Caballero
E: diego.l.caballero@gmail.com
D: Fork performance improvements

N: Sunita Chandrasekaran
D: Contributor to testsuite from OpenUH

Expand Down Expand Up @@ -51,7 +55,3 @@ D: Making build work for FreeBSD.

N: Cheng Wang
D: Contributor to testsuite from OpenUH

N: Diego Caballero
E: diego.l.caballero@gmail.com
D: Fork performance improvements
2 changes: 1 addition & 1 deletion openmp/runtime/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
BasedOnStyle: LLVM
AlignTrailingComments: false
SortIncludes: false
---
...
2 changes: 1 addition & 1 deletion openmp/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ if(LIBOMP_OMPT_SUPPORT AND (NOT LIBOMP_HAVE_OMPT_SUPPORT))
libomp_error_say("OpenMP Tools Interface requested but not available in this implementation")
endif()
if(LIBOMP_OMPT_SUPPORT AND (${LIBOMP_OMP_VERSION} LESS 50))
message( FATAL_ERROR "OMPT is only available with OpenMP 5.0, LIBOMP_OMP_VERSION is ${LIBOMP_OMP_VERSION}" )
libomp_error_say("OpenMP Tools Interface only available with OpenMP 5.0, LIBOMP_OMP_VERSION is ${LIBOMP_OMP_VERSION}")
endif()

# TSAN-support
Expand Down
9 changes: 9 additions & 0 deletions openmp/runtime/src/exports_so.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ VERSION {
# icc drops weak attribute at linking step without the following line:
Annotate*; # TSAN annotation

#
# OMPT state placeholders
#
ompt_idle;
ompt_overhead;
ompt_barrier_wait;
ompt_task_wait;
ompt_mutex_wait;

ompc_*; # omp.h renames some standard functions to ompc_*.
kmp_*; # Intel extensions.
kmpc_*; # Intel extensions.
Expand Down
275 changes: 152 additions & 123 deletions openmp/runtime/src/include/50/ompt.h.var

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion openmp/runtime/src/kmp_csupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "kmp_stats.h"

#if OMPT_SUPPORT
#include "ompt-internal.h"
#include "ompt-specific.h"
#endif

Expand Down
1 change: 0 additions & 1 deletion openmp/runtime/src/kmp_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#endif

#if OMPT_SUPPORT
#include "ompt-internal.h"
#include "ompt-specific.h"
#endif

Expand Down
10 changes: 5 additions & 5 deletions openmp/runtime/src/kmp_gsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ void xexpand(KMP_API_NAME_GOMP_PARALLEL_START)(void (*task)(void *), void *data,
if (ompt_enabled.enabled) {
__ompt_get_task_info_internal(0, NULL, NULL, &parent_frame, NULL, NULL);
parent_frame->enter_frame = OMPT_GET_FRAME_ADDRESS(1);
OMPT_STORE_RETURN_ADDRESS(gtid);
}
OMPT_STORE_RETURN_ADDRESS(gtid);
#endif

MKLOC(loc, "GOMP_parallel_start");
Expand Down Expand Up @@ -832,8 +832,8 @@ LOOP_NEXT_ULL(xexpand(KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT),
if (ompt_enabled.enabled) { \
__ompt_get_task_info_internal(0, NULL, NULL, &parent_frame, NULL, NULL); \
parent_frame->enter_frame = OMPT_GET_FRAME_ADDRESS(1); \
OMPT_STORE_RETURN_ADDRESS(gtid); \
}
} \
OMPT_STORE_RETURN_ADDRESS(gtid);

#define OMPT_LOOP_POST() \
if (ompt_enabled.enabled) { \
Expand Down Expand Up @@ -1055,8 +1055,8 @@ void xexpand(KMP_API_NAME_GOMP_PARALLEL_SECTIONS_START)(void (*task)(void *),
if (ompt_enabled.enabled) {
__ompt_get_task_info_internal(0, NULL, NULL, &parent_frame, NULL, NULL);
parent_frame->enter_frame = OMPT_GET_FRAME_ADDRESS(1);
OMPT_STORE_RETURN_ADDRESS(gtid);
}
OMPT_STORE_RETURN_ADDRESS(gtid);
#endif

MKLOC(loc, "GOMP_parallel_sections_start");
Expand Down Expand Up @@ -1131,8 +1131,8 @@ void xexpand(KMP_API_NAME_GOMP_PARALLEL)(void (*task)(void *), void *data,
if (ompt_enabled.enabled) {
parent_task_info = __ompt_get_task_info_object(0);
parent_task_info->frame.enter_frame = OMPT_GET_FRAME_ADDRESS(1);
OMPT_STORE_RETURN_ADDRESS(gtid);
}
OMPT_STORE_RETURN_ADDRESS(gtid);
#endif
if (__kmpc_ok_to_fork(&loc) && (num_threads != 1)) {
if (num_threads != 0) {
Expand Down
21 changes: 15 additions & 6 deletions openmp/runtime/src/kmp_i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ kmp_msg_t __kmp_msg_empty = {kmp_mt_dummy, 0, "", 0};
kmp_msg_t __kmp_msg_null = {kmp_mt_dummy, 0, NULL, 0};
static char const *no_message_available = "(No message available)";

static void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message,
va_list ap);

enum kmp_i18n_cat_status {
KMP_I18N_CLOSED, // Not yet opened or closed.
KMP_I18N_OPENED, // Opened successfully, ready to use.
Expand Down Expand Up @@ -784,9 +787,7 @@ kmp_msg_t __kmp_msg_error_mesg(char const *mesg) {
} // __kmp_msg_error_mesg

// -----------------------------------------------------------------------------
void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, ...) {

va_list args;
void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, va_list args) {
kmp_i18n_id_t format; // format identifier
kmp_msg_t fmsg; // formatted message
kmp_str_buf_t buffer;
Expand Down Expand Up @@ -815,7 +816,6 @@ void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, ...) {
__kmp_str_free(&fmsg.str);

// Format other messages.
va_start(args, message);
for (;;) {
message = va_arg(args, kmp_msg_t);
if (message.type == kmp_mt_dummy && message.str == NULL) {
Expand All @@ -838,7 +838,6 @@ void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, ...) {
__kmp_str_buf_cat(&buffer, fmsg.str, fmsg.len);
__kmp_str_free(&fmsg.str);
}
va_end(args);

// Print formatted messages.
// This lock prevents multiple fatal errors on the same problem.
Expand All @@ -852,8 +851,18 @@ void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, ...) {

} // __kmp_msg

void __kmp_msg(kmp_msg_severity_t severity, kmp_msg_t message, ...) {
va_list args;
va_start(args, message);
__kmp_msg(severity, message, args);
va_end(args);
}

void __kmp_fatal(kmp_msg_t message, ...) {
__kmp_msg(kmp_ms_fatal, message, __kmp_msg_null);
va_list args;
va_start(args, message);
__kmp_msg(kmp_ms_fatal, message, args);
va_end(args);
#if KMP_OS_WINDOWS
// Delay to give message a chance to appear before reaping
__kmp_thread_sleep(500);
Expand Down
2 changes: 0 additions & 2 deletions openmp/runtime/src/kmp_itt.inl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* kmp_itt.inl -- Inline functions of ITT Notify.
*/


//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
Expand All @@ -13,7 +12,6 @@
//
//===----------------------------------------------------------------------===//


// Inline function definitions. This file should be included into kmp_itt.h file
// for production build (to let compliler inline functions) or into kmp_itt.c
// file for debug build (to reduce the number of files to recompile and save
Expand Down
7 changes: 4 additions & 3 deletions openmp/runtime/src/kmp_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3058,11 +3058,12 @@ kmp_indirect_lock_t *__kmp_allocate_indirect_lock(void **user_lock,
if (idx == __kmp_i_lock_table.size) {
// Double up the space for block pointers
int row = __kmp_i_lock_table.size / KMP_I_LOCK_CHUNK;
kmp_indirect_lock_t **old_table = __kmp_i_lock_table.table;
__kmp_i_lock_table.table = (kmp_indirect_lock_t **)__kmp_allocate(
kmp_indirect_lock_t **new_table = (kmp_indirect_lock_t **)__kmp_allocate(
2 * row * sizeof(kmp_indirect_lock_t *));
KMP_MEMCPY(__kmp_i_lock_table.table, old_table,
KMP_MEMCPY(new_table, __kmp_i_lock_table.table,
row * sizeof(kmp_indirect_lock_t *));
kmp_indirect_lock_t **old_table = __kmp_i_lock_table.table;
__kmp_i_lock_table.table = new_table;
__kmp_free(old_table);
// Allocate new objects in the new blocks
for (int i = row; i < 2 * row; ++i)
Expand Down
7 changes: 3 additions & 4 deletions openmp/runtime/src/kmp_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,9 @@ inline static void propagateFPControl(kmp_team_t *team) {

// There is no point looking at t_fp_control_saved here.
// If it is TRUE, we still have to update the values if they are different
// from those we now have.
// If it is FALSE we didn't save anything yet, but our objective is the
// same. We have to ensure that the values in the team are the same as
// those we have.
// from those we now have. If it is FALSE we didn't save anything yet, but
// our objective is the same. We have to ensure that the values in the team
// are the same as those we have.
// So, this code achieves what we need whether or not t_fp_control_saved is
// true. By checking whether the value needs updating we avoid unnecessary
// writes that would put the cache-line into a written state, causing all
Expand Down
Loading

0 comments on commit f0a1c65

Please sign in to comment.