[OMPT] Remove OMPT idle callback
The idle callback was removed from the spec as of TR7. This removes it from the implementation. Patch provided by Simon Convent Reviewers: hbae, protze.joachim Differential Revision: https://reviews.llvm.org/D48362 llvm-svn: 339771
This commit is contained in:
parent
fabf7fe5f8
commit
e1a04b4659
|
@ -151,7 +151,6 @@
|
||||||
macro (ompt_callback_flush, ompt_callback_flush_t, 29) /* after executing flush */ \
|
macro (ompt_callback_flush, ompt_callback_flush_t, 29) /* after executing flush */ \
|
||||||
\
|
\
|
||||||
macro (ompt_callback_cancel, ompt_callback_cancel_t, 30) /* cancel innermost binding region */ \
|
macro (ompt_callback_cancel, ompt_callback_cancel_t, 30) /* cancel innermost binding region */ \
|
||||||
macro (ompt_callback_idle, ompt_callback_idle_t, 31) /* begin or end idle state */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -490,10 +489,6 @@ typedef void (*ompt_callback_master_t) (
|
||||||
const void *codeptr_ra /* return address of runtime call */
|
const void *codeptr_ra /* return address of runtime call */
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef void (*ompt_callback_idle_t) (
|
|
||||||
ompt_scope_endpoint_t endpoint /* endpoint of idle time */
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef enum ompt_work_type_t {
|
typedef enum ompt_work_type_t {
|
||||||
ompt_work_loop = 1,
|
ompt_work_loop = 1,
|
||||||
ompt_work_sections = 2,
|
ompt_work_sections = 2,
|
||||||
|
|
|
@ -142,11 +142,6 @@ static inline void __ompt_implicit_task_end(kmp_info_t *this_thr,
|
||||||
ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
|
ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
|
||||||
ompt_scope_end, NULL, tId, 0, ds_tid);
|
ompt_scope_end, NULL, tId, 0, ds_tid);
|
||||||
}
|
}
|
||||||
#if OMPT_OPTIONAL
|
|
||||||
if (ompt_enabled.ompt_callback_idle) {
|
|
||||||
ompt_callbacks.ompt_callback(ompt_callback_idle)(ompt_scope_begin);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// return to idle state
|
// return to idle state
|
||||||
this_thr->th.ompt_thread_info.state = omp_state_idle;
|
this_thr->th.ompt_thread_info.state = omp_state_idle;
|
||||||
} else {
|
} else {
|
||||||
|
@ -266,13 +261,6 @@ final_spin=FALSE)
|
||||||
pId = NULL;
|
pId = NULL;
|
||||||
tId = &(this_thr->th.ompt_thread_info.task_data);
|
tId = &(this_thr->th.ompt_thread_info.task_data);
|
||||||
}
|
}
|
||||||
#if OMPT_OPTIONAL
|
|
||||||
if (ompt_entry_state == omp_state_idle) {
|
|
||||||
if (ompt_enabled.ompt_callback_idle) {
|
|
||||||
ompt_callbacks.ompt_callback(ompt_callback_idle)(ompt_scope_begin);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
if (final_spin && (__kmp_tasking_mode == tskm_immediate_exec ||
|
if (final_spin && (__kmp_tasking_mode == tskm_immediate_exec ||
|
||||||
this_thr->th.th_task_team == NULL)) {
|
this_thr->th.th_task_team == NULL)) {
|
||||||
// implicit task is done. Either no taskqueue, or task-team finished
|
// implicit task is done. Either no taskqueue, or task-team finished
|
||||||
|
@ -453,11 +441,6 @@ final_spin=FALSE)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ompt_exit_state == omp_state_idle) {
|
if (ompt_exit_state == omp_state_idle) {
|
||||||
#if OMPT_OPTIONAL
|
|
||||||
if (ompt_enabled.ompt_callback_idle) {
|
|
||||||
ompt_callbacks.ompt_callback(ompt_callback_idle)(ompt_scope_end);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
this_thr->th.ompt_thread_info.state = omp_state_overhead;
|
this_thr->th.ompt_thread_info.state = omp_state_overhead;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,4 @@
|
||||||
|
|
||||||
#define ompt_callback_cancel_implemented ompt_event_MAY_ALWAYS_OPTIONAL
|
#define ompt_callback_cancel_implemented ompt_event_MAY_ALWAYS_OPTIONAL
|
||||||
|
|
||||||
#define ompt_callback_idle_implemented ompt_event_MAY_ALWAYS_OPTIONAL
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -413,21 +413,6 @@ on_ompt_callback_cancel(
|
||||||
printf("%" PRIu64 ": ompt_event_cancel: task_data=%" PRIu64 ", flags=%s|%s=%" PRIu32 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, task_data->value, first_flag_value, second_flag_value, flags, codeptr_ra);
|
printf("%" PRIu64 ": ompt_event_cancel: task_data=%" PRIu64 ", flags=%s|%s=%" PRIu32 ", codeptr_ra=%p\n", ompt_get_thread_data()->value, task_data->value, first_flag_value, second_flag_value, flags, codeptr_ra);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
on_ompt_callback_idle(
|
|
||||||
ompt_scope_endpoint_t endpoint)
|
|
||||||
{
|
|
||||||
switch(endpoint)
|
|
||||||
{
|
|
||||||
case ompt_scope_begin:
|
|
||||||
printf("%" PRIu64 ": ompt_event_idle_begin:\n", ompt_get_thread_data()->value);
|
|
||||||
break;
|
|
||||||
case ompt_scope_end:
|
|
||||||
printf("%" PRIu64 ": ompt_event_idle_end:\n", ompt_get_thread_data()->value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_ompt_callback_implicit_task(
|
on_ompt_callback_implicit_task(
|
||||||
ompt_scope_endpoint_t endpoint,
|
ompt_scope_endpoint_t endpoint,
|
||||||
|
@ -732,7 +717,6 @@ int ompt_initialize(
|
||||||
register_callback(ompt_callback_control_tool);
|
register_callback(ompt_callback_control_tool);
|
||||||
register_callback(ompt_callback_flush);
|
register_callback(ompt_callback_flush);
|
||||||
register_callback(ompt_callback_cancel);
|
register_callback(ompt_callback_cancel);
|
||||||
register_callback(ompt_callback_idle);
|
|
||||||
register_callback(ompt_callback_implicit_task);
|
register_callback(ompt_callback_implicit_task);
|
||||||
register_callback_t(ompt_callback_lock_init, ompt_callback_mutex_acquire_t);
|
register_callback_t(ompt_callback_lock_init, ompt_callback_mutex_acquire_t);
|
||||||
register_callback_t(ompt_callback_lock_destroy, ompt_callback_mutex_t);
|
register_callback_t(ompt_callback_lock_destroy, ompt_callback_mutex_t);
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
// RUN: %libomp-compile-and-run | FileCheck %s
|
|
||||||
// REQUIRES: ompt
|
|
||||||
#include "callback.h"
|
|
||||||
#include <omp.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
int x = 0;
|
|
||||||
#pragma omp parallel num_threads(3)
|
|
||||||
{
|
|
||||||
#pragma omp atomic
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
#pragma omp parallel num_threads(2)
|
|
||||||
{
|
|
||||||
#pragma omp atomic
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
printf("x=%d\n", x);
|
|
||||||
|
|
||||||
// Check if libomp supports the callbacks for this test.
|
|
||||||
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_idle'
|
|
||||||
|
|
||||||
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
|
|
||||||
|
|
||||||
// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_idle_begin:
|
|
||||||
// CHECK: {{^}}[[THREAD_ID]]: ompt_event_idle_end:
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
Reference in New Issue